Introduction

An automaton is a machine that can repeatedly take on different configurations in response to corresponding instructions. The ability to specify a sequence of these instructions, i.e., a program, underlies the power of automata, which can keep time, write, or play instruments1,2,3. Modern robots usually interpret electronic programs, but automata that interpret mechanical instructions date back at least to Archytas of Tarentum’s wooden dove4,5.

Soft robots and other devices have recently been developed to metamorphose into different shapes in response to light or electronic signals6,7,8,9,10,11. By swelling or shrinking particular parts of a device, these signals can induce almost arbitrary global changes in shape7,12,13. To achieve such behaviors, these devices require (1) line-of-sight access, wires, or tubes to direct signals to the specific location where swelling or shrinking should be induced and (2) batteries or external power sources to store energy that drives material change6,14,15.

Living systems, in contrast, use nucleic acids and proteins to instigate extraordinary physical changes during processes such as morphogenesis, metamorphosis, or cell migration16. Biomolecules have unique advantages as signals: they can be produced in astonishing variety, and signals can diffuse through three-dimensional media and react with high specificity, allowing them to direct change at specific locations17. Biomolecules can also provide the chemical energy required to drive material changes10,11,18.

Here, inspired by these examples, we develop gel automata, centimeter-scale soft materials that can repeatedly and reversibly transform between prescribed shapes in response to specific DNA sequence instructions. Like organisms that use biomolecules to direct shape changes during processes like morphogenesis, gel automata consist of micro-segments that can each grow or shrink when exposed to particular DNA activator sequences. To create gel automata, we first design specific and selective DNA instructions for shape change and the complementary gels that respond to them. We then develop scalable methods for fabricating multi-segmented gels responsive to these different instructions. Finally, we build gel automata that execute complex shape-change programs encoded as DNA sequences to transform between letters, numbers, and other prescribed shapes. Gel automata show how synthetic engineered devices can, like many living organisms, adaptively shape-shift in response to complex sequences of signals without wires or external hardware.

Results

Developing DNA signals that can induce cycles of gel automata shape change

We use gels composed of polyacrylamide/bis-acrylamide (PAAM-co-BIS) or polyethylene glycol (PEG) polymer backbones that are crosslinked by DNA. The hydrogel shape change is driven by polymerization via the DNA hybridization chain reaction19,20,21,22,23,24,25. DNA strands are inexpensive, routine to produce, easy to store, and generally biocompatible26,27,28. A plethora of DNA circuits and responsive release processes could produce DNA sequences to drive a series of such interactions and induce adaptive responses without human intervention29,30.

Ultrathin films can undergo some changes in shape in response to DNA signals31,32,33. DNA sequences can also swell or shrink hydrogels34,35,36,37, but afterward, these hydrogels are no longer responsive to DNA instructions. To direct multiple cycles of gel growth and shrinking, we first sought to design a mechanism where one type of DNA sequence instruction directs hydrogel growth, after which a second type of DNA sequence instruction can direct that same hydrogel to shrink, thereby reversing the growth process. We previously observed that the polymerization of DNA strands can dramatically swell a hydrogel20,21. We asked whether there might be a way to reverse the growth in these polymerization gels by directing a corresponding depolymerization process to achieve significant shrinking. We first investigated a process for shrinking DNA polymerization gels with specific crosslink sequences involving a zipping and unzipping mechanism. One pair of DNA sequences would induce growth by processively polymerizing at DNA crosslinks in a reversible but forward-driven process, and another pair would induce shrinking by altering the polymerizing monomers’ conformations, so stepwise depolymerization becomes favored (Supplementary Fig. 1c). However, such a process failed to induce gel shrinking (Supplementary Fig. 5), possibly due to sluggish kinetics (Supplementary Discussion 1).

Two other experiments established that the DNA depletion from a gel could drive depolymerization and, as a result, significant shrinking. In the first experiment, we grew PEG-co-DNA gels by adding growth activators, then treated the gels with DNase I, an enzyme that cleaves DNA’s phosphodiester linkages. The gels shrank to their original sizes (Supplementary Fig. 6). However, because DNase I irreversibly cleaves the crosslinks that serve as initiation points for growth activator polymerization, adding more activators did not initiate the second growth cycle (Supplementary Fig. 6). In the second experiment, we expanded gels using growth activators and then heated them to 90 °C, which melted the DNA structures formed during polymerization. The gels reverted to their original sizes (Supplementary Fig. 7). Although this process is reversible—allowing for re-expansion after cooling—it lacks the selective, programmable shrinking offered by DNA-directed methods.

We built on the idea that rapid crosslink depolymerization induced gel shrinking to design two sets of DNA sequences that direct growth and shrinking, respectively. One pair of hairpin-shaped growth activators processively polymerize at crosslinks to expand a specific gel region. Another pair of shrinking activators bind to and sequester specific growth activator strands, denaturing the DNA polymers and breaking the crosslinks to shrink a particular gel region (Fig. 1a). An initial pair of growth/shrinking activators (Supplementary Table 1, SDI_v1) induced modest growth then shrinking of a corresponding hydrogel. Guided by the thermodynamics of DNA-crosslinked gel shape change and the kinetics of toehold-mediated 4-way DNA branch migration20,21,38, we varied the domain lengths of these DNA activators to find designs that maximized the amount of growth and shrinking observed (Supplementary Fig. 2a). Increasing the concentrations of the optimized growth/shrinking activators then further increased the extents of growth and shrinking (Supplementary Fig. 2b). We also found that combining growth activators with a small concentration of DNA sequences that terminated extension further increased the amount of growth observed (Supplementary Fig. 9), perhaps because these terminator sequences limited the length of polymers that formed in the absence of an initiator, preserving growth fuel for actuation. Using these results, we designed four systems of growth/shrinking activator sequences that could each specifically and repeatedly direct the growth and shrinking of both PEG and PAAM-co-BIS-DNA gels with corresponding crosslink sequences (Fig. 1b, Supplementary Figs. 10 and 11). These DNA sequences reliably induced the growth of PAAM-co-BIS-DNA and PEG-co-DNA gels as much as 10 and 4 times volumetrically, as well as their shrinking. We observed continued extensive swelling and shrinking over at least five cycles for both types of materials (Supplementary Fig. 12). The DNA strands were not subject to any purification after solid-phase synthesis and thus would be expected to contain a large number of sequence deletions or other errors; despite this, this cyclic growth and shrinking process occurred reliably.

Fig. 1: Tunable gel polymerization (growth) and depolymerization (shrinking) directed by DNA sequence activators.
figure 1

a Schematic of DNA-directed polymerization gel growth and shrinking. Sequential insertion of hairpin-shaped growth activators drives polymerization at crosslinks, and thus, the growth of DNA gels. The shrinking activators drive depolymerization at crosslinks, and thus, DNA gel shrinking. Black dots indicate where DNA is attached to the base polymer (e.g., polyethylene glycol). Brown dots indicate chemical crosslinks. DNA domains (structures that end with arrows) with the same colors are identical or complementary DNA sequences. Scale bar, 1 mm. b Four designed and selective DNA polymerization/depolymerization systems. Differently colored squares [System I (blue), System II (red), System III (yellow), and System IV (purple)] represent hydrogels with different DNA crosslink sequences. DNA activators of each color induce growth and shrinkage of the corresponding (same-colored) hydrogel region. c Schematic of DNA polymerization mechanism. d Schematic of DNA depolymerization mechanism.

In these experiments, we observed that gel shrinking occurred more than ten times faster than gel growth. The difference between the rates of swelling and shrinking can be attributed to the fundamentally different reaction mechanisms underlying each process. Swelling involves the sequential addition of growth activators to the DNA chain so that the overall time for swelling might be expected to increase in proportion to the polymer length (thus the number of consecutive reactions). The reaction rate for the addition reactions involved in the swelling process is relatively slow as measured in solution (103−104 M−1 s−1)38,39. In contrast, shrinking activators can react with all the hairpins of the DNA polymer simultaneously. The rate of a three-way branch migration reaction (~3 × 106 M−1 s−1), which drives the shrinking process, is expected to be faster than the rate of a growth reaction40.

Designing multi-segmented gel automata

We next sought to explore whether selective growth (polymerization) and shrinking (depolymerization) of different gel regions could deform multi-segmented gel automata. We photopatterned gel bilayers and developed shape-change operations, such as curve and uncurve, directed by specific actuation instructions that could be combined into programs (Fig. 2a). We executed the resulting shape-change programs to characterize how one or both layers of bilayers grew, shrank, and induced curvature. The ability to use orthogonal DNA signals for growth and shrinking made it possible to simultaneously grow some gel regions while shrinking others, offering precise control over pathways of shape change. Forces generated by both gel growth and shrinking could drive repeatable shape changes such as bending, straightening, turning, and lengthening (Fig. 2b–e, Supplementary Fig. 3, Supplementary Movies 25). Our system also exhibited control over curvature extent: bilayers could curve slightly or at least into a circle (1.2–2 mm−1 curvature, Supplementary Fig. 13), and because shrinking proceeded faster than growth, this allowed control over the relative curving rate.

Fig. 2: Chemical instructions for gel bilayer shape changes.
figure 2

a Example shape-change operations and their corresponding chemical actuation instructions applied to different bilayers. We define each instruction using the syntax action(system), in which the parenthesized argument is the target DNA system for the action. The example bilayer for the curve operation consists of System I (blue) and System II (red) DNA gel layers. The example bilayer for the uncurve operation consists of System III (yellow) and System IV (purple) DNA gel layers. b Curvature changes of a PEG-co-DNA System III-System IV bilayer gel during the execution of the actuation program, and selected fluorescence images of the gel before, during, and after performing each numbered group of instructions. ce Curvature changes of PEG-co-DNA System I-System II bilayer gels during the execution of the actuation programs. For details on the protocol, see the Methods section. Scale bars, 1 mm.

This advanced and flexible control over curvature extent, speed, and direction suggested that gel automata programs could direct complex, multi-step bending and shape transformation processes. To test this hypothesis, we asked whether we could design multi-segment gels where the growth and shrinking of specific gel regions could allow the gels to transition between many distinct functional shapes. We first sought to design gel automaton strips that could present I-, J-, S-, and C-shaped curves. We calculated the segment lengths of bilayer strips that would transform between these four shapes and designed an actuation program to switch between them (Fig. 3). Fabricating this structure required five computer-aided design (CAD) masks and five photopatterning steps with alignment. We modified a previously developed photolithography gel patterning protocol to reduce misalignment20, form gel regions with uniform thicknesses, reduce delamination from the substrate during patterning, and allow for reliable lift-off of complete, intact devices. Photomasks were used for exposure and as the underlying substrate in multiple patterning steps to improve alignment and reduce material waste. DNA gels are optically transparent; co-polymerizing adjacent gel regions with different dyes allowed for the precise visual alignment required to fabricate complex, multi-segmented gels. We also created CAD masks for adjacent gel segments with overlaps and optimized overlap size to balance material usage, binding firmness, and alignment accuracy (Supplementary Method 1, Supplementary Fig. 14).

Fig. 3: Letter gel automaton transformed using DNA instructions.
figure 3

Design (center) and experimentally realized time-lapse fluorescence images (periphery) of a letter gel automaton that transforms into S, C, J, and I. The fluorescence images with green stars show the gel automaton’s final states after executing each numbered group of instructions (1–4). The actuation instructions use the syntax action(system, degree). The degree argument specifies the concentration of actuators supplied. A value of 1 corresponds to 60 µM activators, and 0.25 to 15 µM. When the argument is 1, it is omitted as a default value. The curved arrows around the model design indicate gel regions that grow during that step. The design parameters, actuation details, and actuation movie are in Supplementary Method 1, Supplementary Figs. 14 and 16, and Supplementary Movie 6. Scale bars, 1.5 mm.

During transformation tests of an initial design (V1.0, Supplementary Fig. 15) for the letter gel automaton, the letter I (the start state) successfully transformed into an S and a C. However, the top part of the gel automaton did not fully straighten during transformation to a J. The top part remained curved as the gel automaton returned to the I configuration. Hypothesizing that this errant curvature was due to a hysteretic effect in which one region remained slightly more swollen after growth and shrinking than it was in its start state, we revised the gel automaton’s design. In letter automaton V1.1, we replaced one of the regions without DNA crosslinks in letter automaton V1.0 with a System I gel (V1.1, Supplementary Fig. 16). We also altered the program for entering the I state from J to include an instruction that slightly grew this region to straighten the segment that had remained curved. Letter gel automaton V1.1 transformed from an I to S, C, and J shapes in sequence and then returned to its original form as directed by the series of DNA instructions we designed (Fig. 3, Supplementary Movie 6).

Designing complex metamorphic gel automata using a neural network-guided algorithm

The use of four orthogonal binary DNA systems allows for up to 24 = 16 actuation states, i.e., gel automaton shapes. If these actuation states altered the curvatures of different segments of a multi-segment structure, they could specify a range of complex forms. To demonstrate such programmable and non-trivial shape change, we sought to develop gel automata that could transform into different numerals, which might be useful for communicating numeric messages. In the I/S/C/J letter gel automaton, two specific segments were modularly designed to curve and uncurve into the top and bottom shapes of each of the letters. In contrast, forming the diverse shapes of numerals would require different segments to play different roles for each numeral. As a result, there was no obvious way to break the design problem into pieces. We hypothesized that we could design such structures in a manner reminiscent of designing biomolecular sequences41: develop an automated algorithm to predict the configurations of different potential digit gel automaton device designs for each of the 16 simulated actuation states, and then search through design space for structures that formed the desired set of digits.

To create a simple simulator for strip bending that could be used for design, we measured the curvatures of bilayer gels made from different combinations of DNA system crosslinks (Supplementary Fig. 13) and assumed that each segment of a multi-segment structure would achieve the same curvatures as they would in isolated bilayers. This simulator predicted the shapes of candidate devices in each specific actuation state and produced simulated micrographs. We then trained a convolutional neural network (CNN) to classify these simulated images to evaluate how well candidate designs could be recognized visually as different digits. Then, we developed a genetic algorithm to evolve designs for devices that could form the set of odd digits or the set of even digits (Supplementary Fig. 4a, Supplementary Fig. 17). To ensure our designs could be fabricated reliably, we restricted our search to devices that could be fabricated in five or fewer steps using the fabrication process we developed. Through this method, we could design and then fabricate one even digit and one odd digit gel automaton (Fig. 4, Supplementary Figs. 18 and 19). These structures were flat in their initial configuration as designed, indicating precise fabrication, alignment, and lift-off over the multiple required fabrication steps (Supplementary Fig. 20). When we actuated each gel automaton using DNA instructions that switched the gel automaton between different actuation states, the resulting structures transformed into each of the designed digit shapes in a prescribed sequence, either 1, 3, 5, 9, 7 for the odd digits (Fig. 4b, top) or 1 (the initial flat strip), 0, 2, 6, 8, 4 for the even digits (Fig. 4b, bottom). Extra DNA activators were added at a couple of later stages to increase/decrease specific curvatures as stated in the instructions (Supplementary Fig. 4c). While mechanical stresses can, in general cause long-range interactions between adjacent elastic columns42, the assumption we made during design that the curvature of different segments could be viewed modularly led to remarkably good predictions of shapes: the digits formed by the gel automata were recognizable and almost identical to the predicted shapes. The availability of different activators also allowed a high degree of flexibility in precisely adjusting the sizes of targeted regions of the gel devices to achieve the desired final shapes.

Fig. 4: Experimentally realized multi-state odd and even digit gel automata transformed using DNA instructions.
figure 4

a Schematic of digit gel automata design. The colors of gel regions represent the gel crosslink sequence type, as in Fig. 1b. Digit gel automata are designed to transform between any of the depicted numerals using DNA activators. b Top left, a photograph of an odd digit gel automaton handled with a metal tweezer, indicating its size and soft, noodle-like characteristic. The top right and bottom row are bright-field images of experimentally realized digit gel automata and the activators used to transform them. Odd (top) and even (bottom) digit gel automata were actuated with respective DNA activator mixtures as shown; the actuation programs are presented in Supplementary Fig. 4c. DNA gel regions were labeled with either fluorescein-O-methacrylate (white) or methacryloxyethyl thiocarbamoyl rhodamine B (magenta) to permit visualization during fabrication; these colors do not correspond to the colors in the schematics. Scale bars, 5 mm.

Discussion

In summary, we have demonstrated shape-shifting gel automata in which biomolecules dynamically and reversibly trigger polymerization and depolymerization of DNA, which leads to the macroscopic growth and shrinking of micropatterned segments, thereby enabling sequence-specific manipulation of architected material shape on the centimeter-scale. The shape-change speed of DNA gels is likely to be governed by the speed at which water diffuses into and out of hydrogels, as NIPAAm-based (N-Isopropylacrylamide) hydrogel actuators exhibit a comparable speed of response43,44,45. This time scale is similar to many natural phenomena involving gel-like substances or tissues. For example, embryogenesis, growth, disease progression, and healing occur over extended periods. Future research might explore various ways to expedite shape transformation, including the use of porous materials, ultrathin films, non-linear chemical reactions, or mechanical snapping processes46,47,48,49.

The four DNA systems developed here were designed to be orthogonal, and in practice, exhibited minimal crosstalk (Supplementary Fig. 11). This was achieved even though as many as 50% of the molecules used likely had sequence errors, suggesting that perfect complementarity was not necessary for actuation (Supplementary Fig. 22)50. Mismatches in the hairpin for DNA hybridization chain reaction are known to affect the resultant DNA polymer’s length51, suggesting that improving sequence quality might lead to greater swelling. Our research developed a unique library of stimuli for intricate shape transformations in pixelated DNA-crosslinked hydrogels and introduced an optimized photolithography method for precise device creation. While 3D printing has DNA-related cost challenges, we have also explored Multi-domain, Automated Photopatterning of DNA-functionalized Hydrogels (MAPDH), a technique for producing 2D DNA-functionalized hydrogels with potential 3D applications26,52,53,54,55,56.

Controlled shape transformations in hydrogels require an interdisciplinary approach that combines chemical engineering, molecular design, and precision fabrication. These foundational principles, mirrored in areas such as tissue engineering and drug delivery, enable gel automata to be articulated through mask designs and actuation protocols. Consequently, this paves the way for designing a diverse array of dynamic, multi-functional, and autonomous devices using automated processes and wafer-scale fabrication techniques. The vast space of DNA sequence design allows extensive tuning and programming of complex shape changes, providing a pathway to creating digital materials, which are engineered to adapt their physical properties or behaviors in response to digital signals or inputs. Studies on the mechanical attributes of DNA-crosslinked hydrogels also affirm their ability to undergo robotic shape changes20,21,57. It is noteworthy that biochemical activators and repressors direct most signaling and actuation programs in biological systems; their use here transcends the limits of pneumatic, fluidic, or electronic soft activators by allowing ready miniaturization, precise control of shape change, and actuation at a distance and in confined and tortuous spaces7,10,37,58,59,60,61,62,63.

Methods

DNA sequences and preparation

The sequences for the DNA crosslinks and growth and shrinking activators are listed in Supplementary Table 1. DNA Sequences were designed using NUPACK 3.2.2 to have specific secondary structures and minimal undesired crosstalk64. A temperature of 25 °C and salt conditions of 0.05 M Na+ and 0.0125 M Mg2+ were used in all design programs. Designs were produced iteratively by adding new sequences to an existing set of sequences and domains (system 1–4 strands in ref.20, Supplementary Fig. 8), and we ran multiple design trials to produce several potential sets of DNA sequences. These sets of sequences were then ranked by the degrees of interaction with existing sequences predicted by NUPACK for the final selection of sequence designs. Sample scripts are at https://doi.org/10.7281/T1/WYN7FI. Unmodified and Acrydite-modified oligonucleotides were purchased in lyophilized form from Integrated DNA Technologies (IDT) with standard desalting purification. The DNA strands were solubilized in Tris-acetate-EDTA (TAE) /0.0125 M Mg2+ (TAEM) buffer (TAE buffer, Life Technologies, #24710-030; Magnesium acetate tetrahydrate, Sigma #228648). DNA concentration was verified using absorbance spectroscopy at 260 nm. 3 mM DNA crosslink complexes were annealed in TAEM from 90 °C to 20 °C at a rate of 1 °C/min using an Eppendorf Mastercycler. Growth activator strands were heated to 95 °C for 15 mins and then flash-cooled in ice for 5 mins at a concentration of 400 µM.

Preparation of DNA gel pre-gel solution

The concentrations of the components in PAAM-co-BIS-DNA pre-gel solution were: 1.41 M of acrylamide (BIO-RAD #161-0100), 5 mM of N, Nʹ-methylenebis(acrylamide) (Sigma-Aldrich, #146072), 1.154 mM DNA crosslinks, 2% v/v Omnirad 2100 (iGM Resins USA, #55924582), and 2.74 mM methacryloxyethyl thiocarbamoyl rhodamine B (Polysciences, Inc., #23591). The concentrations of the components in the PEG-co-DNA pre-gel solution were the same as those in the PAAM-co-BIS-DNA pre-gel solution except PEGDA-MW10k (Sigma-Aldrich, #729094) and PEGDA-MW20k (Sigma-Aldrich, #767549) were 10 wt%, and one of these was used in place of acrylamide and bis-acrylamide. Unless noted otherwise, PEG-co-DNA gels contain PEGDA-MW10k. Omnirad 2100 was first made into a 75% v/v butanol solution to help disperse into the pre-gel solution. When making gel bilayers, 1 mM fluorescein-O-methacrylate (Sigma, #568864) fluorescent dye was included in lieu of 2.74 mM methacryloxyethyl thiocarbamoyl rhodamine B (Polysciences Inc., #23591) in the pre-gel solution when patterning the second (upper) gel layer. The pre-gel solutions were mixed well using a pipettor and then were ultrasonically mixed for 1 min (for PAAM-co-BIS-DNA) or 3 mins (for PEG-co-DNA) before being degassed in a vacuum chamber for 15 min.

Lithography chamber fabrication

The lithography chamber consisted of a chromium (Cr) mask, a glass substrate (or a Cr-coated glass substrate with patterns), and desired thickness tape serving as spacers at the left and right sides within the chamber (160 µm for monolayer gels and 60 µm for bilayer gels) to control gel thickness20,21. Plastic masks, which were then utilized for making Cr masks or Cr-coated glass substrate, were first designed using AutoCAD and then sent for printing (Fineline Imaging). Glass slides were cleaned with DI water and isopropyl alcohol (IPA), then blow-dried using nitrogen gas before being spin-coated 3 nm SC1827 (Microchem, Microposit S1800 Series) and baked on a 115 °C hotplate for 1 min. The prepared glass slides were cured through plastic masks with 180 mJ/cm2 365 nm UV light, then developed using a 1:5 w/w Microposit 351 Developer (Shipley) and washed with DI water. A 150 nm (for monolayer gel fabrication) or 300 nm (for multi-step patterning process) Cr layer was then deposited onto the glass slides through thermal evaporation. The remaining photoresist layer was washed with acetone ultrasonically and DI water. All glass slides, Cr masks, and Cr-coated glass substrate were cleaned with water and IPA and then blow-dried before each use. For multi-step photopatterning, CYTOP (Type M, Bellex International Corp.) was applied to Cr masks to prevent gels from sticking or lift-off.

Photopatterning process

To pattern square-shaped, 1 mm side length monolayer gel films with a thickness of 160 µm, the pre-gel solution was injected into a chamber and then exposed to a 365 nm UV light source for 160 mJ/cm2 (PAAM-co-BIS), 800 mJ/cm2 (PEGDA-MW10K) or 1000 mJ/cm2 (PEGDA-MW20K) exposure dose. To pattern 2 mm-long, 0.5 mm-wide bilayer gel structures with each layer thickness of 60 µm, the pre-gel solution with fluorescein-O-methacrylate was first patterned using the exposure energy stated above. The first gel layer was gently washed using TAEM buffer and dried using nitrogen gas. The second 60 µm spacer was added to the gel chamber to increase the chamber height to a total of 120 µm. The mask was then aligned with the patterned gel, and the pre-gel solution containing methacryloxyethyl thiocarbamoyl rhodamine B was UV-cured. Process diagrams for the multi-step gel automata photopatterning process are shown in Supplementary Fig. 14, Supplementary Fig. 18, and Supplementary Fig. 19. Additional descriptions of the processes can be found in Supplementary Method 1. Briefly, we designed the Cr masks to have four aligning cross-shaped markers at the corners to enable alignment between gel segments. The final segment lengths of each region in the photopatterned masks for the multi-segment strips were each 1.5 times the lengths designed using computer programs. This increase in mask length was introduced to compensate for the curvature reduction in the subsequent cycle of a multi-step actuation. During the first step of multi-segment structure fabrication, a Cr-coated glass substrate with the same pattern as the photomask was used instead of a transparent glass substrate so that the aligning markers on the Cr mask could be used during subsequent patterning steps. In the following fabrication steps, gels were gently washed with TAEM and blow-dried after each patterning step, and additional spacers were added when the first layer of photopatterning was finished, as described in the bilayer gel fabrication process. All gels were washed and hydrated with TAEM buffer, gently removed from the glass substrate or Cr-coated glass substrate, and stored in TAEM in a 4 °C fridge until actuation.

Characterization of monolayer DNA gel shape change

The extent of growth and shrinking of monolayer gels were measured using time-lapse fluorescence imaging with a gel imager (Syngene EF2 G: Box) equipped with a blue light transilluminator (Clare Chemical, max emission at ≈ 450 nm) and a UV 032 filter (Syngene, bandpass 572 – 630 nm), or an automated imaging system described in the Supplementary Method 2 as Programmable imaging system (Pi-Imager) for time-lapse fluorescence image capturing (Supplementary Fig. 21). The gel samples were transferred to wells within a black-walled 96-well plate to isolate the gels from each other during actuation. Unless noted otherwise, solution composition and solute concentrations are as stated below: gels were expanded in TAEM supplemented with 0.01%v/v Tween20 (Sigma, #051M01811V) (TAEM-Tween20) to prevent gels from sticking to the well surfaces. 150 µL of TAEM-Tween20 solution containing 60 µM DNA growth activators (99% polymerizing, 1% terminating) was added to each well. After 72–100 hours of growing, the DNA solution was switched to 100 µL TAEM-Tween20 for 15 mins, and the solution was removed, and then 150 µL TAEM-Tween20 shrinking activators solution was added. The above growth/shrinking process was repeated when characterizing multiple actuation cycles. Buffer was added to clean the dish and gels between steps to maintain consistent actuation concentrations and ensure more straightforward actuation results. However, such steps are not required for reversible actuation (Supplementary Fig. 23). Images were taken every 30 mins, and the resulting photos were segmented into smaller images, each containing one gel for further MATLAB processing. All images were first transformed into gray-scale images by extracting the red channel signals from the original RGB image. Images were then contrast-stretched using MATLAB’s Image Processing Toolbox (2019a) to reduce background and simplify further feature extraction. The four side lengths of the gel in each image were measured and averaged as follows. The extrema and centroids of the objects were determined using MATLAB’s function regionprops. Eight locations provided by the extrema of a gel object (two points at the ends of each side) were used to determine the locations of the four vertices by K-means clustering. The average distance between these four clusters was used as the measure of the side length of the gel. The relative change in side length (ΔL/L0) of the gel was calculated using the measured side lengths (L) from each image in a time series relative to the side length prior to adding DNA activators (L0). PAAM-co-BIS-DNA gels were sometimes too dim to find with the MATLAB code described above. In such cases, the raw images were first treated by flat-fielding to have a brighter view and a more significant contrast against the background, in addition to the previously described process for edge-length determination. Shaded area/dotted lines enclosed the standard deviation of the mean growth value, which were smoothed using MATLAB smooth function over 50 (growing) and 10 (shrinking) points, N (sample size)= 3 or 4.

Characterization of bilayer DNA gel actuation

Fluorescence images of the bilayer gels were captured using the gel imager, blue light, and filter stated in Characterization of monolayer DNA gel shape change. Before actuation, bilayer gels were set on their sides so that curvature could be measured from a side view of a gel. The DNA-directed actuation and solution exchange processes were the same as those described in Characterization of monolayer DNA gel shape change. Images were taken every 30 mins and were segmented into images, each containing one gel for further processing in MATLAB. Within each image, the pixels that contained the gel were first determined by selecting pixels more than 4.3 standard deviations brighter than the mean fluorescence intensity of the image to produce a binary image. The binary image was smoothed and thinned to a curve using MATLAB’s bwmorph function. The radius of curvature of the contour connecting the coordinates on the line/ring was determined using the Taubin method65. The direction of curvature of bilayer gels was distinguished using +/- (the sign of the radius of curvature). Shaded area/dotted lines enclose the standard deviation about the mean curvature value, which were smoothed using MATLAB smooth function over 20 (ascending) and 10 (flat and descending) points, N = 3.

Letter gel automata design

We began creating a letter gel automaton by manually designing a three-segment gel bilayer stack, with the idea that the top and bottom portions would curve in different directions to form the top and bottom elements of the C, S, and J. To choose the lengths and systems of each gel region, we visualized the resulting curves produced by candidate bilayer strips by assuming that the segment of the bilayers would have a radius of curvature of 1.5 mm−1 based on measured curvature values in Supplementary Fig. 13 and that the composite structure of the three-segment bilayer would be formed by concatenating the shapes of each segment. The resulting design (V1.0) is shown in Supplementary Fig. 15, and the improved design (V1.1) is in Supplementary Fig. 16.

Simulation of digit gel automata transformation

Using data from bilayer DNA-co-polymerized gel characterization (Supplementary Fig. 13), we developed a numeric simulation to predict the final shapes of the gel automata. We characterized the radii of curvature (RoC) of bilayer gels and the changes in contour length resulting from different actuation combinations. A lookup into the resulting table of these values, indexed by each system type, sets the radius of curvature and change in contour lengths of individual bilayers within a bilayer segment. To predict the shape of the contour of an gel automaton consisting of multiple bilayer segments, we assumed that bilayer gel segments curved independently of one another. To simulate the curvature of gel automata, we began with a 1D array segment_lengths and a 2d array identities as inputs and generated a gel automaton object. The segment_lengths array encoded the lengths of each segment, while identities encoded the types of systems in each segment. We then simulated the (up to) 16 possible states that a gel automaton could transform into, given our four switchable DNA systems to produce 16 output images as follows. We first retrieved the values of the radii of curvature and change in contour from the tables referenced above to obtain a 1d array rocs for the radius of curvature of each segment and a 1d array ctls for the change in contour length of each segment. We then produced a final shape consisting of the concatenation of the final curves of each of the bent segments. These curves were produced by generating the next point along a composite curve using a numerical contour integration scheme. Specifically, starting at (x, y) = (0, 0) and q = 0, we used delta = 20 µm as a mesh size and an iterator object to generate the next (x, y) point as follows:

$$\Delta \theta=\frac{{{{\rm{delta}}}}}{{{{\rm{radius}}}}\; {{{\rm{of}}}}\; {{{\rm{curvature}}}}} \, \Longrightarrow \, \theta=\theta+\Delta \theta$$
(1)
$$\Delta x={{{\rm{delta}}}}\times \sin \theta \, \Longrightarrow \, x=x+\Delta x$$
(2)
$$\Delta y={{{\rm{delta}}}}\times \sin \theta \, \Longrightarrow \, y=y+\Delta y$$
(3)

The iterator generated new points within a given segment till the segment length limit \({segment\; length}\times \left(1+\Delta {contour\; length}\right)\) for a segment was reached. The scheme then generated points for subsequent segments by continuing along the integration path. We next compiled 28 × 28-pixel images using the x, y points and applied a Gaussian filter (with sigma value = 0.8) to each generated image so that the images appeared similar in texture to the handwritten digits in the MNIST digits library66. For additional details, refer to https://doi.org/10.7281/T1/WYN7FI.

Convolutional neural network (CNN) for autonomous classifiers

We first compiled a convolutional neural network model with the TensorFlow library (Ver 2.4.3). We then trained the model with a dataset containing the MNIST digit dataset and a dataset generated by gel automaton geometry simulation. The generated dataset includes twenty-eight thousand human-labeled strip images. These images were either recognizable as one of the 0–9 digits (and thus were labeled with respective digits) or were considered random squiggles, i.e., curves not representing any numeral, and were labeled as an eleventh category. Random squiggles were included as a class so that the model could determine whether a shape resembled any digits, in addition to quantifying the resemblance of a shape to the digit. We combined the generated dataset and the MNIST dataset for model training. The combined dataset consisted of 98,000 images and was split into train and test sets, which contained 84,000 and 14,000 images, respectively. The data were normalized prior to training so that each pixel value lay between 0 and 1. The CNN model consisted of two convolutional layers with rectified linear unit (ReLU) activation and max-pooling layers. Dropout layers were included to avoid overfitting, and a flattened layer was added prior to the fully connected layers. Two fully connected layers with Relu activation and a final output layer with softmax activation were present at the end of the network for classification. The model was compiled with categorical cross-entropy loss, and trained using the Adam (Adaptive momentum estimation) optimizer with the default learning rate (0.001) from the TensorFlow library. The trained network achieved ninety-eight percent accuracy on the test set by the end of training. Scripts used can be found at https://doi.org/10.7281/T1/WYN7FI.

Genetic algorithm for digit gel automata parameter search

We developed a genetic algorithm to efficiently search through the large parameter space of bilayer gels to find designs for digit gel automata. The algorithm started with an initial population of gel automaton designs generated from a random seed. Each design within the population was then simulated to find all possible geometric outputs of each of the 16 actuation combinations. The digit that each output resembled, and its extent of resemblance were calculated using the network described in Convolutional neural network (CNN) for autonomous classifiers. During the scoring process, all images were rotated at twenty different angles, and the image with the highest score as a digit was selected to represent the final class and the score of the image. The scores for each of the 16 actuation combinations were stored in a 2d array documenting what digits were formed and the score for each digit. A custom loss function was used to evaluate the fitness of each design:

$${{{\rm{loss}}}}= 5000 \times {{{\rm{number}}}} \; {{{\rm{of}}}} \; {{{\rm{digits}}}} \; {{{\rm{formed}}}} \\ \times {\sum }_{i=0}^{9}{{\mathrm{ln}}}\left(1.001-{{{\rm{score}}}}\; {{{\rm{for}}}} \; {{{\rm{digit}}}} \; {{{\rm{i}}}}\right)$$
(4)

The loss function computes the diversity and the similarity to real digits of the digits formed. Designs with output images that resembled a larger number of different, easily recognized digits were fitter according to this loss function and, therefore, more likely to be preserved in the population than those with fewer such output images. During the selection stage, 80% of the designs within the population were eliminated by selecting the designs with the 20% lowest (best) loss score to preserve. These preserved designs were sent into a mutation function to repopulate a new generation. The mutation was performed using the single-parent mutation method, where the genetic information of each descendant came from a single survived design from the previous selection. During mutation, each design had a fifty percent chance to randomly update the gel automaton segment lengths, preserving the activator pattern information. Otherwise, half of the regions in the activator pattern were mutated. Each survivor design generated four descendants, so the population returned to its original size after every round of selection and mutation. Finally, the algorithm iterated the population generation, selection, and mutation cycle until reaching the generation limit and output the optimized designs. We slightly tweaked the loss and mutation functions to obtain fabricable devices for our even digit and odd digit gel automata search. We first included an additional rule within the mutation function to ensure new designs are within reasonable patterning steps to avoid generating designs that are overly complex and thus un-patternable. The number of fabrication steps was calculated as the sum of the number of unique activator systems in each layer. Patterns that require more than six fabrication steps were eliminated from consideration and either regenerated (if part of the initial population) or re-mutated from a parent (during subsequent rounds). We used this algorithm to search for an even digit gel automaton and an odd digit gel automaton, changing the loss functions for the two searches and deriving the final optimized outputs (Supplementary Fig. 4, Supplementary Fig. 17).

$${{{\rm{loss}}}}= 5000 \times {{{\rm{number}}}} \; {{{\rm{of}}}} \; {{{\rm{digits}}}} \; {{{\rm{formed}}}} \\ \times {\sum }_{i={1,3,5,7,9}}{{{\mathrm{ln}}}}(1.001-{{{\rm{score}}}} \; {{{\rm{for}}}}\; {{{\rm{digit}}}} \; {{{\rm{i}}}})$$
(5)
$${{{\rm{loss}}}}= 5000 \times {{{\rm{number}}}} \; {{{\rm{of}}}} \; {{{\rm{digits}}}} \; {{{\rm{formed}}}} \\ \times {\sum }_{i={0,2,4,6,8}}{{\mathrm{ln}}}(1.001-{{{\rm{score}}}} \; {{{\rm{for}}}} \; {{{\rm{digit}}}} \; {{{\rm{i}}}})$$
(6)

Actuation of letter and digit gel automata

As-made gel automata were transferred to a 1-inch diameter glass bottom petri dish for actuation and imaging. During monolayer and bilayer gel actuation, 1 ml of TAEM-Tween20 solution consisting of 60 µM DNA activators mix (99% growth activators, 1% growth terminators) was added to the petri dish. When further tuning of specific regions of the gel automata was needed, an additional 15 µM DNA activators mix was added to the solution. Between each actuation step, the old DNA solution was removed, and TAEM-Tween20 buffer was added for 15 mins and removed before the DNA solution for the next actuation step was added to the petri dish. Before each subsequent activation step, bright-field images were taken using a Hayear 4 K Microscope Camera (HY-1070). The actuation process was recorded using the gel imager Syngene EF2 G: Box using the imaging protocol described above for the letter gel automaton.

Letter gel automata image processing

Images of letter gel automata actuation results were processed using MATLAB’s Image Processing Toolbox 2022a. For each image, objects were identified using brightness thresholding followed by morphological closing. The object closest to the center of the image was then selected as the gel body. We then filtered individual images by dimming the background brightness while keeping the brightness of the gel body unchanged. Specifically, we created a binary mask covering the gel body and dimmed the region’s brightness outside the mask to zero. We then matched the image histogram of all images to the first image (in the actuation process) histogram as a reference, and the intensities of over-exposed regions were reduced by 15%.