mekonik has published complete details on his Arduino magnetic levitation project. Not content to settle for a typical “hello world” LED blinker as his first project, he supplemented the Arduino with an electromagnet, Honeywell SS19 Hall effect sensor, MC3401P op amp, NPN transistor and 1N4001 rectifier. The circuit essentially uses the small Hall effect sensor to sense the field of the permanent magnet and uses that information calculated by the Arduino to control the modulation of the magnetic field of the electromagnet. Pretty cool!
Arduino magnetic levitation project - [Link]