Magnets aren’t magical, but sometimes you can do things with them to fool the uninitiated – like levitate. [Jonathan Lock] does this with his new Maglev desk toy that looks like at least a level 2 enchantment.
This levitator is USB powered and typically draws 1 to 3 W to levitate masses between 10 g and 500 g. The base can supply 3 to 5 V inductive power to the levitator for 10 Ma to 50 Ma, which is enough for some interesting possibilities, starting with the lights and motors [Jonathan] tried.
In construction, it’s very similar to the commercial units you’ve seen: four permanent magnets repelling another magnet in the levitator. Since this arrangement is about as stable as balancing a basketball on a piece of spaghetti, the permanent magnets are wrapped around control coils that pull the levitator back to center in a 1 kHz loop. This is accomplished via a Hall sensor and an STM32 microcontroller running a PID loop. The custom PCB also has an ESP32 onboard, but it’s used as a very squished-up USB/UART converter to talk to the STM32 to adjust the current firmware.
If you think one of these would be nice to have on your desk, check out [Jonathan]’s Gitlab. It’s all there, from a detailed build guide (with easy-to-follow animated GIF instructions) to CAD files and firmware. Kudos to [Jonathan] for the quality writing; sometimes documentation is the hardest part of a project, and it’s worth acknowledging that as well as the technical aspects.
We’ve written about magnetic levitation before, but it’s not always as good as this project. Other times, it does just fine. There are other ways to accomplish the same feat, too, some of which can lift a bit more.