<h1>Magnetic Levitation (1 inch gap, stable, low cost)</h1>
[video width="1280" height="720" mp4="http://johann.langhofer.net/wp-content/uploads/2018/04/VID_20180418_2122030.mp4"][/video]

I've found a simple solution for the magnetic challenge in order to get a stable levitation. After several experiments and a lot of research on the WEB I came up with a solution using a handful components, more particularly, only five electronic parts are needed, a power supply, an arduino, a coil, a MOSFET and a hall-sensor. With a very small piece of software running on the arduino, the magnetic cubes can be hold in a very stable position. But wait, it wasn't so easy, I've got several issues and finally run into a serious problem...

Lets start with the big picture: an electromagnet with an iron core on the top attracts a floating magnet, a  hall sensor reads the magnetic strength of the gap and controls an electronic switch at the bottom which powers off the coil if the strength exceeds a certain value (threshold).

<img class="alignnone size-full wp-image-586" src="http://johann.langhofer.net/wp-content/uploads/2018/04/bigPicture.jpg" alt="bigPicture" width="508" height="616" />

&nbsp;

So what is the main problem trying to keep a magnet in a constant position from the pulling/pushing electromagnet? Stability is the answer. Even if you're trying to switch the electromagnet with high precision and with a high frequency,

Useful components:
<blockquote>Arduino Mini, Nano, Mega, laser 405nm
RaspberryPI I, II
WLan ESP8266
and much more.</blockquote>
[supsystic-gallery id=5 position=center]