Can’t wait for the future to bring you levitating devices? Learn how to make your own using stuff you can find around your house…assuming your house has an old VCR, an Arduino, and soldering equipment!
Step 1: Don't Like Reading? Watch the Video Instead.
If you're a visual learner in that you like to see what's being done instead of reading about it, then check out the video version of this project that I created just for you! Actually, I created it for me in the event that I lose my long term memory and want to remember how to do this. But feel free to benefit from my odd anxieties.
Step 2: What You Will Need
To follow along with this project, here are the parts you are going to need. Most of them can be salvaged from things you have around the house. The total cost for me was only around $10.
Step 3: The Electromagnet
Making an electromagnet sounds like sorcery, but it’s really quite simple. You just need some type of metal rod, copper wire, and a power source. I was able to salvage a 3/8” metal bolt that was 3” long. I used some painters tape to mask off the top 1” of the bolt with a rubber washer at one end of the tape and another rubber washer at the other end. This makes a 1” container for the wire so that we can wrap it around the bolt.
Start by measuring out a 4” lead of the enameled copper wire and then start wrapping it around the taped section of the bolt. I ended up using all 40ft of my 40 foot spool of wire. If you have an electric drill, you can use it to assist in wrapping the wire. After the wire is wrapped, measure another 4” lead at the end of the wire. Most magnetic copper wire has a coating on it, so use a sharp knife or a lighter to remove the coating from the tips of each lead so that you can connect them to a power source.
You can test it out by connecting the leads to a 9v battery and see if it attracts metal. If it does, then give yourself a pat on the back for making an electromagnet! In order for the magnet to be strong enough for our levitation machine, however, we’ll need a 12v power supply to connect to it.
Step 4: The Detection Sensor
Now we need some type of detection system to detect the location of the object we’re trying to levitate. One ideal way to do this is through using a “Hall Effect Sensor”. Basically it detects the strength of a magnetic field and outputs a corresponding voltage. This, in turn, can be used to control the strength of the electromagnet. Hall Effect Sensors are primarily used in brushless motors. Although this is the preferred method, I am going to be using a different way.
The next method involves using Infrared sensors: an infrared emitter and an infrared phototransistor. The emitter takes a voltage and converts it into infrared light, and the phototransistor takes infrared light and converts it into voltage. As an object passes in between these two sensors, it blocks infrared light from reaching the phototransistor. Using that knowledge, we can determine the location of the object based on how much infrared light the phototransistor receives. The corresponding voltage output can then be used to control the strength of the electromagnet.
Where can you find IR emitters and phototransistors? Any type of old remote control should have an IR emitter, and several types of old VCRs should have IR phototransistors
Step 5: Building a Base
Before continuing, we need some type of structure that can hold everything together at the right distances. Initially, I used scrap pieces of wood to make a square frame. The inside of the frame was 3 1/2 inches wide, 16 inches tall, and 2 inches deep. The minimum requirements, however, are 3 1/2 inches wide, 7 inches tall, and 1 inch deep.
We need to drill some holes in the sides of the uprights for the IR sensors. So on both of the uprights, drill a set of 5 holes that are 3/4” in diameter, 0.4 inches apart, and 2 3/4 inches from the top of the frame. Lastly, we need to drill a 3/8” hole down through the center of the top crossbeam to accommodate the 3/8” electromagnet bolt.
When all the drilling is done, screw in the electromagnet, and place the infrared sensors in the second set of holes just below the head of the electromagnet. You can adjust them up or down later depending on the strength of your magnet.
Step 6: The Controller
We’re gonna use an Arduino to make everything talk to each other, and we’ll need a few extra electronic components to wire it all up.
First we’ll need a diode to put in between the leads of the electromagnet. Then the lead connected to the minus side of the diode should connect to the power line on the 12v power supply. The remaining lead should connect to the middle pin on the N-Channel MOSFET. On the MOSFET, the right pin should go to the ground line of the 12v power supply. Then the left pin should go to port 11 on the Arduino.
For the IR Emitter, connect the ground leg to a ground port on the Arduino, and the power leg to a 100 ohm resistor, and then on to port 13. For the IR Phototransistor, connect the ground to a ground port on the Arduino, and the power leg to port A0, and then on to a 100k ohm resistor and then to the 5v port on the Arduino.
Step 7: The Code
I gleaned the code from Simon Monk's "Dangerously Mad" website, where this project originated. You can either copy it from there or download it from my project page at the link below. Plug in your Arduino, upload the code, plug in the 12v power for your electromagnet. And you should start to hear it hum. First let's make sure the IR sensors are working, so pop open the Arduino serial console and type a lowercase m. You should start to see two values. And as you pass an object between the sensors, the right value should get smaller or larger depending on which direction the object is going. Now enter m again to turn off monitoring, and at this point you can take a magnet, the stronger the better, and hold it level with the IR LED's to see if you can get it to levitate. To tweak the strength of the electromagnet, you can type a lowercase b to decrease it and an uppercase B to increase it.
Step 8: Final Results
For the best results, I'm using a really strong neodymium magnet. You can buy these online or salvage them from old hard drives. After tweaking it, and tweaking it some more, your magnet should start levitating. The longest I had a magnet levitating was a couple minutes. One thing to note is that the longer the magnet runs, the hotter it and the MOSFET get, so take that into precaution. If you want to make it more professional looking, and if you have a 3D printer, you can download and print this 3D printable levitation stand.