# How to design a high side current sense circuit that produces an output voltage inversely related to the load current.

#### phillipsoasis

Joined Aug 22, 2022
63
I have an circuit board with a Raspberry Pi and other electronics. It will be powered in the field with a 12 V battery/power source (Actually, it is rated at 12V but delivers a little more than 15V). The power source cuts out if the current it delivers is less than 100 mA. Unfortunately, when my board is idle, it draws less than 100 mA, so the power source shuts off. When my board is active, it can draw upwards of 3 A for about a second, then goes back to idle.

A simple solution is to add a 75 Ohm 5 Watt resistor from 12V to ground, which I have been doing on my lab bench as I work on the circuit and software. The resistor heats up to around 91 degrees F, which is OK, but I really don't need the heat nor the wasted energy which just shortens the life of my power source in the field.

I was looking at high side load current monitoring op amp circuits to drive a BJT/MOSFET so as the load current decreases the current through the BJT/MOSFET increases (thus keeping the load current above 100 mA), but the voltage output is directly related to the amount of current and not inversely related. I need a current sensing circuit that produces an output voltage that is inversely related to the load current - as the load current increases the output voltage decreases, which would then reduce the current drawn by the BJT/MOSFET. I am just not seeing it.

The attached circuit is my first rumination on the design. It is not correct, but my starting point. The 2N2222 and TLV2462 are just parts I have on hand. I also do not have any negative voltages - just +12V, +5V, and +3.3V.

The +5V powers the Raspberry PI board and comes from a 5V 1.2A buck converter attached to the 12V power source. The +3.3V comes from the Raspberry Pi board. The 12V powers the circuit for igniting a rocket igniter: +12V @ 1-3A for 100-300 mSec. The Pi and associated electronics control the igniter circuitry.

Last edited:

#### Alec_t

Joined Sep 17, 2013
14,009
The power source cuts out if the current it delivers is less than 100 mA.
Assuming your power source is off, how does it ever start up?

#### phillipsoasis

Joined Aug 22, 2022
63
Assuming your power source is off, how does it ever start up?
The user has to push the "on" button on the power source to turn it back on. In fact, there are two buttons that have to be pushed - on/off and DC power.

#### Attachments

• 103.8 KB Views: 10
Last edited:

#### crutschow

Joined Mar 14, 2008
33,365
Below is the LTspice sim of a simple circuit that should do what you want:
It shows the supply current versus the load resistance.
When the supply current (green trace below purple trace) is above 120mA, Q1 is turned on from the current through R1 which keeps the P-MOSFET M1's gate-source voltage (blue trace) at a small positive voltage and thus M1 off.
When the load current (purple trace) drops to below about 120mA, Q1 starts to turn off, which increases M1's gate-source voltage negatively, turning on M1 to shunt just enough current to ground to keep the supply current from dropping below 120mA.
(You may need to tweak the value of R1 to get closer to the current value you want. Higher resistance lowers the current).

The one disadvantage of this simple circuit is that it drops near 1V from the power supply when the current is at its 3A maximum (yellow trace).
Is that a problem?

Last edited:

#### phillipsoasis

Joined Aug 22, 2022
63
So do both buttons have to be pushed after it turns itself off from the current getting too low?
Not at the same time. Power on first, then dc. How does this relate to my original question? I am trying to draw enough current so the unit does not turn off.

#### crutschow

Joined Mar 14, 2008
33,365
Not at the same time. Power on first, then dc. How does this relate to my original question? I am trying to draw enough current so the unit does not turn off.
Yes, I realized that wasn't a pertinent question and removed it.
See my proposed circuit in post #4.

#### Alec_t

Joined Sep 17, 2013
14,009
If you want to minimise the voltage drop across the sense resistor you can use your post #1 op-amp circuit, modified as below.

Tweak R2 to adjust the Q1 on/off threshold.

#### crutschow

Joined Mar 14, 2008
33,365
If you want to minimise the voltage drop across the sense resistor you can use your post #1 op-amp circuit, modified as below.
View attachment 301387
Tweak R2 to adjust the Q1 on/off threshold.
That circuit needs some sort of reference voltage.
As is, the op amp's turn-on point is just its offset voltage multiplied by the voltage divider value.

#### phillipsoasis

Joined Aug 22, 2022
63
If you want to minimise the voltage drop across the sense resistor you can use your post #1 op-amp circuit, modified as below.
View attachment 301387
Tweak R2 to adjust the Q1 on/off threshold.
I wired up your circuit, and the output of U1 is ~15 V regardless of the condition of SW1, so Q1 is always on.

#### phillipsoasis

Joined Aug 22, 2022
63
Below is the LTspice sim of a simple circuit that should do what you want:
It shows the supply current versus the load resistance.
When the supply current (green trace below purple trace) is above 120mA, Q1 is turned on from the current through R1 which keeps the P-MOSFET M1's gate-source voltage (blue trace) at a small positive voltage and thus M1 off.
When the load current (purple trace) drops to below about 120mA, Q1 starts to turn off, which increases M1's gate-source voltage negatively, turning on M1 to shunt just enough current to ground to keep the supply current from dropping below 120mA.
(You may need to tweak the value of R1 to get closer to the current value you want. Higher resistance lowers the current).

The one disadvantage of this simple circuit is that it drops near 1V from the power supply when the current is at its 3A maximum (yellow trace).
Is that a problem?

View attachment 301362
Thanks for the circuit and simulation. If I understand your comments correctly, you are saying that Vout drops by ~1V when the load draws 3 A (I don't see that in the yellow trace, but I believe you!). That should not be a problem...would have to test when the power source is at 20% charge or less. I don't know what the power source's voltage level drops to when it has a low charge. The 3A is to heat up a short length of nichrome wire with some black power on it (e.g a model rocket igniter). The voltage is not critical, but then, no one has really characterized rocket igniters. If the power source delivers 3A @ 9 V at a low charge, it should be OK.

Unfortunately, I cannot wire up your circuit as I do not have a BS250, nor any p-channel mosfets. The only mosfet I have is a IRLZ34N (n-channel). I only have 2 op-amps - TLV2462 and a 741. The transistors I have on hand are
PNP
A1015, S9012,2N3906, 2N5401, S9015, S8550
NPN
2N2222, C945, S9013, 2N3904, C1815, S9014, S8050, S9018, 2N5551
The only diode I have is 1N4007.
Those are the parts I used in the rest of the circuit.

I am not doubting your simulation results, but I can't build it to test with the test of the circuit. Could any of the parts I have substitute for M1? I know the answer is no, but asking if the circuit can be changed to use the parts I have on hand. I am looking for a source to order the BS250, but shipping time is about 3-4 weeks.

#### Alec_t

Joined Sep 17, 2013
14,009
I wired up your circuit, and the output of U1 is ~15 V regardless of the condition of SW1, so Q1 is always on.
Did you play with the value of R1 to vary the on/off threshold? Which op-amp did you use and what was its supply voltage?
Here's a slight variation which the LTspice sim says should work. I used a Darlington transistor because the op-amp I used can't source much current. The MOSFET you have would be ok instead of the Darlington.
Your TLV2462 has a maximum supply voltage of 6V, so would need further modification of this circuit to work.

#### crutschow

Joined Mar 14, 2008
33,365
Here is the simulation of the transistor circuit using the transistors and diode you have:
Vout drops by ~1V when the load draws 3 A (I don't see that in the yellow trace)
The yellow trace shows the output voltage, which drops to about 13.9V when the load is 3A.

(Note: You need at least a 20V rail-rail op amp to use in the op amp circuit since its input is operating at the supply voltage.)

#### crutschow

Joined Mar 14, 2008
33,365
Here's a slight variation which the LTspice sim says should work.
The sim may work, but the circuit still appears to be depending upon the input voltage offset of the op amp for it's threshold point, which is poor design practice.

#### phillipsoasis

Joined Aug 22, 2022
63
Did you play with the value of R1 to vary the on/off threshold? Which op-amp did you use and what was its supply voltage?
Here's a slight variation which the LTspice sim says should work. I used a Darlington transistor because the op-amp I used can't source much current. The MOSFET you have would be ok instead of the Darlington.
Your TLV2462 has a maximum supply voltage of 6V, so would need further modification of this circuit to work.

View attachment 301425
I thought I smelled something burning! I forgot to check the max supply voltage for the TLV2462...no wonder nothing worked! lol I will have to source a different op amp!

#### phillipsoasis

Joined Aug 22, 2022
63
Here is the simulation of the transistor circuit using the transistors and diode you have:
The yellow trace shows the output voltage, which drops to about 13.9V when the load is 3A.

(Note: You need at least a 20V rail-rail op amp to use in the op amp circuit since its input is operating at the supply voltage.)

View attachment 301426
Thanks so much! I hooked it up and I was going to measure the voltages, but my multimeter died! Have ordered another, so will have to wait until next week to test it out! By looking at the power source (which displays Watts out), if I have a 225 Ohm load (3 x 75 Ohm 5 watt resistors in series), the power source indicates 2 Watts. If I remove two of the resistors, the power source indicates 3 Watts. Looks good so far! Thanks again!

#### crutschow

Joined Mar 14, 2008
33,365
if I have a 225 Ohm load (3 x 75 Ohm 5 watt resistors in series), the power source indicates 2 Watts. If I remove two of the resistors, the power source indicates 3 Watts. Looks good so far! Thanks again!
So what does it do with no load, which is the condition you are concerned about?
What is the power supply power output then?

Last edited:

#### crutschow

Joined Mar 14, 2008
33,365
I just did a power simulation of the transistor circuit and noticed that the maximum power dissipation of Q2 can reach about 500mW. which is a bit much for the 2N3906.
Increasing R2 to a maximum of 140Ω (2W rating) will reduce it to about 370mW, which is still a little high, and will give a case temperature of about 100°C at room temperature.

So you might need to add a small clip-on heatsink on the transistor to help lower its temperature.
Testing the circuit with the real load, and seeing how hot the transistor gets should determine whether you need one, as the dissipation will vary depending upon the idle current of your circuit..

Last edited:

#### Alec_t

Joined Sep 17, 2013
14,009
the circuit still appears to be depending upon the input voltage offset of the op amp for it's threshold point
The offset is indeed involved, but it is roughly constant for a given installed op-amp and is smaller than the voltage drop across R2. The threshold point is set by the voltage on the inverting input, which is derived from the supply voltage by voltage-divider R2,R3. Granted, this won't be a very stable reference if the supply can vary in the 12-15V range, but for the present application it doesn't seem critical. Besides, we don't know the tolerance on the 100mA cut-off point.
I thought I smelled something burning! I forgot to check the max supply voltage for the TLV2462...no wonder nothing worked!
Oh dear!

#### crutschow

Joined Mar 14, 2008
33,365
The offset is indeed involved, but it is roughly constant for a given installed op-amp
And the offset of a particular op amp may have the wrong polarity to work in the circuit.
If the offset is such as to keep the output off with no load current, which is the critical condition, then it will never go on.

Last edited:

#### crutschow

Joined Mar 14, 2008
33,365
you are saying that Vout drops by ~1V when the load draws 3 A (I don't see that in the yellow trace, but I believe you!). That should not be a problem...would have to test when the power source is at 20% charge or less. I don't know what the power source's voltage level drops to when it has a low charge. The 3A is to heat up a short length of nichrome wire with some black power on it (e.g a model rocket igniter).
A thought on this voltage drop.
If you connect whatever switch provides the current to the igniter directly to the source, bypassing my circuit, then you would avoid the voltage drop to the ignitor.