Here is an interesting circuit to be used in physics demonstrations involving energy transformation and magnetic fields. In the figure we have a diagram of a "magic spring" that works as follows. When the circuit is energized, the mold is distended with the tip touching a metal sensor. Under these conditions, capacitor C is charged, and the transistor is polarized in order to conduct a strong current that circulates through the mold. The result is that the spring contracts, breaking contact with the sensor. After some time, the capacitor that holds the charge and polarizes the transistor is discharged by cutting off the current in the transistor. The spring stretches again, and a new contact is established with a new contraction. By dimensioning the capacitor and the spring well, we can make it contract and stretch in a continuous movement. A typical spring will have 100 to 200 turns of wire 28. A current limiting resistor can be interesting to avoid heating both the transistor and the spring itself.