Abstract
Adjusting magnetization orienting and conformal assembling of high-coercivity micro-magnets at the microscale remains challenging, despite long-standing demand for space-resolved magnetic modulation in various applications. Local magnetic modulation, including remagnetization or reassembly, typically requires high fields and temperatures to overcome the coercivity and stringent conditions while suffering from low assembly efficiency or poor spatial resolution. Here, we report a linear magnet composed of a hydrogel (alginate) matrix and precisely discrete phase-change-material (PCM, eicosane) cells containing micro-magnetic particles (NdFeB, ~5 µm). Moderate local laser heating (~40 °C) reversibly switches PCM from solid to fluid state thus relaxing particles’ interfacial constraints inside the hydrogel matrix, overcoming the high-coercivity of magnetic assembly and allowing particles in cells to reorient under mild fields (≤30 mT). The linear magnet shows excellent discrete magnetization programmability (~150 µm) and stretchability (strain ~80%), enabling versatile functionalities such as conformal and patterned field generation, soft robotic actuation, flexible sensing, and interactive wearables with dynamically coded information.
Similar content being viewed by others
Introduction
Magnets permanently magnetized and conformally assembled on a microscale hold great relevance and significance in a wide range of applications such as flexible robotics1,2,3,4,5,6,7,8,9, microfluidics10,11,12,13,14, wearable devices15,16, and invasive medical machines17,18,19,20. When subject to magnetic actuation, individual micro-magnets align their magnetization direction with external fields or move along field gradients, producing microscopic torque and force that collectively govern the dynamic behavior of the macroscopic assembly including displacement, rotation, and shape-morphing4,5,6,7,8,9. Additionally, patterned micro-magnets with space-resolved magnetic fields enable applications such as near-field recording for information storage21,22 or sensing1. Adjusting both the magnetization direction and its conformal assembly orientation of the individual micro-magnets is thus fundamentally important. However, local magnetization direction adjustment usually requires strict conditions (temperatures higher than Curie point and fields stronger than the coercive field)23 to overcome the high coercivity of the micro-magnets6,9 or suffers from repeated procedures to adjust the conformal assembly on the microscale with low efficiency24 or poor spatial resolution7. A longstanding challenge is to design a magnet that enables convenient magnetization modulation and high-efficiency conformal assembly, which is imperative for its translation into emerging applications such as flexible electronics1,16, and medical robotics17,18,19.
Several techniques, such as 3D printing4,25, template-assisted programming6, and micro-assembly24, represent milestone innovations to modulate the magnetization of high-coercivity magnets in soft materials. However, these methods inherently combine fabrication with magnetization programming, leading to an unchangeable magnetization profile after fabrication9 (Supplementary Table 1, Supplementary Fig. 1). Selecting magnets with low coercivity (~100 mT) can provide convenience for magnetization modulation. For example, nanomagnets fabricated with lithography can achieve magnetization modulation after fabrication with extremely high resolution in one degree of freedom3,26. Alternatively, sacrificing manufacturing accuracy to incorporate high-coercivity magnets into dynamic materials before molding27,28,29, or manual assembly30 also offers a promising approach for achieving dynamic magnetization modulation (Supplementary Table 2, Supplementary Fig. 2). However, it is still a notable challenge to realize high resolution magnetization modulation of high-coercivity (~1 T) magnets, let alone with the capability of free conformal assembly.
Here, inspired by the magnetotatic bacteria (Magnetospirillum magneticum, AMB-1), a special kind of bacteria that can sense and move in the direction of applied magnetic fields, we report a linear magnet with fluid-solid-switchable micro-magnetic cells (~150 μm) that is assembled by fluid through a microfluidic chip in a single step at an extremely high production rate (> 50 cm min−1). Inside a one-dimensional linear hydrogel (alginate) matrix, discrete magnetic cells, phase-change-material (PCM, eicosane) microspheres containing neodymium-iron-boron (NdFeB) microparticles (~5 μm), are equidistantly distributed with a low coefficient of variation (≤ 3%). Upon focused illumination of a near-infrared (NIR, 785 nm) laser, the PCM of the selected cell undergoes solid-to-fluid phase transition which frees the boundary constrain of NdFeB microparticles, allowing reorientation of their magnetization aligning direction in mild field strength (≤30 mT) and temperature (~40 °C). The sequential assembly of magnetic cells with distinct three-dimensional magnetization inside hydrogel forms a linear magnet which sets the ground for rich dynamic soft actuation, flexible information encoding, and conformal magnetic field generation. Using such a strategy, various applications in smart devices, including flexible actuators, sensors, and encoders, are demonstrated. The cellular linear magnet breaks the programming limitations of high-coercivity magnets and has great potential in advanced fields such as wearable electronics, soft robotics, and minimally invasive medicine, to name a few.
Results
Magnetospirillum magneticum-inspired programmable linear magnet
As illustrated in Fig. 1a, b, our linear magnet is composed of a transparent hydrogel matrix and discrete PCM cells containing NdFeB magnetic microparticles (~5 μm). This linear magnet is inspired by a kind of linear magnetotactic bacteria (Magnetospirillum magneticum, AMB-1) which contains magnetite-rich magnetosome chains within the hydrogel-like cell membrane31,32,33,34,35 (Fig. 1a and Supplementary Figs. 3, 4). The hydrogel-like cell membrane enables the bacteria to undergo conformal or active shape-morphing, and the intrinsic magnetic dipole moment arising from the aligned magnetosome chains endows the bacteria with the ability to respond to external magnetic fields (Supplementary Movie 1). However, the orienting directions of magnetosome chains are immutable once assembled, making such magnetotactic bacteria only move along a fixed magnetic axis correlated to the geomagnetic field31,32,33,34,35 (Supplementary Fig. 5).
a Schematics of the programmable linear magnet which is an alginate hydrogel string hosting equidistantly distributed phase-change-material (PCM) microspheres (i.e., micro cells) containing NdFeB microparticles. The inset TEM image on the lower right shows that the Magnetospirillum magneticum (AMB-1) possesses magnetosome chains that are rich in magnetite within the hydrogel-like cell membrane. Scale bar: 1 μm. b Optical microscopy images showing a section of the linear magnet. Scale bars: 3 mm (left), 500 μm (right). c Schematics of the programming strategy for the linear magnet. Upon near-infrared (NIR) laser irradiation, the PCM melts into the fluid state because of the intrinsic photothermal property of NdFeB microparticles. The boundary constraint on the NdFeB microparticles is removed, allowing their realignment in a mild programming magnetic field and temperature. By switching off the laser, the PCM solidifies into a solid state, and the programmed magnetization is preserved as the NdFeB microparticles are kinematically fixed. The insets on the right show that the magnetization direction of a cell is programmed from one direction to another. Scale bar: 100 μm. d Comparison of different magnet-based systems. Although the linear magnet’s coercivity is stronger than that of a ferrofluid and a fluidic magnet like a conventional solid magnet, its fluid-solid-switchable cells make it simpler to change the direction of magnetization. Additionally, the hydrogel’s softness of the linear magnet also makes it easier to be conformally assembled, like ferrofluid and fluidic magnets. e Selective programming of the 4th cell of a 7-cell linear magnet. Scale bar: 500 μm. f The reprogrammable shape-morphing of the linear magnet in a fixed magnetic field (30 mT in the vertical direction). Scale bar: 10 mm. g A surface with 3D-printed character grooves conformally assembled with linear magnets and a piece of fabric woven with linear magnets. Scale bars: 5 mm.
The biocompatible PCM (i.e., eicosane36, melting point ~36 °C) is thus assembled surrounding these magnetic particles inside the hydrogel. The magnetic particles embedded in the hydrogel are then magnetized with a field of 2.7 T after assembly. As a focused near-infrared (NIR) laser beam irradiates through the transparent hydrogel, the discrete micro-magnetic cells can be addressably and remotely heated up37,38,39 due to the inherent photothermal effect of the NdFeB microparticles (Fig. 1c, Supplementary Movie 2, and Supplementary Fig. 6), triggering the melting of PCM medium. As a result, the original solid-solid interface transitions into a solid-fluid interface for chains of NdFeB microparticles, allowing ready chain formation or reorientation in an external programming field whose strength (30 mT typically used, minimum ~4.6 mT, see Supplementary Fig. 7 for more details) is much milder than that of the conventionally required saturation field strength (2 T) and at a temperature (~40 °C) that is much lower than the Curie point (309 °C)9. By switching off the illumination, the rapid natural cooling (see Supplementary Fig. 8 for more details) reverts the boundary of NdFeB microparticle chains to be solid-solid type, fixing their programmed orientation (see Supplementary Movie 3 and Supplementary Figs. 9, 10 for more details about the reprogramming setups). As shown in the right insets of Fig. 1c, the diluted (for better visualization, totally black for undiluted ones) magnetic cells show the chain alignment of NdFeB microparticles changes from one direction to another, confirming the effectiveness of laser-triggered programming. It is worth noting that this linear magnet can be conformally assembled and features easy magnetization switching like ferrofluid and fluidic magnets1, while exhibiting a larger coercivity like a solid magnet (Fig. 1d), which is critical for applications that rely on high remanence. As shown in Fig. 1e, the magnetization of the 4th cell of a 7-cell linear magnet selectively changes from the south to the north pole, owing to the 180°-rotation of those chains of NdFeB microparticles.
The softness and elasticity of the hydrogel matrix allow the linear magnet to be highly deformable and conformal. As shown in Fig. 1f, in response to the actuation field, the reprogrammed space-resolved magnetization coaxes a linear magnet of fixed geometric configuration into distinctive shape morphing behaviors (Supplementary Movie 4). Moreover, the programmable linear magnet can adapt different target shapes for conformally assembling (Fig. 1g, top), even sewn into a piece of fabric (Fig. 1g, bottom) to generate conformal and programmable magnetic fields or carry intricate magnetic information for remote sensing, meriting technological potential in smart fabrics15,16,40 and robotics19,20,27.
Fluid-based assembly and performance characterization
Continuous and organized microparticle assembly with micrometer resolution at high throughput remains challenging. Leveraging the phase-changing nature, we combine two previously independent concepts-capillary microfluidics41 and microscale solid patterning-as a route to fabricate the linear magnet (Fig. 2a, and Supplementary Movie 5). Accompanied by the sodium alginate (SA) continuous phase, the disperse phase, NdFeB-microparticle-in-PCM suspension, is melted at a temperature of ~50 °C and pumped into the microfluidic device. To form a thermodynamically stable NdFeB-microparticle-in-PCM suspension, the surface of NdFeB microparticles is functionalized to be hydrophobic (Supplementary Movie 6) and then dispersed in the melted PCM with fumed silica as a rheological modifier (see Supplementary Fig. 11 for more details)4,42. Because of Rayleigh-Plateau instability, the disperse jet breaks up into a sequence of uniformly-sized droplets in a well-controlled manner43. As the continuous phase, laden with droplet chain, is injected into a pool of CaCl2 solution at room temperature, the biphasic liquids simultaneously solidify due to chemical crosslinking of the alginate hydrogel and the PCM’s fluid-to-solid phase transition (see Supplementary Fig. 12 for more details about the manufacturing device and process). Figure 2b shows the relationship between the production rate and the total flow rate of the feedstock. The highest production rate is more than 0.5 m min−1.
a Schematics showing the fluid-based assembly of linear magnets in a microfluidic system. The heated disperse phase and continuous phase (sodium alginate, SA) are simultaneously pumped into the microfluidic device. Subsequently, the disperse phase breaks into a sequence of uniformly sized droplets. Being exposed to a CaCl2 solution at room temperature, the biphasic liquid solidifies owing to the chemical crosslinking of alginate hydrogel and fluid-to-solid PCM phase transition. b The production rate of the linear magnet in a linear relationship to the total flow rate. The inset shows a photograph of a roll of linear magnets. Scale bar: 5 mm. The error bar indicates the standard deviations (SDs) of three different measurements. c SEM images of the dehydrated linear magnet with uniformly sized micro cells. The inset shows the magnetization-reorientable micro cells and hydrogel structure (dehydrated). Scale bars: 400 μm, 100 μm (inset). d The optical microscopy images showing the in situ programming of the micro cells. The magnetization direction changes from vertical to horizontal after laser heating. The mass fraction of NdFeB particles in the cell is diluted tenfold for clear visualization of the particle rotation. Scale bar: 200 μm. e Thermal response of a single micro cell at different laser power. Blue and pink shaded regions, respectively, denote off and on states of the NIR laser. The heated cell is cooled naturally at room temperature. f Infrared thermal image showing the temperature distribution of a linear magnet heated by a 0.35 W cm−2 laser. The corresponding temperature profile is extracted along the lengthwise centerline. The laser is positioned at x = 0 mm. Scale bar: 1 mm. g Spatial coordinates of a bending linear magnet under stepwise increasing magnetic flux densities, ranging from 0 to 30 mT. Gravitational acceleration is along with the positive y-axis. h The deflection of linear magnets of different length-diameter ratios (L/d) upon magnetic actuation. The inset shows the image of a bending linear magnet. The error bar indicates the SDs of three different measurements. Scale bar: 4 mm. Source data are provided as a Source Data file.
As shown in Fig. 2c, a dehydrated linear magnet is observed using a scanning electron microscope (SEM) (see Supplementary Fig. 13 for more details). Discrete micro cells of uniform size are enclosed in the hydrogel string (Supplementary Figs. 14, 15). To examine the magnetization programming in an in situ manner, we observe the field-actuated chain rotation of NdFeB microparticles in the melted PCM (the cells are diluted for better visualization) using an optical microscope (Fig. 2d, Supplementary Movie 2, and Supplementary Fig. 6). Upon laser heating, the pre-programmed and parallelly-aligned microparticles relax owing to the loss of boundary constraints. By subsequent application of a programming magnetic field (30 mT) generated by a Helmholtz coil44 (see Supplementary Note 1, and Supplementary Fig. 16 for details), the microparticles realign themselves with the external field direction, producing a 90° magnetization rotation which confirms its on-demand and remote programmability (see Supplementary Fig. 17 for more details). During magnetic programming, the process should be protected from interference by other magnetic fields, either by maintaining distance or using magnetic shielding. Additionally, appropriately increasing the programming field strength can help minimize unavoidable disturbances.
To examine the selectivity, we map the thermal diffusion of localized laser heating. As shown in Fig. 2e, the center temperature of a micro cell rapidly climbs over the melting point of the PCM and then smoothly levels off upon relatively thermal equilibrium. Stronger laser power triggers faster phase transition. To circumvent the melting of contiguous micro cells, we use infrared thermal imaging (Fig. 2f) to map the relative equilibrium temperature field. It is found that the temperature rapidly decays at offset positions, signified by the sharp slope of the spatial temperature curve (Fig. 2f). Consistent with the theoretical analysis (see Supplementary Note 2 for details), by adjusting the power, the phase transition range can be limited to less than 72 μm, a length shorter than that of the pitch of cells. In this way, the micro cells can be addressably overwritten.
To examine the shape-morphing performance, a linear magnet is placed at the center zone of a Helmholtz coil for a uniform magnetic field (see Supplementary Fig. 18 for the schematics). When subjected to different magnetic flux densities (B), the linear magnet deflects due to the magnetic body torque arising from the direction difference between the cells’ magnetization (M, along the axis) and the applied field (Fig. 2g). It is found that the deflection (\({\delta }_{{{\rm{x}}}}/L\)) of the linear magnet could be precisely controlled by the external magnetic field, a feature owing to the space-resolved magnetization patterning45,46. The driving torque (\({{{\boldsymbol{\tau }}}}_{{{\rm{m}}}}\)) could be written as follows:
Based on tractable assumptions47,48, we can have a governing equation for the deflection as follows:
where E denotes Young’s modulus, I denotes the area moment of inertia, A denotes the cross-sectional area, \(\theta\) denotes the angle between the tangent of the linear magnet and the reference axis, s denotes the arc length, and \(\varphi\) denotes the angle between magnetic field direction and the reference axis direction (Supplementary Fig. 18). By considering the magnetization of the linear magnets (Supplementary Fig. 19), experimental results are consistent with the theoretical derivation (Fig. 2h and Supplementary Figs. 20, 21). The governing equation (see Supplementary Note 3 for details) offers us an analytical model to predict the shape-morphing of the linear magnet subjected to a uniform magnetic field.
Our linear magnet also exhibits exceptional mechanical properties, such as stretchability (maximum strain ~80%, elastic modulus ~0.3 MPa, maximum stress ~0.2 MPa, Supplementary Figs. 22–24), making it a reliable choice for wearable electronics, soft robotics, and so on.
Therefore, our linear magnet can be precisely assembled with high yield, readily reprogrammed by a beam of NIR laser with high spatial resolution, and have superior stretchability and well-predictable shape-morphing.
1D, 2D, and 3D magnetization programming, conformal assembly and its application
The high spatial resolution of our method offers an interesting magnetic pathway for information storage and encryption (see Supplementary Figs. 25, 26 and Note 4 for more details about the magnetic field information). We encode an 8-bit binary encoder on a section of an 8-cell linear magnet (Fig. 3a). The south (S) and north (N) magnetic poles, read by the magneto-optical sensor, represent the binary “0” and “1”, respectively. Using a laser, a displacement platform, and a programming magnetic field produced by a permanent magnet (see Supplementary Note 5 and Supplementary Figs. 27, 28 for details), the encoder is consecutively overwritten for four different ASCII codes indicating “Null” (00000000), letters “H” (01001000), “K” (01001011), and “U” (01010101), respectively. While the data storage density with linear magnets is lower than that of commercial rigid storage systems such as solid-state drives or hard disk drives, linear magnets have many advantages in stability, flexibility, and programming convenience (see Supplementary Fig. 29 for details).
a Magnetic field mapped through a magneto-optical sensor. The images, respectively, show that an 8-cell linear magnet carries binary ASCII-encoded data representing “Null”, letters “H”, “K” and “U”, respectively. b Magnetic field mapped through a magneto-optical sensor. The images show that the linear magnets conformally shaped into the letters “HKU” are consecutively programmed into different states. c Photograph showing that linear magnets are effortlessly woven into a wearable glove. d Images showing the woven fabric and the corresponding binary information. e, f Images of a password-protected door system based on a linear magnet. A linear magnet is woven into a wearable glove and programmed to store the door’s password. As the finger slides, the Hall sensor decodes the stored password from the linear magnet and unlocks the door. Scale bars: 2 mm except for (c, e, f) which are 2 cm.
The softness of linear magnets makes it remarkably effortless to construct a variety of smart devices with high flexibility. We further demonstrate a two-dimensional magnetized surface in Fig. 3b. The surface is readily fabricated by conformally aligning the linear magnet with a 3D-printed intaglio with the shape of the letters “H”, “K”, and “U” (Fig. 1g, top and Supplementary Fig. 28a). Aided by the laser, the conformed linear magnets are then reprogrammed into three different states shown by the magnetic flux density profile. Therefore, the softness of our linear magnets makes the design, manufacturing, and conformal assembly of versatile magnetic surfaces more efficient and convenient. Compared to other reconfigurable coding surfaces9, our method offers a higher coercive field, more flexible design freedom, and reconfiguration under more moderate conditions (Supplementary Table 3).
The mechanical property and the one-dimensional configuration allow linear magnets to be integrated into the garment for intelligent wearable devices. As shown in Fig. 3c, strings of linear magnets are woven into a piece of nitrile glove which is then put on a hand, forming a three-dimensional curved surface. Such woven fabric (Fig. 3d) can also be reprogrammed into different magnetic states to carry various information such as “00000”, “01110”, or “11111” which demonstrates the great potential for intelligent wearable devices. Such intelligent devices, capable of storing multiple bits, may be used for long-term health data storage to facilitate convenient health management49, action sequence recording to enhance interaction efficiency50,51, and password recording for authentication. As illustrated in Fig. 3e, f, we demonstrate that the wearables integrated with the linear magnet can store passwords for a password-protected door system. By simply sliding, the door can be effortlessly unlocked (Supplementary Movie 7).
Therefore, our technology provides a new convenient scheme to create smart reprogrammable magnetic devices in contrasting configurations.
Versatile flexible robotics
The linear magnet with solid-fluid-switchable cells has great potential in programming the locomotion and actuation of millimeter-scale nontethered soft robotics. For conventional magnet-based robotics, because of the predefined and fixed magnetization, the possible morphing states and thus the locomotion modality are solely dictated by the actuating magnetic field. However, an additional control pathway through laser-induced magnetization relaxation can be realized for the linear magnet. As shown in Fig. 4a, inside a branched channel, a section of our linear magnet with lengthwise arranged dipoles is originally repelled by an orthogonal permanent magnet. Upon laser irradiation, the NdFeB microparticles are relaxed on-the-fly. Free dipoles align themselves with the external field, causing the linear magnet to be attracted towards the fixed permanent magnet (Supplementary Movie 8).
a In situ reprogramming of the linear magnet. A section of the linear magnet is programmed with lengthwise arranged magnetization. This linear magnet is repelled by the permanent magnet in a narrow crossing channel and bends toward the opposite direction. Upon laser heating, the PCM inside cells of the linear magnet melts, freeing the NdFeB microparticles. In this way, the linear magnet is attracted towards the magnet. The permanent magnet is fixed and shown in the figures. b Sequential images illustrating the operation of a linear-magnet-based temperature alarm. For the temperature alarm, the green LED indicates that the temperature is below the threshold, while the red LED signals that the temperature is above the threshold. The linear magnet is presoaked in a saturated sodium chloride solution to make it conductive. When a permanent magnet is applied, the linear magnet is repelled away from the permanent magnet and connects the circuit, lighting the green LED. If the environment temperature exceeds the melting point of the PCM (Tm), the chains of magnetic particles within each cell rotate, driving the linear magnet towards the permanent magnet and activating the red LED. c Fiber-like and ring-like linear magnets programmed with two different magnetization zones presenting shape-morphing abilities. The fiber-like linear magnet is programmed oppositely from the center to two ends as denoted by the black arrow. The ring-like linear magnet is programmed oppositely along the radial direction from the center to two sides as denoted by the black arrow. The magnetic field (30 mT) is uniform in the opposite direction of gravity and generated by the Helmholtz coil. d Photographs showing a linear-magnet-based cleaner wriggling inside a blood-vessel-like channel and removing a blocking object. The diameter of the channel is 1 mm. The water inside the channel is dyed red for visualization. e Configuration transformation of a linear magnet between a fiber-like structure and a particle swarm. The linear magnets in (d, e) are driven by a hand-controlled permanent magnet. Scale bars: 5 mm.
Interestingly, our linear magnet can function as a temperature-sensing conductive wire in electronic systems, such as working for temperature alarms (Fig. 4b). After presoaking in a saturated sodium chloride solution, the magnet becomes conductive and thus suitable for electronic applications. When a permanent magnet is applied, the linear magnet is repelled, closing the circuit for the green light-emitting diodes (LED). If the temperature exceeds the threshold (Tm, the melting point of the PCM), the magnet is attracted to the permanent magnet, activating the red LED to signal an alarm (Supplementary Movie 9). The Tm can be adjusted by selecting different PCMs (see Supplementary Fig. 30 for details). Furthermore, by programming the magnetization cell by cell, the linear magnet exhibits complex shape-morphing. As shown in Fig. 4c, a fiber-like linear magnet is programmed into two sections with opposite magnetization. Upon a uniform upward magnetic field, the linear magnet bends anti-gravity in a “U” shape (Supplementary Movie 10). Similarly, a linear magnet ring with two different magnetization zones transforms into a saddle surface upon actuation (Supplementary Movie 11).
Furthermore, our linear magnet can operate inside a narrow channel due to its high length-to-diameter ratio and softness. As shown in Fig. 4d, a section of linear magnet serves as a blood vessel cleaner that effectively translates along a tortuous blood-vessel-like channel and removes a blockage (Supplementary Movie 12). Such reprogramming ability of our linear magnet may allow in situ tuning of locomotion modality for millimeter-scale biomedical robotics18,19,20. Moreover, the outer hydrogel of our linear magnet can be dissolved in disodium hydrogen phosphate (Na2HPO4) aqueous solution, releasing the inner cells. This unique characteristic enables a reversible configuration transformation between a fibrous structure and a particle swarm (Fig. 4e and Supplementary Movie 13). Such deformability offers robotic systems more freedom to pass sophisticated terrains and more possibilities to work in various scenarios, wherein they function either as a fiber for minimally invasive medicine or as a swarm for drug delivery on demand.
Flexible encoders on curved surface
In addition to robotic systems, our linear magnet is also very promising for functional flexible encoders that are of fundamental importance in many fields. In engineering, closed-loop control ensures that most devices are controlled accurately, wherein the motor encoder provides feedback for the control system (Fig. 5a). As shown in Fig. 5b, an encoder composed of a segment of our linear magnet is attached to a curved surface of a rotating stepper motor shaft. As the motor operates, the linear magnet’s programmed magnetic flux density is read cell-by-cell through the subjacent hall sensor and then linearly converted into voltage signals in real-time. In this way, programmable feedback on rotation is provided to a computer or a microcontroller (see Supplementary Figs. 31, 32 for details).
a Schematics showing the linear-magnet-based speed and position encoder. The linear magnet is attached to the curved surface of a rotating motor shaft. Aided by a Hall sensor, the magnetic flux density signals that comprise the information of speed and position can be extracted. b Photograph of the encoder. c Magnetic field distribution of two encoders with two and four coding segments before and after reprogramming. d The Hall sensor’s feedback signals representing the motor shaft’s speed and position at three different speeds. V0 = 0.62 rpm. The speed of the motor shaft can be calculated by the signal period. e The comparison between measured speed and output speed. Vm/V0 represents the ratio of the measured speed to V0, and the error bar represents the SDs of three different cycles. f The rotation direction feedback. The forward direction is from N to S while the backward direction is from S to N. g The feedback signals of two different encoders with 2 and 4 coding segments. h Five LEDs coded by the linear-magnet-based encoder at a rotating speed of 4V0. The decoding principle is based on polarity values. i Three LEDs coded by the linear-magnet-based encoder. The decoding principle is based on pole reversing. The lower inset shows the magnetic field distribution, and the circles represent the location of the pole reversing. Scale bars: 5 mm. Source data are provided as a Source Data file.
We have programmed two encoders of different magnetization periods (Fig. 5c). Figure 5d shows the temporal evolution of magnetic flux densities at different angular velocities using Encoder 2. To interpret the signal, a cycle represents a full revolution, thus the period is inversely related to the angular velocity. In this way, the encoder quantitatively measures the kinematics of an operating motor. The accuracy of the device is verified by the consistency between the average measured rotating speed (Vm) and the output speed of the stepper motor (V0, 2V0, 4V0) (Fig. 5e). Additionally, the magnetization profile also provides the rotation direction through the sequence of signal magnitudes (Fig. 5f).
Furthermore, the information carried by our linear magnet can be decoded to drive electrical devices. As shown in Fig. 5g, h, Encoder 1, which has a half magnetization period of that of Encoder 2, can effectively drive five LEDs into sequential illumination using a decoding algorithm (Supplementary Movie 14 and Supplementary Fig. 31b). The first LED (red) lights up when the magnetic flux density is near zero. When there is a first north magnetic pole, the subsequent green LED is illuminated. In this way, the five LEDs can illuminate individually in a well-controlled order. Furthermore, Encoder 1’s magnetic pole reversing spot can also be employed to control three LEDs with different colors in a predefined manner (Fig. 5i, and Supplementary Fig. 31c, d).
Discussion
Precisely assembled by fluids and readily programmed by light, the linear magnet exhibits high-resolution assembly and magnetization (re)programming, enabling versatile functions ranging from flexible robots, actuators, sensors, and encoders to decoders. Coupling with 3D printing technology, the linear magnet may be further used to build 3D complex structures with on-demand space-resolved magnetization. Together with its miniaturization and biocompatible hydrogel materials, the linear magnet works as a maneuverable and damage-free all-rounder, thus being of considerable significance both for implantable and wearable devices where magnet-based microsensors are needed for precision detection of movements and heart rates and for minimally invasive medicine where magnetic microrobots participate in precision medical diagnosis and drug delivery.
Methods
Materials
Alginic acid sodium salt from brown algae (bioreagent, suitable for immobilization of micro-organisms), polyethylene glycol (PEG, average Mn 6000), polyvinyl alcohol (PVA, Mw 13,000-23,000, 87–89% hydrolyzed), n-hexane (anhydrous, ≥ 95%), phosphate buffered saline (PBS), sodium chloride (≥ 99.0%), glycerol (≥ 99%), and calcium chloride (anhydrous, ≥ 97%) were purchased from Sigma-Aldrich. Neodymium–iron–boron (NdFeB) microparticles (MQFP-B-F00383, average size 5 μm) were purchased from Magnequench. Eicosane (≥ 99%) and tetracosane (≥ 99%) were purchased from Macklin. Fumed silica aerosol (R805) was purchased from Evonik. Octadecyltrichlorosilane (OTS, ≥ 95%) was purchased from Acros. Ethanol (absolute, ≥ 99.9%) was purchased from the Duksan company. 2-[methoxy(polyethyleneoxy)propyl]trimethoxysilane was purchased from Gelest Inc. Deionized (DI) water was obtained from a deionized water system (DINEC, Hong Kong). Paraformaldehyde (PFA) fixative solution (4%) was purchased from Aladdin. Disodium hydrogen phosphate (≥ 99%) was purchased from Sinopharm Chemical Reagent Co., Ltd.
Fabrication of linear magnet
Microfluidics technology was used to manufacture programmable linear magnets. The microfluidic device was made of two cylindrical capillaries (World Precision Instrument, Inc.), a square capillary (Beijing Chengteng Equipment Co., Ltd), two needles, and a glass slide. The cylindrical capillaries were pulled by a micropipette puller (WPI Pul-1000) and polished to the required dimensions with sandpaper under a microscope. All the capillaries were modified to be hydrophilic. The capillaries were first immersed in a mixture (1000:1) of ethanol and 2-[methoxy(polyethyleneoxy)propyl]trimethoxysilane, then dried using an air gun52. The continuous phase was made by dissolving PEG (4.6 wt%), PVA (4.6 wt%), and sodium salt of alginic acid (2.7 wt%) in DI water41. Furthermore, eicosane (47.29 wt%), fumed silica (2.00 wt%), and modified NdFeB microparticles (50.71 wt%) made up the dispersion phase unless otherwise stated. By soaking the NdFeB microparticles in a mixed solution of OTS (0.10 vol%) and n-hexane (99.90 vol%) for 10 min, followed by two washes with n-hexane, the surface of the microparticles was coated and thus functionalized from hydrophilic to hydrophobic. Following the completion of the volatilization of the n-hexane, the coated NdFeB microparticles and fumed silica were added to the melted eicosane and then dispersed by ultrasonic oscillation for 30 min. The continuous phase and disperse phase were pumped into the microfluidic device by two syringe pumps (LSP01-2A, LongerPump & WP-101P, Anhui Langgexinma Technology Co., Ltd.), and the parts filled with phase-change-material (PCM) were soaked in an in-house thermostatic water bath device (~50 °C). The temperature of the water inside the thermostatic water bath device was maintained by a heated circulator (PolyScience, AD07R-20-A12E). In the end, the flow consisting of the assembled dispersed phase droplets in continuous phase was injected into a calcium chloride aqueous solution (5 wt% in deionized water) at room temperature and the linear magnet was collected, eventually.
Magnetic characterization
The linear magnet was magnetized by an impulse magnetic field (about 2.7 T) generated by an impulse magnetizer (IM-10-30, ASC Scientific) after manufacturing. Local laser heating was accomplished by adjusting the position of the laser head relative to the linear magnet, either manually using a motion stage or automatically through a motorized stage (Applied Scientific Instrumentation, MS-2000). The programming magnetic field could be generated using either a Helmholtz coil or a permanent magnet. A Gauss meter (MG801, Magna, Japan) was used to measure the magnetic flux density at a spot toward a fixed direction, while a magneto-optical sensor (MagView-S, Matesy, Germany) was used to characterize the distribution of the magnetic flux density of a surface. Uniform magnetic fields were generated by a self-built Helmholtz coil with a programmable power source (Hunan Pai Sheng Technology Co., Ltd., China). The magnetization curve of the linear magnet was measured by a vibrating sample magnetometer (8604, Lake Shore). The magnetic encoder was decoded by a microcontroller (Arduino Mega2560, Italy).
Microscopic characterization
Microscopic photos of the linear magnet were obtained by a microscope (Sanqiang Taida, China) equipped with a CCD camera and software. The dynamic process of droplet generation was recorded by a high-speed camera (M110, Phantom, America) equipped with an inverted optical microscopy (TS100, Nikon, Japan). The linear magnet was characterized by scanning electron microscope (SEM, Hitachi S4800, and LEO 1530) after dehydrating for a week in the drying oven.
Heating and thermal imaging
To program the linear magnet, a 785 nm laser (IRM785RMA-300FC, Shanghai Laser & Optics Century, China) was utilized to heat the targeted cell to reach the melting point of the PCM inside. The power density of the laser was calibrated by an optical power and energy meter (Thorlabs, PM110D). The light-triggered thermogenesis of the linear magnet was measured by an infrared thermal camera (Fluke, Ti480) and post-processed by the software Fluke Connect.
Materials properties
The material properties of linear magnets were measured by a tensile tester (Zwick Roell) and a force tensiometer (DataPhysics, DCAT 25) equipped with an in-house clamp. The contact angle of the NdFeB microparticles was measured by a contact angle measuring system (Dataphysics, OCA 25). The microparticles were pressed to become a flat surface on a glass slide. Then a DI water droplet of about 5 μL was injected onto the surface for the contact angle measurement.
Observation of magnetotactic bacteria
The magnetotactic bacteria were cleaned with PBS three times to remove the culture medium and fixed with PFA for 15 min in preparation for SEM (Hitachi S4800 and LEO 1530), transmission electron microscopy (TEM, Philips CM100, and FEI Tecnai G2 20), and energy-dispersive X-ray (EDX, FEI Tecnai G2 20) scattering mapping experiments. Before SEM experiments, the fixed magnetotactic bacteria were dehydrated in an ethanol aqueous solution gradually (30 vol%, 50 vol%, 70 vol%, 90 vol%, 100 vol%, 10 min for each step). Before TEM experiments, the fixed magnetotactic bacteria were washed with DI water three times.
Video recording
All the macroscopic videos and pictures were taken by a camera (D7500, Nikon, Japan) equipped with a macro lens (Sigma, 105 mm/F2.8). Data acquisition from the pictures or videos was based on ImageJ and an in-house Python code.
Data availability
All data needed to evaluate the conclusions in the paper are present in the manuscript and Supplementary Information. The data are also available upon request from the corresponding author. Source data are provided with this paper.
References
Zhao, X. et al. Permanent fluidic magnets for liquid bioelectronics. Nat. Mater. 23, 703–710 (2024).
Tang, D. F. et al. Bistable soft jumper capable of fast response and high takeoff velocity. Sci. Robot. 9, eadm8484 (2024).
Cui, J. Z. et al. Nanomagnetic encoding of shape-morphing micromachines. Nature 575, 164–168 (2019).
Kim, Y., Yuk, H., Zhao, R. K., Chester, S. A. & Zhao, X. H. Printing ferromagnetic domains for untethered fast-transforming soft materials. Nature 558, 274–279 (2018).
Kim, J. Y. et al. Programming magnetic anisotropy in polymeric microactuators. Nat. Mater. 10, 747–752 (2011).
Hu, W. Q., Lum, G. Z., Mastrangeli, M. & Sitti, M. Small-scale soft-bodied robot with multimodal locomotion. Nature 554, 81–85 (2018).
Dong, Y. et al. Untethered small-scale magnetic soft robot with programmable magnetization and integrated multifunctional modules. Sci. Adv. 8, eabn8932 (2022).
Ze, Q. J. et al. Spinning-enabled wireless amphibious origami millirobot. Nat. Commun. 13, 3118 (2022).
Alapan, Y., Karacakol, A. C., Guzelhan, S. N., Isik, I. & Sitti, M. Reprogrammable shape morphing of magnetic soft machines. Sci. Adv. 6, eabc6414 (2020).
Yang, L. et al. Selective directional liquid transport on shoot surfaces of Crassula muscosa. Science 384, 1344–1349 (2024).
Stone, H. A., Stroock, A. D. & Ajdari, A. Engineering flows in small devices: microfluidics toward a lab-on-a-chip. Annu. Rev. Fluid Mech. 36, 381–411 (2004).
Choi, K., Ng, A. H. C., Fobel, R. & Wheeler, A. R. Digital microfluidics. Annu. Rev. Anal. Chem. 5, 413–440 (2012).
Li, A. et al. Programmable droplet manipulation by a magnetic-actuated robot. Sci. Adv. 6, eaay5808 (2020).
Jiang, S. J. et al. Magnetic Janus origami robot for cross-scale droplet omni-manipulation. Nat. Commun. 14, 5455 (2023).
Zhou, Y. H. et al. Giant magnetoelastic effect in soft systems for bioelectronics. Nat. Mater. 20, 1670–1676 (2021).
Zhao, X. et al. Soft fibers with magnetoelasticity for wearable electronics. Nat. Commun. 12, 6755 (2021).
Yang, Y. Z. et al. Magnetic soft robotic bladder for assisted urination. Sci. Adv. 8, eabq1456 (2022).
Tiryaki, M. E., Elmacıoğlu, Y. G. & Sitti, M. Magnetic guidewire steering at ultrahigh magnetic fields. Sci. Adv. 9, eadg6438 (2023).
Kim, Y. et al. Telerobotic neurovascular interventions with magnetic manipulation. Sci. Robot. 7, eabg9907 (2022).
Kim, Y., Parada, G. A., Liu, S. D. & Zhao, X. H. Ferromagnetic soft continuum robots. Sci. Robot. 4, eaax7329 (2019).
Bernevig, B. A., Felser, C. & Beidenkopf, H. Progress and prospects in magnetic topological materials. Nature 603, 41–51 (2022).
Pan, L. & Bogy, D. B. Heat-assisted magnetic recording. Nat. Photonics 3, 189–190 (2009).
Kim, Y. & Zhao, X. H. Magnetic soft materials and robots. Chem. Rev. 122, 5317–5364 (2022).
Zhang, J. C. et al. Voxelated three-dimensional miniature magnetic soft machines via multimaterial heterogeneous assembly. Sci. Robot. 6, eabf0112 (2021).
Xu, T. Q., Zhang, J. C., Salehizadeh, M., Onaizah, O. & Diller, E. Millimeter-scale flexible robots with programmable three-dimensional magnetization and motions. Sci. Robot. 4, eaav4494 (2019).
Smart, C. L. et al. Magnetically programmed diffractive robotics. Science 386, 1031–1037 (2024).
Song, H. et al. Reprogrammable ferromagnetic domains for reconfigurable soft magnetic actuators. Nano Lett. 20, 5185–5192 (2020).
Deng, H. et al. Laser reprogramming magnetic anisotropy in soft composites for reconfigurable 3D shaping. Nat. Commun. 11, 6325 (2020).
Chen, G. S., Ma, B., Zhang, J., Chen, Y. & Liu, H. Reprogrammable magnetic soft robots based on low melting alloys. Adv. Intell. Syst. 5, 2300173 (2023).
Xue, J. N. et al. A Magnetic continuum robot with in-situ magnetic reprogramming capability. 2024 IEEE International Conference on Robotics and Automation (ICRA) 5891–5897 (IEEE, Yokohama, Japan, 2024). https://doi.org/10.1109/ICRA57147.2024.10611450.
Blakemore, R. Magnetotactic bacteria. Science 190, 377–379 (1975).
Vali, H. & Kirschvink, J. L. Magnetofossil dissolution in a palaeomagnetically unstable deep-sea sediment. Nature 339, 203–206 (1989).
Bazylinski, D. A., Frankel, R. B. & Jannasch, H. W. Anaerobic magnetite production by a marine, magnetotactic bacterium. Nature 334, 518–519 (1988).
Pósfai, M. & Dunin-Borkowski, R. E. Magnetic bacteria on a diamond plate. Nature 496, 442–443 (2013).
Stolz, J. F., Chang, S. B. R. & Kirschvink, J. L. Magnetotactic bacteria and single-domain magnetite in hemipelagic sediments. Nature 321, 849–851 (1986).
Jinkins, K. R. et al. Thermally switchable, crystallizable oil and silicone composite adhesives for skin-interfaced wearable devices. Sci. Adv. 8, eabo0537 (2022).
Li, W., Tang, X. & Wang, L. Q. Photopyroelectric microfluidics. Sci. Adv. 6, eabc1693 (2020).
Tang, X. & Wang, L. Q. Loss-free photo-manipulation of droplets by pyroelectro-trapping on superhydrophobic surfaces. ACS Nano 12, 8994–9004 (2018).
Wang, Z. C. et al. High-strength magnetic hydrogels with photoweldability made by stepwise assembly of magnetic-nanoparticle-integrated aramid nanofiber composites. ACS Nano 17, 9622–9632 (2023).
Chen, G. R. et al. Wearable ultrahigh current power source based on giant magnetoelastic effect in soft elastomer system. ACS Nano 15, 20582–20589 (2021).
Tian, Y. et al. Large-scale water collection of bioinspired cavity-microfibers. Nat. Commun. 8, 1080 (2017).
Huang, T. et al. Sedimentation of two circular particles with different sizes in a vertical channel at low Reynolds numbers. Phys. Fluids 36, 023106 (2024).
Zhu, P. A. & Wang, L. Q. Passive and active droplet generation with microfluidics: a review. Lab Chip 17, 34–75 (2017).
Zhao, H. B. et al. Magnetic field-assisted fission of a ferrofluid droplet for large-scale droplet generation. Langmuir 38, 5838–5846 (2022).
Zhou, C. et al. Ferromagnetic soft catheter robots for minimally invasive bioprinting. Nat. Commun. 12, 5072 (2021).
Wang, L. et al. Evolutionary design of magnetic soft continuum robots. Proc. Natl Acad. Sci. Usa. 118, e2021922118 (2021).
Wang, L., Kim, Y., Guo, C. F. & Zhao, X. H. Hard-magnetic elastica. J. Mech. Phys. Solids 142, 104045 (2020).
Zhao, R. K., Kim, Y., Chester, S. A., Sharma, P. & Zhao, X. H. Mechanics of hard-magnetic soft materials. J. Mech. Phys. Solids 124, 244–263 (2019).
Kim, J. et al. A wearable multiplexed silicon nonvolatile memory array using nanocrystal charge confinement. Sci. Adv. 2, e1501101 (2016).
Liu, H. Z. et al. Robust and multifunctional kirigami electronics with a tough and permeable aramid nanofiber framework. Adv. Mater. 34, 2207350 (2022).
Li, H. G. et al. Breathable and skin‐conformal electronics with hybrid integration of microfabricated multifunctional sensors and kirigami‐structured nanofibrous substrates. Adv. Funct. Mater. 32, 2202792 (2022).
Han, X., Kong, T. T., Zhu, P. A. & Wang, L. Q. Microfluidic encapsulation of phase-change materials for high thermal performance. Langmuir 36, 8165–8173 (2020).
Acknowledgements
The financial support from the Research Grants Council of Hong Kong (GRF 17213823, 17205421, and 17204420, L.W.) and the Hong Kong Polytechnic University (SHS Chair Professor: P0045687, L.W.) is gratefully acknowledged. The financial support from the New Cornerstone Science Foundation through the XPLORER Prize and the Hong Kong Jockey Club is gratefully acknowledged (X.Y.). The authors sincerely wish to thank Prof. Nicholas Xuanlai Fang, Prof. Lizhi Xu, Prof. Jiaqian Li, Dr. Mingze Sun, the Central Fabrication Laboratory (CFL) of the University of Hong Kong, the Southern University of Science and Technology Core Research Facilities for relevant equipment support and Dr. Yiyuan Zhang, Dr. Shaojun Jiang, Dr. Chunlin Pang, Dr. Shuting Xie, Dr. Jiaoyuan Lian, and Dr. Haibo Zhao for helpful discussions and valuable comments. We also acknowledge Prof. Longfei Wu, Prof. Hongmiao Pan, Prof. Tao Song, and Prof. Jinhua Li for their generous help and advice in obtaining the magnetotactic bacteria specimens. The financial support from the Innovation and Technology Commission of Hong Kong through the Research Talent Hub (PiH/234/22, W.L.) is gratefully acknowledged. The financial support from the Research Grants Council of Hong Kong through the Hong Kong PhD Fellowship Scheme (H.Z.) is gratefully acknowledged.
Author information
Authors and Affiliations
Contributions
L.W., X.T., Q.D., and W.L. conceived the project. Q.D. and W.L. designed the project. L.W., X.Y., W.L., and X.T. supervised the research. Q.D. performed all the experiments to which W.L. also contributed. X.T. performed some preliminary tests. H.Z. and L.Y. assisted with material characterization and experimental demonstrations. H.L. and X.W. assisted in the preparation of the hydrogel materials. Z.Z. helped with the interpretation of partial results. P.Y. and Y.Z. helped with the organization of figures. Q.D. analyzed all the data and wrote the original draft. Q.D., L.W., X.Y., X.T., and W.L. revised the draft with comments from all authors.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Communications thanks Byeonghwa Lim, and the other, anonymous, reviewers for their contribution to the peer review of this work. A peer review file is available.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Source data
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Deng, Q., Zhu, H., Zhao, Z. et al. Linear magnet with fluid-solid-switchable cells for flexible devices. Nat Commun 16, 4601 (2025). https://doi.org/10.1038/s41467-025-59663-9
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41467-025-59663-9
This article is cited by
-
Thermomagnetic mechanism of phase change materials for reconfigurable sensing
Discover Materials (2026)







