via rgco on instructables
Earnshaw’s theorem from 1842 demonstrates that you can’t get a stable stationary equilibrium with magnets. But there are loopholes! If we lift a magnet with an electromagnet and then reduce the current when it gets to close it can actually float in still air!
A levitating globe can be bought in many versions online, and there are other instructables here that show how to make one yourself.
However, I found that some use very sensitive Hall-switches that result in very little lift, of the order of 1 gram, others use microcontrollers, others components that are hard to come by. Also GreatScott made a great video on the subject, but he had trouble with stability, probably because he put the hall sensor under the levitating object instead of close to the electromagnet. The design presented here is very similar to that from a 2004 MIT paper but uses more commonly available components.
Read more about this project here.