Hardware required:
– 1 x AH3503 Linear Hall Sensor
– 2 x BC547 Transistors
– 1 x 78L05 Regulator (5V)
– 1 x IRF540 Power MOSFET
– 2 x 4K7 Resistors
– 1 x 1K resistor
– 1 x 4K7 Trimmer Pot
– 1 x Used relay to make the Electro magnet
– 1 x Small Permanent Magnet taken from a Small PC Speaker

Schematic Diagram:

Assembled Control Circuit:

A Note about the Relay Coil (Electromagnet):
We have taken the coil from an old 12V relay.
Removed the coil with the metal core and used as the electromagnet.
Please see below pictures. It explains how to prepare it.

Open the 12V relay and remove the coil with the core and remove the metal part off .
And mount the hall sensor 2-3 cm away from the electro magnet.
Make sure that hall sensor facing the correct side against the electro magnet

Electromagnet, Hall Sensor and Control circuit Mounted on a piece of wood to hold them vertically.

Next thing to find a small permanent Magnet. I got a magnet out of a small PC speaker.
First, removed the Paper cone of the speaker and then the magnet was removed.
It was glued to the bottom, needed some force to remove it.

Made a ball out of Foam and glued the magnet on top.

Below shows the Foam ball hanging below the Electromagnet (Levitating)

Some note about the project:
The polarity of the Permanent Magnet, Hall sensor and the Electromagnet has to be in the correct way to work.
If everything is correctly connected, when the Foam Ball with the magnet move closer to the Hall sensor, the current through the Electromagnet has to reduce.
Connect a dc ammeter in series with the 12V supply and move the Foam Ball (Magnet) closer to the Hall sensor and see whether the current decreases.
When the Ball moves away from Hall sensor, current should increase.
If it is other way around, try reversing the poles of the Permanent magnet or the polarity of the coil.
Also the Hall sensor has to be mounted 2-3cm away from the elctromagnet, otherwise it will interact with the magnetic field of the coil.
This way, there is a equilibrium point where the ball is slightly away from the Hall sensor.
Try to adjust the gain with the 4K7 pot to balance the weight of the ball.
Check this short Video: Magnetic Levitation


Leave a comment