1
\$\begingroup\$

I have seen many circuits which allow you to turn on an LED when a magnet is placed close to a Hall effect sensor. But I need a circuit that will turn off the LED when the magnet is close to the sensor. I cannot use a latch since the magnet polarity cannot not be changed. I was thinking about using a switching transistor with the sensor and LED but I am not usre how to configure this correctly. Any suggestions?

I am using an OH090U Hall Effect sensor.

Thanks!

\$\endgroup\$
2
  • \$\begingroup\$ Surely an inverted buffer would work! \$\endgroup\$
    – KyranF
    Nov 9, 2014 at 16:15
  • \$\begingroup\$ Why not a NC reed relay? \$\endgroup\$ Nov 9, 2014 at 17:40

2 Answers 2

3
\$\begingroup\$

Bias the switching transistor on with a resistor to Vcc, then connect the Hall sensor switch from the Base to the Emitter. The sensor will 'rob' current from the base and turn the transistor off.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
  • \$\begingroup\$ +1 : it looks like you are about 5 minutes quicker than I am this time. \$\endgroup\$
    – davidcary
    Nov 9, 2014 at 17:35
  • \$\begingroup\$ Dumb question: why do we need to use a transistor here? Imagine the same same circuit, containing only Vcc, R2, D1 as pictured, with the HE sensor placed in parallel with D1. When the HE is open, the circuit functions as a basic LED circuit. When it's closed, it acts as a wire across D1, meaning no current will pass through D1. Wouldn't this work? The down side of this plan is that we're burning power through R2 as long as the LED is off. But we'd also be burning power through R1 in the circuit you pictured. Is it just a matter of burning less power through R1 compared to R2? \$\endgroup\$
    – danns87
    Oct 5, 2015 at 0:24
  • 1
    \$\begingroup\$ Yes, but the OH090U Hall sensor is rated for 25mA absolute maximum sink current. If you were running a standard red LED at 20mA on a 5V supply the sensor would sink ~30mA when bypassing the LED. \$\endgroup\$ Oct 5, 2015 at 0:34
  • \$\begingroup\$ Gotcha. What if I were willing to run the LED a bit dimmer by increasing R2, to reduce the current sunk by the Hall sensor to <25mA? I'm curious if there's anything else I missed. \$\endgroup\$
    – danns87
    Oct 5, 2015 at 6:13
  • 1
    \$\begingroup\$ If you keep the shunt current down to 20mA or less it should be fine. \$\endgroup\$ Oct 5, 2015 at 15:58
2
\$\begingroup\$

You can use practically any nFET or NPN transistor as an inverter, as in the following circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.