Trying to invert a hall effect sensor (with LED)

Thread Starter

neinelith

Joined May 21, 2024
5
I have a hall effect sensor that turns the LED on when there is a magnetic field, and the LED turns back off when there is no magnetic field.

However, I want the opposite effect: LED turns off when there is a magnetic field.
I somehow understood that a transistor might be the solution, but I am unsure how to wire them.

Here are the components I have :
- Hall effect sensor: 3524 405C
- NPN transistor: 2N2222
- a LED
 

panic mode

Joined Oct 10, 2011
2,865
should provide your connection diagram and actual sensor part number or link to a datasheet.
those numbers are gibberish... unless you are dealing with AH3524 from Diodes Inc.

that product turns output on (active low) when field is detected. so you could use that output to short the LED, no external transistor needed.

1716318725382.png
 

Thread Starter

neinelith

Joined May 21, 2024
5
should provide your connection diagram and actual sensor part number or link to a datasheet.
those numbers are gibberish... unless you are dealing with AH3524 from Diodes Inc.

that product turns output on (active low) when field is detected. so you could use that output to short the LED, no external transistor needed.

View attachment 322872
Thank you for your answer.
You are right, the one I have is a AH3524.
From what I understand, you are suggesting I use a capacitor instead of a transistor, right ? In that case, what do you think would be a good value for this capacitor and the resistor?
Also, you say that the AH3524 turns active low when the magnetic field is detected but from my tests, it is the opposite. Am I misunderstanding something?
 

panic mode

Joined Oct 10, 2011
2,865
where did i use word capacitor?

and why don't you show us YOUR circuit?
what is the goal exactly?

and did you read the datasheet? it does not need much reading to find this:
1716388330732.png

and this
1716388432172.png

so capacitor is NOT an essential component here but it is recommended. and you will see plenty of this in all kind of circuits.

and what is the intended use? if this is just used to drive an LED, you can connect it the way i already have shown. it simply depends where the LED is connected:
1716388651635.png

if this is driving something else, inverting signal may be needed. but YOU need to tell us what is that you need. i do not want to read mind, guess or fight to get answers from you.

just show your circuit, state operating voltage, list component values, state what the issue is and then we can do something about it.
 
Last edited:

panic mode

Joined Oct 10, 2011
2,865
or if you insist on using transistor, something like this:
1716389577030.png

explanation...

normally we look at circuit blocks as something with separate input and output. that would be two wires in and two wires out.
but transistor only has 3 terminals. so one of them must be shared by input and output.
this allows for three possible circuits - common emitter, common base and common collector.

each has unique characteristics but only one of them inverts signal - the common emitter configuration.
so emitter is common, base is used for input and collector is an output.

since transistor has gain, base current can be small, hence 10k base resistor.
if hall sensor is off (or not present), current through that 10k resistor into base of transistor will cause transistor to turn the LED on.
but when magnetic field is present and output of sensor is low, base is shorted to GND which turns transistor and the LED off.

and while this circuit has two more parts (resistor and transistor), it draws less power than the one in previous post and that may be important for example if this is a battery powered circuit
 
Last edited:

Thread Starter

neinelith

Joined May 21, 2024
5
where did i use word capacitor?

and why don't you show us YOUR circuit?
what is the goal exactly?

and did you read the datasheet? it does not need much reading to find this:
View attachment 322911

and this
View attachment 322912

so capacitor is NOT an essential component here but it is recommended. and you will see plenty of this in all kind of circuits.

and what is the intended use? if this is just used to drive an LED, you can connect it the way i already have shown. it simply depends where the LED is connected:
View attachment 322913

if this is driving something else, inverting signal may be needed. but YOU need to tell us what is that you need. i do not want to read mind, guess or fight to get answers from you.

just show your circuit, state operating voltage, list component values, state what the issue is and then we can do something about it.
Many thanks again for your answer !

I actually thought the Hall effect sensor was ultimately used in a single way.
I noticed that the AH3524 behaved the opposite way compared to this video : How to make a "Hall Effect Magnet Sensor" on a Breadboard [HD] (youtube.com)
And behaved like the first sensor shown here: 2 Basic Project with Hall effect Sensor - YouTube
But I wanted it to work like the second one.
So I thought that inverting it required more components or complicated circuits...
Your explanation is life-saving here!

Honestly, the simpler the circuit, the better for me !

I have tried your circuit here :
1716451822959.png
and it works just as intended. THANK YOU !
I am very grateful for your help !
Many thanks
 

panic mode

Joined Oct 10, 2011
2,865
since book is likely to be closed for significant amount of time, i suggest using version with transistor due lower current draw when LED is off. the circuit without transistor is simpler but actually draws more current when LED is off.
different voltage can be used and 680Ohm value can be adjusted to meet LED specs. capacitor is optional - it does help in noisy environment but probably won't make any difference in your case.
 
Top