I have a hall sensor U18-524
Leg 1 is Vcc
Leg 2 is GND
Leg 3 output
I assumed that when the sensor senses electric field he connects VCC to output, and when he feels field in the opposite polarity he connect GND to output.
When it only connect to my multi meter and battery it works, I measure the voltage between the output and VCC and it is 0. Then I put a magnet near by and it switches to 9v.
That is great.
But when i attach load (LED + resistor) And bringing a magnet near by
I get instead of 0 difference (meaning output = Vcc) ,a difference of about 6V meaning I give the LED only 3v.
When I attach 47k resistor between the Leg 1 and leg 3 the voltage between them drops to 5v and the LED brightens, when i switch to 220ohm resistor I get 0.1V between them (meaning the led + its resistor get almost all 9v).
I don't understand why it happens. why the resistor between leg 1 and 3 helps ? i thought the hall sensor i like a switch which connect leg 3 to 2 or 1.
I tried to read about pullup resistor, but it is something you use with a transistor and seems to be completely unrelated. but from the other hand it mentioned here:
Here is a data sheet for that Hall effect sensor - it shows that the output is what they refer to as "open collector" which means that the output can pull down (sink) a current, but not supply a current. In your case, you need a resistor (to limit the LED current) from the positive supply which is then connected to one side of the LED. The other side of the LED goes to the output of your hall effect sensor. Where a "pull-up resistor" would come into play (which is sort of how the resistor for the LED is being used) would be if you were wanting to measure the output of the sensor with some other device. You would put a pull-up resistor between the output of the sensor and the supply voltage so that when the output transistor was turned off, the output would be "pulled-up" to the supply voltage and when the output transistor turned on, the pull-up resistor then limits the current into the output transistor.
1 Like
The sensor has an open collector output, this is a pull down only output.
A 47K will only allow a fraction of a mA to flow but it is some current.
The sensor is not a switch in the sense of connecting two pins together. It is a transistor that turns on or off, that is it conducts to ground or not.
I sounds like you want a reed switch not a hall sensor if you want contacts to make.
Thanks gpsmikey and Grumpy_Mike
So the sensor has only the ability to connect to GND or to be disconnected.
I have several questions :
-
Why when I don't connect any load I can measure on the Output leg the same voltage as in the input Leg outout a pull-up resistor ?
-
I want to use it for sensing (connect to Arduino input instead of LED). Do I still need the pull up resistor ?
-
When I connect 47K pull up resistor (with 9v battery) I have a current leakage of
9v/47k ohm = 0.19mA (when the hall sensor is connects the output to the GND).
Right ?
Thanks.
Hi Mike, Thanks for the quick answer.
I'll try to explain again question 1.
You've said : "The sensor is not a switch in the sense of connecting two pins together.
It is a transistor that turns on or off, that is it conducts to ground or not."
But when I don't connect any load, just pin1 VCC pin2 GND and measure the voltage between Pin1 and Pin3 with a multi-meter (and bring a magnet near by) I can measure 0 voltage betwen pin1 and pin3, meaning the sensor conducts not only to the ground, but also to the VCC (unfortunately it happens only without load).
so there is a contradiction between what you've said, and the behavior I'm experiencing (or I misunderstood you).
Regarding question 3
Why it is not a leakage, it is a useless current that flows from VCC to GND and just warms up the pullup resistor.
so there is a contradiction between what you've said, and the behavior I'm experiencing (or I misunderstood you).
You misunderstood me.
What you are doing is measuring between Vcc and the output, so when the output transistor is conducting it is connecting the other end of your meter to ground, thus allowing you to measure the supply voltage. In effect your meter is the load or pull up resistor.
Why it is not a leakage,
Because in electronics leakage means current that flows that you wish would not flow in an ideal world.
Like the current through a capacitor with a DC voltage across it. There is some very small current that is internally discharging the capacitor.
it is a useless current that flows from VCC to GND and just warms up the pullup resistor.
No it is not useless, it is converting the current flow into a voltage and you detect a voltage on your micro controller. It is something that is meant to happen and if it didn't then the whole thing would not work.
With leakage in a capacitor if there was none then the capacitor would always stay charged when the voltage was removed, it could hold its charge forever.
Thank you for you quick answers. 