Maker Pro
Maker Pro

(Electro)Magnetic Levitation

Yes. On one side, the Hall Sensor outputs a high voltage - on the other, nothing (just the usual 2.5V). The electromagnet only runs on the side that is outputting high voltage. When the appropriate side of the neodymium magnet enters range, the sensor with the magnet on outputs even higher voltage (reaching maximum at roughly the trip point). The other configuration outputs lower and lower voltage, until the trip point is reached and the sensor outputs 0V (a nearly inaudible click is heard).
What I would like to do is make the circuit exhibit the behavior of the second configuration during the first - that is, when the Hall Sensor outputs a *high* voltage, the electromagnet shuts off, and vice versa.
 

KrisBlueNZ

Sadly passed away in 2015
Yes. On one side, the Hall Sensor outputs a high voltage - on the other, nothing (just the usual 2.5V).
You know John meant flipping the orientation of the Hall sensor in the magnetic field, not changing the connections to its pins, right?
What I would like to do is make the circuit exhibit the behavior of the second configuration during the first - that is, when the Hall Sensor outputs a *high* voltage, the electromagnet shuts off, and vice versa.
That circuit should already give you that behaviour. When the Hall sensor outputs a high voltage, you should see that voltage on pin 3 of the IC. Pin 2 of the IC will be around 2.5V according to the setting of the trimpot (start by setting it half way). This will cause the output (pin 1) to go high, which will remove the bias from the MOSFET and cause the electromagnet to turn off. If that's not happening, follow my description step by step and tell me where your circuit differs.
 
Turns out I misread the behavior of the LED - it actually goes dim due to the Hall sensor outputting a high signal, due to voltage difference being smaller.
Pins 3 and 2 read 2.5V as you said. However, pin 1 behaved oddly.
When pin 1 is idle (no magnet near the sensor), it is at 12V.

However, when the Hall Sensor was sending a high signal, the MOSFET did nothing - it was completely unaffected. When it sent a low signal (the LED brightening due to voltage difference) Pin 1 dropped down to ~2V, and the drain of the MOSFET (middle pin) jumped up to 12V (from 0V when idle).

When it sent a high signal, the magnet did nothing (i.e. was off). High signal registered as 5.00V on the Hall output pin, low signal as around 1.5V, idle as around 2.5V.

If I had to take a wild guess, I would say that the electromagnet is interfering with the signal, but I don't know how to stop this...
 

KrisBlueNZ

Sadly passed away in 2015
Turns out I misread the behavior of the LED - it actually goes dim due to the Hall sensor outputting a high signal, due to voltage difference being smaller.
How have you connected the LED? Can you post a schematic with the LED shown?
However, when the Hall Sensor was sending a high signal, the MOSFET did nothing - it was completely unaffected. When it sent a low signal (the LED brightening due to voltage difference) Pin 1 dropped down to ~2V, and the drain of the MOSFET (middle pin) jumped up to 12V (from 0V when idle).
That's what the circuit is supposed to do.

When the Hall sensor output goes lower than 2.5V (or whatever voltage you've set on the trimpot), the op-amp's non-inverting ("+") input is lower than its inverting ("-") input, and the op-amp will respond by driving its output low. This applies bias to the MOSFET and turns it ON (a P-channel MOSFET is turned ON when its gate is brought negative relative to its source by more than a few volts). When the MOSFET turns ON, it pulls its drain up to the positive supply rail, and this energises the electromagnet.
When it sent a high signal, the magnet did nothing (i.e. was off). High signal registered as 5.00V on the Hall output pin, low signal as around 1.5V, idle as around 2.5V.
That is all correct.
If I had to take a wild guess, I would say that the electromagnet is interfering with the signal, but I don't know how to stop this...
I wouldn't be surprised. I don't know enough about magnetism to say, though. For the thing to work, though, I think the magnetic field from the suspended magnet needs to be significantly stronger than the magnetic field from the electromagnet, because the Hall sensor needs to detect how close the suspended magnet is.

Have you tried re-winding the electromagnet with a larger core as shown in the project documentation?
 
How have you connected the LED? Can you post a schematic with the LED shown?

Well, the cathode is on +5V and the anode on the analog output of the Hall sensor.

I wouldn't be surprised. I don't know enough about magnetism to say, though. For the thing to work, though, I think the magnetic field from the suspended magnet needs to be significantly stronger than the magnetic field from the electromagnet, because the Hall sensor needs to detect how close the suspended magnet is.

Have you tried re-winding the electromagnet with a larger core as shown in the project documentation?

So it appears that this has now become an engineering problem - the magnetic field of the levitating magnet has to be strong enough to be pulled upward by the electromagnet from a greater distance than when it trips the sensor, while also not being caught by the iron core.

It appears this was partially solved in the original project by placing the Hall sensor a distance away from the electromagnet - the sensor wouldn't pick up the magnetic field nearly as badly, but everything would still interact just fine.

Unfortunately, this means I need to find some particularly strong neodymium magnets.

Thanks, Kris - you've been a big help!
 

KrisBlueNZ

Sadly passed away in 2015
Well, the cathode is on +5V and the anode on the analog output of the Hall sensor.
That can't be right. The LED needs positive voltage on its anode relative to its cathode.

Do you have a resistor in series with it? You need one, otherwise the LED will prevent the Hall sensor output from pulling all the way up (or down, depending on how the LED is connected).

I suggest you remove the LED. It may be stopping the circuit from working. You can measure the Hall sensor output with a multimeter.
So it appears that this has now become an engineering problem - the magnetic field of the levitating magnet has to be strong enough to be pulled upward by the electromagnet from a greater distance than when it trips the sensor, while also not being caught by the iron core.

It appears this was partially solved in the original project by placing the Hall sensor a distance away from the electromagnet - the sensor wouldn't pick up the magnetic field nearly as badly, but everything would still interact just fine.
Yes, I think that's right. The Hall sensor needs to be positioned so it responds mostly to the magnetic field of the suspended magnet, because it's used to detect the distance downwards to the suspended magnet so the electromagnet can be controlled to keep the magnet suspended at the desired distance. The Hall sensor provides feedback to the circuit, telling it how far away the suspended magnet is.

The Hall sensor is going to respond to the electromagnet as well, but the suspended magnet is very powerful and is the main influence on the Hall sensor.
Unfortunately, this means I need to find some particularly strong neodymium magnets.
What were you using before? I think the project description is pretty clear that you need a Neodymium magnet.
 
The idea was that when the output voltage was low (e.g. 0V) the voltage difference would cause the LED to light up, and vice versa. Anyway, took it out.

I was using an adorably tiny one, a 3/8" by 1/8" disc. I later tried a 1/2" by 1/8" disc, but it fared no better.
 
Top