2
\$\begingroup\$

Intro

I have an automotive-type Hall sensor that is slowly failing and want to squeeze a bit more life out of it, since it's costly and not readily available. Not a critical part.


Original design

The sensor I assume is a Hall transistor-type arrangement - it takes 12V supply, a 6V pulled-up signal line and ground. On detection, it pulls the 6V to ground. I've measured the short-circuit current on the signal line to be 20mA.

The "computer" on the other side reads the low signal and can work with a bit of headroom, but I assume it needs to be down to at least 2-3V in order for the signal to register reliably.


Goal

I want to design a very simple circuit that raises the input impedance on the sensor side and provides a low impedance (>20mA) on the "computer" side. That is, the circuit should provide a 6V (Vcc/2) signal line with about 10k of impedance, and when that voltage falls below 5V (~Vcc/2.5) it should drive the output side low as well. Inverted should also be fine, as far as I can tell.


Ideas

I already had an LM324 window comparator built before I knew how the circuit actually behaves. However I don't like the fact that it feeds 12V on the signal line, computer side. I could add a diode to allow only pull-down, or set the Vcc to 6V for the LM324, but the component count is already high. Also three gates are unused.

I could try a 2N222 common-emitter circuit but from my calculation it seems that the gain is too low. Maybe a Darlington would work?

The last idea, which I would like to avoid, is to just use an ATTiny85 board (have a few of those), reading the ADC through a large resistor, pulling the output line low if it goes below a threshold. This is a minimal part solution since it already has a regulator in place and would only need a diode on the output and a resistor (>25k) on the input. Edit: won't work, the ATTiny will see 6-7V on its output pin.


Edit: I've measured that the sensor can source 4mA to ground, assume it also sinks around that value. Likely the computer can work with 5-10mA (since it works sporadically), but targeting 20mA just to be safe. It needs a pullup. Can't seem to shake the feeling that this sounds like DTL / TTL.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ how is it "slowly failing"? I can't think of any failure mode of a highly integrated Hall sensor that you can fix with a buffer, if the output is already digital? Oh, and types/datasheets always help. \$\endgroup\$ Sep 2, 2017 at 12:59
  • \$\begingroup\$ Like Marcus, this sounds suspicious to me - it may be a mistake to prop up a fault with patch-up electronics. \$\endgroup\$
    – glen_geek
    Sep 2, 2017 at 13:04
  • 1
    \$\begingroup\$ especially since your output is already a binary decision – either high, or low. If something fails, i.e. the thing should be low, but isn't, then I don't see how you'd notice externally at all! (your output voltage can't be "a little low") \$\endgroup\$ Sep 2, 2017 at 13:10
  • 2
    \$\begingroup\$ The transistors and/or magnets are getting weaker. The entire sensor assembly is electro-mechanical and potted. The output is analog but the computer likely does LPF (<2kHz) and compares the signal to some threshold to convert it to digital. The "slowly failing" means that the computer started missing signals and now is only recognising only 10%, if that. Manually driving the sensor line (short to ground) registers fine. \$\endgroup\$
    – brainwash
    Sep 2, 2017 at 13:22
  • \$\begingroup\$ Just to clarify, the computer expects a 0 to 6V input into a 250 ohm pull-up resistor, the sensor is now outputting 5.5 to 6V because it doesn't have enough current gain to pull the line low. Whether the missing drive is caused be weakened magnets or weakened transistor - I can't say - the electronics are potted in epoxy, together with a mating mechanical part. \$\endgroup\$
    – brainwash
    Sep 2, 2017 at 15:57

2 Answers 2

2
\$\begingroup\$

I'd rather try this very simple current buffer:

schematic

simulate this circuit – Schematic created using CircuitLab

1) Hall sensor will have to sink no more then 1.5 mA, I beleive this is quite within reach.

R1 has be a little lower than R2 so that when Hall sensor is open circuit Q1 base is higher enough than 6V pullup to be sure Q1 is off despite voltage tollerances.
Just make sure not to go beyond max BE reverse voltage (a few volts at least anyway).

If Hall sensor current were too high R1 and R2 could be increased or even removed at all.
This would have to be payed with a lower maximum operation frequency and a somehow lower noise immunity due to higher input impedance

2) Output will be pulled down to \$V_\text{CE(sat)}+V_\text{BE(on)}\approx 0.3\,\text{V}+0.7\,\text{V}=1\,\text{V}\$ which is quite below the 2 to 3V you believe enough for reliable working

\$\endgroup\$
6
  • \$\begingroup\$ Thank you! That looks just like what I want and similar to what I designed a few hours ago. I used an STC945 (NPN) and R1+R2 were part of a variable 28k resistor, with a 500 ohm resistor on the Vcc side for safety. Will try your design tomorrow and hopefully it will do the job. \$\endgroup\$
    – brainwash
    Sep 2, 2017 at 22:35
  • \$\begingroup\$ In my simulation your circuit draws 2.1mA from the sensor, but that should be quite ok. For reference, the sensor has been "fading" from 100% to 10% over the last 4 years and is at least 15 years old. Assuming it went down from 20mA to 5mA over 15 years, 2mA should probably make it last at least two years. To simulate such a sensor in LTSpice (or other SW) use a current source to ground with a "protection" diode in parallel. \$\endgroup\$
    – brainwash
    Sep 2, 2017 at 22:51
  • \$\begingroup\$ @brainwash Input current somehow depends on Q1 nearly-saturated hFE which can vary a lot but in your case there's an issue with Hall switch model. Using a current source (value?) with a backward diode forces input node approx one diode drop below zero volt. This does not happen in the real circuit. One saturated transistor (i.e. Hall output) can be simply modeled by a voltage source approx Vce(sat). I tried simulate with both models and get 1.9mA/1.2mA input current. A second catch is output voltage to computer. Using current source we have an unrealistic 70mV, with the right one approx 1V. \$\endgroup\$
    – carloc
    Sep 3, 2017 at 8:00
  • \$\begingroup\$ I somewhat agree: the current sink is a better approximation and the diode is ideal. The issue with a voltage source is that it creates voltage out of thin air, which doesn't happen with the transistor. At least that's my understanding. Anyway, just built your circuit, tested it on the bench and will try to fit it in a few hours and hopefully mark your answer as the solution. \$\endgroup\$
    – brainwash
    Sep 3, 2017 at 14:02
  • \$\begingroup\$ I am looking forward your successful testing. :) Voltage out of thin air it is no problem as long as current is entering the collector as would do in a real transistor (voltage source is a kinda Zener then). If that's not the case, saturation is not operating zone and model shall be changed accordingly. On the other hand a current source + ideal diode is just like a short circuit as long as the diode is forward biased, this leaves out Vce(sat) and, as seen above, results may not be as good. As a final thought, if you wish to improve modeling just use an NPN BJT with some base bias. \$\endgroup\$
    – carloc
    Sep 3, 2017 at 14:55
1
\$\begingroup\$

it takes 12V supply... the circuit should provide a 6V (Vcc/2) signal line with about 10k of impedance, and when that voltage falls below 5V (~Vcc/2.5) it should drive the output side low as well.

The circuit below uses 1/2 of an LM358 dual opamp. R1/VR1/R2 produces a reference voltage adjustable from ~4.9V to 6V. R3 provides ~150mV of hysteresis to ensure that the output switches cleanly if the input voltage varies slowly.

R4 and R5 provide the sensor signal line with 6V at an impedance of 12.5k. When the op amp output is high it supplies ~1mA Base bias current to Q1, which then pulls the output down to ground. The 2N3904 has a minimum HFE (current gain) of 60 at 50mA, so it should have no trouble sinking 20mA.

schematic

simulate this circuit – Schematic created using CircuitLab

This circuit assumes that the input signal is ratiometric (ie. proprotional to supply voltage) and that the 12V supply is not too noisy. If noise or voltage fluctuations are a problem then you may need to filter and/or regulate the 12V supply.

If the input signal is not ratiometric then at least the reference voltage should be stabilized - eg. by wiring a 6.2V Zener diode from R1/VR1 to ground as a shunt regulator, and reducing the value of R1 to provide an appropriate Zener bias current.

\$\endgroup\$
5
  • \$\begingroup\$ That's a nice solution and very similar to what my previous iteration, except that I used an LM324. However I think while correct, it has a high part count. For example see imgur.com/BEr9D90 where R2 adjusts for current gain. The result is: imgur.com/5CpXDn5 . I've measured that the sensor sinks/sources ~4mA. \$\endgroup\$
    – brainwash
    Sep 2, 2017 at 21:02
  • 1
    \$\begingroup\$ I wouldn't get too hung up on parts count. The important thing is to make sure it works - even with a degraded sensor that may get worse. If the output only needs to sink 4mA then you can use an LM393 comparator. If you won't need to adjust the voltage threshold then the pot isn't necessary. The 6V pullup resistors could be moved to the output side if that is where they need to be. My first draft used this configuration, but I rejected it because it could not supply 20mA and my interpretation was that the sensor needed a pullup, not the destination device. \$\endgroup\$ Sep 2, 2017 at 21:22
  • 1
    \$\begingroup\$ "I've measured that the sensor can source 4mA to ground, assume it also sinks around that value." - what output voltages do you get from the sensor when not connected to the computer? \$\endgroup\$ Sep 2, 2017 at 21:37
  • \$\begingroup\$ Just to clarify, the sensor needs a pullup, not the computer side. The "computer" provides the 250 ohm/6V pull-up. The sensor (collector?) lies at ~0.6V without any pull-up. Your schematic looks just fine from my side. \$\endgroup\$
    – brainwash
    Sep 2, 2017 at 22:28
  • 1
    \$\begingroup\$ OK I get it now. In that case a simple PNP Emitter follower should work, which is what I originally thought of but was fooled by the 'only pulls down to 5V' bit. Looks like carloc has the answer you want! \$\endgroup\$ Sep 2, 2017 at 23:43

Your Answer

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

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