Levitation was always something mysterious and amazing. People often associated it with magic, ghosts, UFOs or other unbelieveable phenomena.
On the other hand, the levitation a relatively simple physical phenomenon.
I am going to show you the device that allows levitation of metal objects. You can build your own DIY.
Ferromagnetic object in this device levitates in the air without being held by anything visible.
Such devices are being called as levitators, levitrons, anti-gravity devices or levitation device.
The principle of operation is simple. Because the magnet or electromagnet itself would not levitate objects (they either fall or stick to it), I added electronic control to the electromagnet, so its power depends on the position of the object. The optical sensor is made od of infrared LED and infrared photodiode senses the position of the object. If the object gets too high, photodiode will be less illuminated and the circuit reduces the current in the electromagnet coil. If object is to low, photodiode will be more illuminated and current in electromagnet increases. The control circuit of this Electromagnetic levitation device used half of operational amplifier (OpAmp) 1458 or 4558 and a power MOSFET with a heatsink. The electromagnet can be salvaged from some big old relay. My had originally about 20,000 turns of 0.1 mm wire, I removed the coil and replaced it by 1200 turns of 0.4 mm diameter wire. The iron core has cca 8mm diameter. The coil has a resistance of about 8R and is not designed for continuous operation at full 12V because it dissipates 18W. When operating the device with the levitating object, the real power loss of the coil is much lower (about 2-6W). Therefore, the device should not be too long in operation with no object. (in this state there's almost 12V on the coil). Because different photodiodes have different sensitivity, you may need to adjust the value of R1. If the photodiode is illuminated, there should be less than 6V on it and almost 12V at the solenoid. If it is not illuminated (the beam is interrupted), there should be more than 6V on the photodiode and on the electromagnet (almost) zero voltage. If you have problems with the Electromagnetic levitation device stability (object vibrates) you may need to change the time constant of the circuit. To do this, change the value of the capacitor C1. Experimentally, change the value up as the 10u or 22u, or possibly down to about 2u2 or 1u until the circuit gets into a stable state.