Defying Gravity: How Photoelectric Stabilization Keeps Magnetic Levitation Steady
Polish version is here |
Magnetic Levitation: Impossible?
The English word "levitation" comes from the Latin term "levitas," meaning lightness. Levitation is the phenomenon of an object freely suspending without physical contact with any surface.
Historically, levitation was considered a paranormal phenomenon or an illusionist’s trick involving people or objects floating in the air. However, today, there are numerous technical methods to achieve practical levitation, even for large objects. Active magnetic levitation is one of the simpler and more reliable methods, which is why this article focuses on it.
Operating Principles
An object in a state of levitation is subjected to a force that holds it suspended without direct contact with its surroundings. In the case of magnetic levitation, this force results from magnetic interaction. Levitation occurs when the object remains suspended in equilibrium without falling. The forces acting on the object are illustrated in the diagram below:

Here, Fg represents the gravitational force, while Fm represents the opposing force generated by the electromagnet. According to Newton’s First Law of Motion, an object remains at rest when no forces act on it or when the forces acting on it are balanced. In this case, the latter applies: for the object to levitate, the condition Fg = Fm must be met, where gravitational force equals magnetic force.
A significant practical challenge is that no static and stable configuration of magnetic or electrostatic forces can maintain levitation! Earnshaw's theorem states that forces inversely proportional to the square of the distance create inherently unstable systems.
Nonetheless, there are methods to achieve stable levitation. One of these is active stabilization. In this approach, the magnetic attraction force is regulated through negative feedback based on the object's position. The object's distance from the electromagnet is continuously measured (in this case, using a photoelectric method), and the magnetic force is adjusted accordingly. This ensures stable levitation. The simplified diagram below illustrates the principle of operation:

The system includes two photosensors: one measures the object's position, while the other monitors ambient light levels. This setup eliminates interference from external light sources other than the laser. The signals from the photosensors are processed by a control circuit, which amplifies and differentiates the signals. The output signal drives a transistor that regulates the electromagnet.
Construction
To build a magnetic levitation device, visit the nearest electronics store and obtain the components listed below:
- C1 - 2200µF, 32V
- C2, C3, C4 - 100nF
- R1 - Adjustable resistor to set the laser’s brightness
- R2, R3 - 3.3kΩ
- R4 - 4.7kΩ
- R5 - 10kΩ
- R6 - 150kΩ
- R7 - 10kΩ
- R8 - 1kΩ
- R9 - 47kΩ
- R10 - 1kΩ
- LED1 - Semiconductor laser pointer
- D1 - Flyback diode (fast rectifier diode)
- T1, T2 - Phototransistors
- T3 - BUZ11 MOSFET transistor
- U1 - 7805 voltage regulator
- U2 - LM358 operational amplifier
- L - Electromagnet (constructed as described below)
The semiconductor laser is a standard laser pointer. Carefully disassemble the pointer, solder wires to its contacts, and insulate the connections using a heat-shrink tube for protection.
Next, build the electromagnet. I wound mine using enameled copper wire with a diameter of 0.3mm (approximately 0.012 inches) on a cardboard bobbin. The core is made of transformer lamination sheets, but an ordinary steel bolt can also be used.
Assemble all components according to the schematic diagram:
In this system, T1 acts as the position sensor, while T2 measures the background illumination. U2A functions as a differential amplifier with a gain of approximately 2 (determined by the ratio of R5 to R4). Its output is fed into a differentiator circuit consisting of C4 and R7. The differentiator (or derivative) is a mathematical function that indicates the rate of change of the input signal. The differentiated signal is then amplified by a second-stage amplifier with a gain of about 47x (the ratio of R9 to R8). This amplified signal drives the BUZ11 MOSFET transistor, which controls the electromagnet coil. Diode D1 acts as a flyback diode, suppressing voltage spikes induced by changes in coil current. The voltage regulator U1 provides a stable supply voltage for the operational amplifiers and phototransistors. Capacitor C1 smooths the supply voltage, while resistor R1 adjusts the laser’s brightness. If necessary, adjust resistors R2 and R3 to fine-tune the system.
All components should be securely mounted on a PCB, except for the laser, electromagnet, and phototransistors, which should be positioned as shown in the diagram above. The assembled setup should resemble the following example:

Carefully place a small ferromagnetic object or magnet within the laser beam’s path. Depending on the object’s weight, you may need to adjust its distance from the electromagnet. As shown in the video below, the levitating objects are highly stable—they remain suspended even when disturbed or spun. Surprisingly heavy objects, such as half of a ferrite core from an old black-and-white TV flyback transformer, can also be levitated due to the strong magnetic field generated by the electromagnet.
It is worth noting that a similar feedback and automation system is used in magnetic levitation trains, such as those in the MAGLEV system. The MLX01 model (shown below) operates using this principle and can reach speeds exceeding 500 km/h (310 mph).

There are also other practical methods of stabilizing levitation, including some that do not require additional energy input.
We hope you enjoy exploring this fascinating and educational project. Happy experimenting!
Further readings:
- Earnshaw S., On the nature of the molecular forces which regulate the constitution of the luminferous ether, Transactions of the Cambridge Philosophical Society, 1984, 7, pp. 97-112
- Jayawant B.V., Electromagnetic suspension and levitation, Reports on Progress in Physics, 1981, vol. 44, pp. 412–477
- Valle R., Neves F., de Andrade Jr R., Stephan R.M., Electromagnetic Levitation of a Disc, IEEE Transactions on Education, 2012, vol. 55, iss. 2, pp. 248–254
- Williams D., Electromagnetic Levitator, Electronics Now, 1996, vol. 43, iss. 3, pp. 336–342
Marek Ples