Simple high side current detector using "simple" parts? - Page 1
Forum section: electronics / beginners

author: LinuxHata
author_rank: Frequent Contributor
timestamp: March 25, 2024, 07:07:58 am
content: 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?

author: CosteC
author_rank: Regular Contributor
timestamp: March 25, 2024, 08:14:41 am
content: "SIMPLE" is very imprecise termIs this IC simple:https://www.st.com/en/amplifiers-and-comparators/tsc1031.html?There is whole familyhttps://www.st.com/en/amplifiers-and-comparators/current-sensing/products.htmlOf 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.

author: ArdWar
author_rank: Frequent Contributor
timestamp: March 25, 2024, 08:26:52 am
content: 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.

author: bookaboo
author_rank: Frequent Contributor
timestamp: March 25, 2024, 08:30:52 am
content: If you don't mind some coding.......https://learn.adafruit.com/adafruit-ina219-current-sensor-breakout/wiringA discrete solution with a few opamps is possible and probably optimal, but ironically the arduino is more user friendly, samples and documentation.

author: Psi
author_rank: Super Contributor
timestamp: March 25, 2024, 08:35:26 am
content: 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

author: Zero999
author_rank: Super Contributor
timestamp: March 25, 2024, 08:40:30 am
content: 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

author: LinuxHata
author_rank: Frequent Contributor
timestamp: March 26, 2024, 05:58:56 am
content: 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.

author: oPossum
author_rank: Super Contributor
timestamp: March 26, 2024, 07:15:12 am
content: .

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2024, 08:31:25 am
content: Quote from: LinuxHata on March 26, 2024, 05:58:56 amNo, 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 ordinary1/4W unit can be used. The extra cost and space required by the diode is less, than a larger resistor.

author: AndersJ
author_rank: Frequent Contributor
timestamp: March 26, 2024, 11:24:22 am
content: How likely is it thatD1 forward voltage is slightly less than PNP Vbethus preventing the PNP from turning on?

author: Picuino
author_rank: Super Contributor
timestamp: March 26, 2024, 01:05:25 pm
content: https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWcMBMcUHYMGZIA4UA2ATmIxAUgpABZsKBTAWjDACgA3EJ7FEXqjz7FCUMTSpg+VGdARsA7t14gRIPFTWQ2AJ3WbRYDKK1RoKReGOrD1qXii79-NM5QSxaeJaMnR2bD9HJSEXKg0wxwAXcBQHMBoaK0NEsRZ1aAIMGgT3DClfUSYYBEJIQgkMYmwEBGwwWuQqABMGADMAQwBXABsothj7cFSIhKTBCEESjRJ6mjI8MGIwQni4EFbO3v6lCLVRuODY+NSh3yOz61HrbV3JK8kyxwBLfkDkt-9XWXY7yPOBI49ADXOd3DImnAfNZAQEvjJLBFwc5zrcPsiUO4QBi2ABnT4fOE2MRUTo9XEMPG0FYfHJBSQgMkUyxEwF0yLaV7s87swGyYgs95qdlaaGiZHnFYIoAYou can use the output voltage to activate a buffer.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 26, 2024, 01:17:54 pm
content: Quote from: AndersJ on March 26, 2024, 11:24:22 amRelay 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

author: tszaboo
author_rank: Super Contributor
timestamp: March 26, 2024, 01:24:03 pm
content: Quote from: Psi on March 25, 2024, 08:35:26 amOr, 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.

author: oPossum
author_rank: Super Contributor
timestamp: March 26, 2024, 01:34:29 pm
content: 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.

author: Terry Bites
author_rank: Super Contributor
timestamp: March 26, 2024, 04:58:16 pm
content: 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.

author: fourfathom
author_rank: Super Contributor
timestamp: March 26, 2024, 06:21:21 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2024, 11:06:28 pm
content: 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.

author: Kim Christensen
author_rank: Super Contributor
timestamp: March 27, 2024, 01:12:58 am
content: 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.

author: MrAl
author_rank: Super Contributor
timestamp: March 27, 2024, 07:07:19 am
content: Quote from: LinuxHata on March 25, 2024, 07:07:58 amA voltage drop will reduce the efficiency of circuit, something to keep in mind. It could drop as much as 10 percent.

author: Zero999
author_rank: Super Contributor
timestamp: March 27, 2024, 08:07:52 am
content: Quote from: Kim Christensen on March 27, 2024, 01:12:58 amThat'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.

author: Ian.M
author_rank: Super Contributor
timestamp: March 27, 2024, 10:28:04 am
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 27, 2024, 07:44:15 pm
content: 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.

author: LinuxHata
author_rank: Frequent Contributor
timestamp: April 04, 2024, 04:46:40 am
content: 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 componentswithout 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?

author: Zero999
author_rank: Super Contributor
timestamp: April 04, 2024, 07:30:56 am
content: 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.

author: Psi
author_rank: Super Contributor
timestamp: April 04, 2024, 11:28:16 am
content: Quote from: LinuxHata on March 25, 2024, 07:07:58 amDo you want something simples as in fewest individual components?Or simple as in cheapOr 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.

author: John B
author_rank: Frequent Contributor
timestamp: April 04, 2024, 07:44:57 pm
content: I just used a ZXCT1009 in a design, with pretty similar requirements. Between 50-500mA current sensing, doesn't need to be very precise.It's a SOT23 device which will output a current proportional to the voltage developed across a sense resistor, in this case it will be a 0.1 ohm sense resistor. The benefits of an integrated device are things like bandwidth, linearity and dynamic range.That output current then develops a voltage across a resistor to ground, in this case you might use it with a comparator with hysteresis to trigger your 100mA threshold