Probably you’ve seen these fun toys like globes in gift shops or elsewhere. It simply makes object levitate in open air. The main secret of this is magnet interaction under electromagnet. To stop object from falling or sticking to electromagnet it has to sense the distance and adjust magnetic field of electromagnetic coil.
In this project there is a Hall sensor used to detect distance of objects magnet. And according to readings electromagnet is dynamically controlled. Electromagnet is pretty simple coil around metal core and is controlled by one Arduino digital pin. Hall effect sensor uses a Norton op amps (that amplifies current difference) to adjust signal output in the range 1.8 – 4.5V that can be read by Arduino analog pin. Project description has some nice theory on how things really work and how to calculate coil parameters with some real math.