I have asked a similar question previously and got some great answers, however during testing, it transpired that there was another requirement that I had missed in order to satisfy some diagnostic tests which needs a rethink - constant current output against a varying load.

I would like to ask humbly again for some help with the below issue to create a switching constant current output circuit to meet the following requirements;

  • 10-15v input, 7-14 mA constant current output against a resistive load changing from ~20-1870 Ohms, switching with a 0-3.3v digital output
  • crisp signal output upto 6kHz
  • bonus feature - ability for 7,14 and 28 mA output with 2 x 3.3v digital outputs


I am trying to replicate an automotive wheel speed sensor to simulate against an ABS unit. The basic signal output of the sensor I am trying to replicate is as follows, for which I have done the coding and the ABS unit recognises the pulsed input as speed;

Smart Hall Effect Wheel Speed Sensor

I believe the sensor is read by the ABS unit like this;

ABS Signal Input Circuit

From initial testing, it shows that the load resistor the current is measured against in the ABS unit is around 20 Ohms (as oposed to the 75 Ohms originally posted), this led to the following schematic giving 6.9-14.5 mA for a 12v input with a 135-270 mV output;

7-14 mA pulse output schematic

Problem 1

The 12v is not always 12v. It is VBatt, so could be anywhere from 10-15v in reality, which gives the following outputs from the above circuit - 5.9-12.1 mA for a 10v input and 8.6-18.1 mA at 15v input. There is limited information available about the actual sensor I am using, however I believe it to be very similar in behaviour to this NXP KMI15 sensor, for which some information exists. The tail voltage test outputs would fail against this spec;

Current Output Specification

Problem 2

This is the bigger issue, as arguably I could clamp the input voltage to 12v. During post ignition diagnostic checks, the sensor output jumps towards 12v (given that the normal output is 0.135-0.27v, this is a huge jump). The input line for each sensor is pulsed independantly in a pattern, after which all sensors 'respond' with a jump in voltage together;

Post Ignition Diagnostic Check

I believe what is happening (as I dont think there is anything smart in the sensor) is that the load resistor in the ABS unit is being switched to 1870 Ohms, and a continuous current output from the sensor of 7 mA is leading to the voltage increase seen. This is backed up by the NXP data sheet showing a schematic of the sensor - is my assumption sensible, or could anything else be happening?;

NXP KMI15 Schematic

I understand there are two constant current 7 mA sources, with the first always active on the output line when VBatt is present on the input. The second 7 mA source is then pulsed on the output line to generate the required signal output. My question is how to replicate this in a producable schematic with a 0-3.3v digital output controlling the second 7 mA current source?

I have tried to do some research into constant current sources, and have seen that 'LED Driver' is a good search term, but I am still unclear how to perform the overlay switching on the output without the first source trying to compensate its output in reaction to the increased output voltage? I have ordered some Linear BCR431U LED drivers to have a go, but an informed opinion would be most appreciated to do this correctly.


I think the above circuit is creating the constant current outputs via a 'Current Mirror' so I am researching this now, however I am still unclear how to go about switching these to 'add' the additional 7mA to the output.

Edit 2

I have schemed a double PNP Current Mirror, and made a fixed current sink to set the output at 7mA. I have tuned this so the + on the op-amp can be controlled with a 3.3v digital output to pulse the 7mA against the 20Ohm load resistor. It definitely seems like I might be over complicating it, but this at least gives me a guaranteed 7mA over the input voltage range and a way of switching it on and off. This seems to meet the requirements, but please feel free to point out if I have done anything silly, or if this can be simplified/improved in any way!

PNP Current Mirror with switchable 7-14mA output


There is one further type of speed sensor, that uses the AK protocol - from a hardware point of view it has the same 7-14mA output requirements, however it also has the ability to output a 28 mA pulse. If a solution is presented for the previous problems, I'm hoping it will be simple to copy the switching principal to further extend its capabilities to this additional constant current source with an additional digital input from the microcontroller.

Thank you in advance for any help you are able to provide - I really appreciate it!

  • \$\begingroup\$ Hey there, I answered your previous question, but didn't notice your updates. Is there any suggestion or design in my answer that came close, so I can tweak it? Also, If the load gets up to 1800Ω, and the current through it is 14mA, that's 25V, which doesn't seem reasonable to ask from a 12V supply. Am I misunderstanding you? \$\endgroup\$ Commented Mar 16, 2023 at 13:43
  • \$\begingroup\$ Are the required voltage levels and other comments in the update to your previous question still valid? I'm busy reading it. \$\endgroup\$ Commented Mar 16, 2023 at 13:50
  • \$\begingroup\$ Hi Simon - Thank you very much for looking at this - your suggestions from the last question helped me greatly in getting this far and having the ABS read in an actual speed from the pulses. The output voltages have changed as the base load resistor wasnt as I expected (and as I have found out is obviously SW switchable within the ABS unit so I wasnt able to measure it with the unit off). The main requirement now is that the outputs are constant current, whatever the input voltage or output resistance. I control the switching between 7-14 mA so can ensure it wont happen unintentionally \$\endgroup\$
    – JamesGT3
    Commented Mar 16, 2023 at 14:02
  • \$\begingroup\$ In the updates for my previous question - I think I was missunderstanding what was happening. I thought the sensor itself was effectively shorting the supply to create the 12V output pulse as a response to the diagnostic pulses - This cant really be happening as the sensor would never put out 600mA, so I think it is much more sensible to assume the ABS unit is changing the shunt resistance against a constant 7mA output. But I am open to anyones opinion on what else could be happening! \$\endgroup\$
    – JamesGT3
    Commented Mar 16, 2023 at 14:06
  • \$\begingroup\$ OK, I understand. It makes sense that the output goes to 12V across a high-resistance load, since that's the largest output we can produce, and anything significantly above 7mA will get clamped there, whether it's 20Ω or 20000Ω. Also 0V is easy, because that's no current. When you say 28mA, what's that about, where did that figure come from? \$\endgroup\$ Commented Mar 16, 2023 at 14:29

1 Answer 1


I read your update - seems good!

Here's my first attempt at a voltage-controlled current source, using the BVC62 you suggested:


simulate this circuit – Schematic created using CircuitLab

One great thing about the current mirror idea, is that you can use control potentials that are all with respect to ground. That's useful because any microcontroller's or DAC's outputs don't need to be translated upwards to be relative to +12V, something you'd probably have to do if you implemented a high-side current source.

The BCV62 will not appreciate 28mA through it, because it will dissipate more than its absolute maximum power of 300mW (I suspect that it will be fine with that, but matching won't be guaranteed). Also its mirroring will be quite bad, when Q2's \$V_{CE}\$ is very different from Q1's (which is the case). To solve both these issues, I included Q3 and Q4, whose matching is less critical, so two discrete transistors of the same model should be fine.

Q4 now handles the bulk of the voltage drop \$V_{CE}\$ that Q2 had to endure before, which messes with its accuracy, and consequently also takes the heat. This arrangement of Q1, Q2, Q3 and Q4 (a Wilson mirror) should get you a mirror accuracy of a few percent.

Then to set current in the master path, via Q3, I use the usual setup of an emitter follower, to set the voltage across R1. By using a darlington pair (Q5 and Q6), I require only a few microamps of current from whatever control system I attach to input IN.

The result is a voltage-controlled current source with an input-output relationship very close to:

$$ I_{OUT} = \frac{V_{IN}-1.3}{100}$$


$$ V_{IN} = 100 I_{OUT} + 1.3$$

Graphs of input voltage and output current with an input varying both continuously, and "digitally" over time, look like this:

enter image description here enter image description here

From those formulae I calculated input potentials necessary for your required current points:

\$I_{OUT}\$ \$V_{IN}\$
0mA < 1.3V
7mA 2.0V
14mA 2.7V
28mA 4.2V

Now it just remains to produce these potentials under control of digital signals:


simulate this circuit

Since you require a very stable voltage from which to derive appropraite potentials for IN, I strongly recommed a precision reference, like the the TL431 (which is amazing, you should have a look). It uses a couple of resistors to produce any voltage you require (R7 and R8). I want 4.2V.

I use a potential divider to derive a fraction of that 4.2V, and I can select which fraction by choosing from various resistors, engaged by switching on or off MOSFETs.

Digital input A will inhibit output current when high, so \$I_{OUT}=0\$. Otherwise, with A low, B and C set \$V_{IN}\$, and therefore output current \$I_{OUT}\$ as follows

Inputs B and C control, set output current as follows:

B C \$V_{IN}\$ \$I_{OUT}\$
LOW LOW 4.2V 28.6mA
LOW HIGH 2.0V 7.1mA
HIGH LOW 2.7V 13.9mA
HIGH HIGH 3.3V 3.4mA

Obviously you won't need the 3.4mA option. I use voltage sources V1, V2 and V3 to simulate those digital inputs, and they look like this::

enter image description here enter image description here enter image description here

The resulting \$V_{IN}\$ and \$I_{OUT}\$ look like this:

enter image description here enter image description here


A few extra notes about this design. It's not a precision design, but I imagine the ABS system expects there to be some deviation in currents from the prescribed 7mA, 14mA and 28mA values. There's no "regulation" to speak of, no feedback, no closed loop, only behaviour slightly dependent upon component tolerances.

That has its advantages though. One is that there's no frequency compensation necessary, and it should behave well even if Rout is reactive, like that CL I asked you about. Your own circuit does compensation with C1 and C2, which is probably fine.

Another is that you don't have to worry about finding op-amps that have appropriate input and output ranges, slew rate and so on.

The maximum voltage output you can expect from this design is just over 11V, and that's only when Rout is large, over 1kΩ. Again, I expect that the ABS system will interpret this fine, but obviously you'll have to test.

  • \$\begingroup\$ Thank you, Simon, for taking the time to investigate this and write this fantasticly detailed response - I am most grateful! I'll have a play with the simulations against the various diagnostic conditions so I understand its workings fully! Satisfyingly last night, doing the same with the circuit I simulated last night, its outputs match the oscilloscope traces of the sensor perfectly! I've since changed the LT1492 for an AD8606 witch are a fraction of the cost with seemingly the same results. \$\endgroup\$
    – JamesGT3
    Commented Mar 17, 2023 at 9:16

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.