Author Topic: Simple high side current detector using "simple" parts?  (Read 1769 times)

0 Members and 1 Guest are viewing this topic.

Offline LinuxHataTopic starter

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: us
Simple high side current detector using "simple" parts?
« on: March 25, 2024, 07:07:58 am »
Hello.
I have a simple task - there is a load connected to the 12V line.
I have to detect whenever consumed current exceeds 100mA and turn on small reed relay.
It MUST be high side current detector - no insertion into ground path allowed.

I've read a lot about high side current sensing but most of these are for precise and linear current measurements, so involve special, rail-to-rail opamps, voltage references and so on, none of which I need.

So maybe there's simpler, crude solution to my issue?
 

Offline CosteC

  • Regular Contributor
  • *
  • Posts: 168
  • Country: pl
Re: Simple high side current detector using "simple" parts?
« Reply #1 on: March 25, 2024, 08:14:41 am »
"SIMPLE" is very imprecise term :)
Is this IC simple: https://www.st.com/en/amplifiers-and-comparators/tsc1031.html ?
There is whole family https://www.st.com/en/amplifiers-and-comparators/current-sensing/products.html
Of course ST is not only supplier of such parts.
Usually precision is not awesome, but those are simple to use.

In old days I would put be enough turns around reed contacts to turn it at desired current. It would have quite a lot of hysteresis however. Good or bad, depending on application.
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: sc
Re: Simple high side current detector using "simple" parts?
« Reply #2 on: March 25, 2024, 08:26:52 am »
All the complexity (and cost) of those specialized current sensing amplifiers are mostly caused by the need for very large common mode voltage far above their supply voltage. Imagine highside sensing 48V battery pack using 5V opamp, referenced from ground.

If you can power your circuit from the same 12V supply you intend to monitor then you can simply use the much more common positive rail input opamp. I didn't check yet but something like TL07x/08x *may* be sufficient.

Or if you want something even simpler then a PNP transistor and a shunt resistor is also possible, if you can tolerate 0.6V drop and a bit softer switching.
 

Offline bookaboo

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: ie
Re: Simple high side current detector using "simple" parts?
« Reply #3 on: March 25, 2024, 08:30:52 am »
If you don't mind some coding.......
https://learn.adafruit.com/adafruit-ina219-current-sensor-breakout/wiring

A discrete solution with a few opamps is possible and probably optimal, but ironically the arduino is more user friendly, samples and documentation.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9953
  • Country: nz
Re: Simple high side current detector using "simple" parts?
« Reply #4 on: March 25, 2024, 08:35:26 am »
If you have a MCU with an ADC that has a selectable high gain option, (Some AVR's have 200x)
You can put a voltage divider each side of the high side Isense resistor to bring it down to around 2.5V.

Then you can make a crude high side current sense by putting the ADC into differential mode between two ADC pins and using the 200x gain.

All you need is the Isense resistor, 4 resistors, plus maybe two TVS diodes for input protection.
You will need to zero cal each unit, as the voltage divider resistor tolerance will add quite a bit of unit to unit variation.  Or have a trim-pot
« Last Edit: March 25, 2024, 08:40:36 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: Simple high side current detector using "simple" parts?
« Reply #5 on: March 25, 2024, 08:40:30 am »
How accurate does it need to be?

If it's not critical, just use a transistor.

I designed this circuit for 200mA.  If you want 100mA, change R1 to 6R8 and replace the zener, R3 and RL with the relay coil and back-EMF diode.

https://www.eevblog.com/forum/beginners/how-to-detect-when-a-device-is-using-more-than-200ma/msg2991952/#msg2991952
 

Offline LinuxHataTopic starter

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: us
Re: Simple high side current detector using "simple" parts?
« Reply #6 on: March 26, 2024, 05:58:56 am »
Thanks a lot, but why so many parts?
I guess, one PNP transistor, one resistor and one relay should be enough?
I do not need precise measurements, I need to detect load current when it is above 100mA (it can go up to 1A) and voltage drop is not important that all, because it will go to buck converter afterwards anyways.
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1417
  • Country: us
  • Very dangerous - may attack at any time
Re: Simple high side current detector using "simple" parts?
« Reply #7 on: March 26, 2024, 07:15:12 am »
.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: Simple high side current detector using "simple" parts?
« Reply #8 on: March 26, 2024, 08:31:25 am »
Thanks a lot, but why so many parts?
I guess, one PNP transistor, one resistor and one relay should be enough?
I do not need precise measurements, I need to detect load current when it is above 100mA (it can go up to 1A) and voltage drop is not important that all, because it will go to buck converter afterwards anyways.
No, because another resistor is required to limit the base current and a back-EMF diode is required to protect the transistor.

If you really want simple and voltage drop isn't an issue, then use oPossum's circuit, without D1.


EDIT:
Because the load current can go up to 1A, R1 will dissipate 4.7W and will need to be quite big. My advice is to put a diode across it, as per oPossum's original circuit, which will reduce the power dissipation in the resistor, so an ordinary 1/4W unit can be used. The extra cost and space required by the diode is less, than a larger resistor.

« Last Edit: March 26, 2024, 09:01:42 am by Zero999 »
 

Online AndersJ

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: se
Re: Simple high side current detector using "simple" parts?
« Reply #9 on: March 26, 2024, 11:24:22 am »
How likely is it that
D1 forward voltage is slightly less than PNP Vbe
thus preventing the PNP from turning on?
"It should work"
R.N.Naidoo
 


Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Simple high side current detector using "simple" parts?
« Reply #11 on: March 26, 2024, 01:17:54 pm »
How likely is it that
D1 forward voltage is slightly less than PNP Vbe
thus preventing the PNP from turning on?

Relay might have to be low current to do it quite that way, but rectifier voltage drop is consistently high relative to BJTs, particularly BJTs at low currents (~uA) so it's believable, or close.  I would consider 1N4004 an intentional design element, not incidental, and would encourage testing it (including over temperature range..) before putting it down in production.  A second BJT stage might be desirable, particularly if one only has rectifiers of lower Vf.

As it happens, rectifiers are made well over ratings; probably 99% or more of the time, if you see a datasheet where all parts in a series are specified with one or two classes of limits (typically Vf, Ir, Cj), they're using the same (max rating plus safety factor) part to cover each class.  1N4001-7 are specified in one class and you will see "1N4001"s break down at 1300V or so.  When two classes are used, it's typically the <=600 and 800-1kV ratings, and the upper range typically breaks down at 1500-1800V.

This is partly no accident, as diffused junctions are pervasive (as you can more or less determine from the Cj(Vr) curve), and diffusion is notoriously difficult to control; but that alone doesn't explain the lack of low-voltage parts.  It just happens that, making diffused rectifiers, and making them robust enough that people don't complain (probably?), and the thinner junction / lower built-in potential just doesn't save that much -- a hundred millivolts here or there.  Hence, Vf doesn't vary much between parts, and clusters high relative to a signal BJT's Vbe.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7391
  • Country: nl
  • Current job: ATEX product design
Re: Simple high side current detector using "simple" parts?
« Reply #12 on: March 26, 2024, 01:24:03 pm »
If you have a MCU with an ADC that has a selectable high gain option, (Some AVR's have 200x)
You can put a voltage divider each side of the high side Isense resistor to bring it down to around 2.5V.

Then you can make a crude high side current sense by putting the ADC into differential mode between two ADC pins and using the 200x gain.

All you need is the Isense resistor, 4 resistors, plus maybe two TVS diodes for input protection.
You will need to zero cal each unit, as the voltage divider resistor tolerance will add quite a bit of unit to unit variation.  Or have a trim-pot
Or, you know, just select the part for example the one that was linked from ST, and place a sot23 package, and maybe select two resistors. I mean sure use an arduino, when a INA391 has everything except relay driving, and the shunt integrated in it for 23 cents.
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1417
  • Country: us
  • Very dangerous - may attack at any time
Re: Simple high side current detector using "simple" parts?
« Reply #13 on: March 26, 2024, 01:34:29 pm »
Specifying a 1N4004 was intentional and the circuit is quite marginal. R2 should probably be lower ~100 ohms. A 'sensitive coil' relay is assumed.

A bonus feature is that with enough current draw D1 will heat up, Vf will drop, and the relay may turn off.

The circuit can be simplified by removing D1 & R2, and using a power PNP with sufficient BE current rating. Fewer parts, but higher cost.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Simple high side current detector using "simple" parts?
« Reply #14 on: March 26, 2024, 04:58:16 pm »

Off the shelf parts are generally the simplest and cheapest solutions. As the man says, why build what you can buy?
eg BQ24300DSGT for $1 with active load disconnect. You can use the open drain flag to switch a relay- what's not to love?
And never rely on code to protect your precious parts.
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Simple high side current detector using "simple" parts?
« Reply #15 on: March 26, 2024, 06:21:21 pm »
I've designed discrete and opamp-based high-side current sense circuits, some coupled to a foldback current-limit circuit, but if you want simple and useful take a look at parts like this one:
https://www.diodes.com/assets/Datasheets/ZXCT1107_10.pdf.  Three pins, two external resistors, inexpensive.  Decent linearity and temperature stability (not lab-grade, but still quite useful).

Here's another one worth considering: https://www.ti.com/lit/ds/symlink/ina180.pdf?ts=1711412276012.  Different design, slightly better specs, but still cheap and easy.

I do use software sensing using an A to D, but you can always use a comparator to trigger your fault response.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: Picuino

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: Simple high side current detector using "simple" parts?
« Reply #16 on: March 26, 2024, 11:06:28 pm »
Current sense amplifiers are good, but you still need a voltage reference and comparator to switch on the relay.

I remembered why I put the zener in the circuit now. It's not just to reduce the voltage loss but it also solves the problem of the diode having a lower voltage drop than the base-emitter, which could happen, if it's hot.

Here's my circuit modified for 100mA and to drive a relay. Rout is just a load switched by the relay and is just for simulation.
« Last Edit: March 26, 2024, 11:08:07 pm by Zero999 »
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1327
  • Country: ca
Re: Simple high side current detector using "simple" parts?
« Reply #17 on: March 27, 2024, 01:12:58 am »
The absolute simplest is to wind a current sense coil around a reed switch. Choose a wire gauge and number of turns so it operates as required.
 
The following users thanked this post: Ian.M

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1440
Re: Simple high side current detector using "simple" parts?
« Reply #18 on: March 27, 2024, 07:07:19 am »
Hello.
I have a simple task - there is a load connected to the 12V line.
I have to detect whenever consumed current exceeds 100mA and turn on small reed relay.
It MUST be high side current detector - no insertion into ground path allowed.

I've read a lot about high side current sensing but most of these are for precise and linear current measurements, so involve special, rail-to-rail opamps, voltage references and so on, none of which I need.

So maybe there's simpler, crude solution to my issue?

A voltage drop will reduce the efficiency of circuit, something to keep in mind.  It could drop as much as 10 percent.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: Simple high side current detector using "simple" parts?
« Reply #19 on: March 27, 2024, 08:07:52 am »
The absolute simplest is to wind a current sense coil around a reed switch. Choose a wire gauge and number of turns so it operates as required.
That's good in theory, but you might struggle with power dissipation to get it so it triggers at 100mA and can operate up to 1A.  It's definitely worth trying though.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12862
Re: Simple high side current detector using "simple" parts?
« Reply #20 on: March 27, 2024, 10:28:04 am »
Here's a low burden voltage (0.1V @1A) four transistor circuit that triggers at a little under 100mA (with hysteresis).  Q1,Q2 should be matched and thermally coupled.  Q3 is the comparator.  Replace R6,R7 with a 2K pot with 2K endstop resistors if you want an adjustable threshold.  R5 sets the hysteresis.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: Simple high side current detector using "simple" parts?
« Reply #21 on: March 27, 2024, 07:44:15 pm »
Another way is a plain old comparator and reference, with potential dividers to both reduce the reference voltage and keep the inputs within the common mode range. The LM311 is good because it can directly drive a small relay. I didn't go for as lower voltage drop because the offset voltage of the comparator and resistor tolerances could be problematic. A better comparator and precision resistors would allow for a much lower drop, but at increase cost.

Anyway, the original poster won't the last two ideas because they use too many parts.

« Last Edit: April 04, 2024, 07:19:30 am by Zero999 »
 

Offline LinuxHataTopic starter

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: us
Re: Simple high side current detector using "simple" parts?
« Reply #22 on: April 04, 2024, 04:46:40 am »
Thanks everyone!
I need this as "one time" solution, which will be used only once.
So looking for something simple, which can be done with thru-hole components
without SMD and custom PCB ordering.

I've bought ACS712 module for 5A current measurement, but output voltage swing at 1A load is about 0.2 volts. I don't think that this can be reliably converted into relay output with simple transistor, without comparator, right?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: Simple high side current detector using "simple" parts?
« Reply #23 on: April 04, 2024, 07:30:56 am »
Yes, you need a comparator, but I don't see how a few resistors, a diode and a relay is that complex. They're all available as through hole parts. If you need it to trip at 100mA, with the ACS712, you'll also probably need a trimmer potentiometer.

The nice thing about the LM311 is it can sink up to 50mA, which means it can easily drive a relay, without another transistor.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9953
  • Country: nz
Re: Simple high side current detector using "simple" parts?
« Reply #24 on: April 04, 2024, 11:28:16 am »
Hello.
I have a simple task - there is a load connected to the 12V line.
I have to detect whenever consumed current exceeds 100mA and turn on small reed relay.
It MUST be high side current detector - no insertion into ground path allowed.

I've read a lot about high side current sensing but most of these are for precise and linear current measurements, so involve special, rail-to-rail opamps, voltage references and so on, none of which I need.

So maybe there's simpler, crude solution to my issue?

Do you want something simples as in fewest individual components?
Or simple as in cheap
Or simple as in using simple parts.

There is probably a single IC solution for this (high side driver IC) which would just need a single external resistor to set its current trip threshold to 100mA. And if it has a status pin that goes high on error, or an open collector fault pin,  you could drive the reed relay from that.
« Last Edit: April 04, 2024, 11:39:27 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf