The machinegeek has shown us a rather detailed project on how to use the Arduino to float objects via an electromagnetic field.
The machinegeek says:
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!
The site is loaded with a heap of theory, photos/schematics, code and discussion.