Levitating almost anything is still quite exciting, and a good test of the hardware and software skills of any maker. However doing so isn't out of reach, and is demonstrated by Erik Månsson who uses an Arduino-compatible board that controls the current through the coil with an N-MOSFET and uses a hall effect sensor to detect the object. The code includes calibration and a clever PID control-loop feedback mechanism to ensure the system runs smoothly, with a quick demonstration in the following video:
If you're interested in detecting changes in magnetic fields with your Arduino, you'll need a hall effect sensor and we have a convenient module just for the purpose - our HALL: Hall Effect Magnetic and Proximity Sensor Module. It operates on both 3.3 and 5V boards, can detect both north and south pole magentic polarity and shows when triggering is successful with a convenient LED.
To learn more about the HALL: module, read our Quick Start Guide and to order, visit out HALL: product page.