When I was young I saw an exhibit at the "Oregon Museum of Science and Industry". It looked like a steel ball that was floating under an electromagnet. It was levitating in mid air. This I found fascinating. Later in life I was in college taking a class called "Experimental Technics" This was an full year course in electronics. I learned alot. As a final project I tried to make this levitating exhibit. I didn't get it to levitate in the week I had for the project. The steel ball would hop or vibrate. I continued on with the project on my own time. After trying many things I finally made a magnet float under an electromagnet. I will describe my last setup to suspend a magnet in mid air.
It uses Infrared feedback. I have six IR LED's in the core of the electromagnet and in the center is a IR transistor. As the floating magnet comes closer to the electromagnet more light is reflected to the IR transistor, Voltage to the electromagnet then goes down. I also have a coil below this setup that stabilizes the magnet it turns on when the magnet falls below a certain point.
Click on the picture and see a movie of my levitating magnet. It is about 7MB so it takes a while to download.