Help with circuit to turn relay on above a certain current - Page 1
Forum section: electronics / projects

author: badgerthing
author_rank: Contributor
timestamp: April 15, 2021, 05:20:37 am
content: HelloI am wanting to design a circuit that switches on a relay when a measured current goes above 50-200 mA.A 0.05 ohm shunt has allowable voltage dropI could use INA180A3 or A4 IC as high-side current sense amp.The important bits:- switch the relay on right away when the current is detected. Less than 300ms probably fine.- don't switch the relay off immediately when measured current stops. 5-30 seconds delay is fine.A little hard to prototype as I don't have all the components, but I know what the INA180A3 will be outputting with certain current across the shunt, and I have transistors and passives so I can still prototype somewhat.Perhaps a 555 timer would make things easier tbhCurrent sketch:

author: badgerthing
author_rank: Contributor
timestamp: April 15, 2021, 06:42:41 am
content: Just tested this circuit (using a buffered potentiometer instead of INA180A2).It works, except for one deficiency I'm not sure how to fix.What I want: when load current is removed, I'd want the timer to then keep the relay on for a few seconds.What I get: when load current is removed, the timer will only keep the relay on for whatever time is remaining, since it only looks at the trigger pin whenever the timer runs out. I'd like the timer to only commence once load current is removed.

author: ledtester
author_rank: Super Contributor
timestamp: April 15, 2021, 06:59:36 am
content: Is there a reason you cannot use a grounded shunt (i.e. low-side current measurement)? It could simplify the circuit.To detect when the threshold current has been reached it might be necessary to incorporate a comparator (or use an op-amp as a comparator) to generate a clean logic-level signal.QuoteTo keep the relay energized 5-30 seconds after the threshold current stops you want to use some form of a "retriggerable monostable multivibrator". There are a lot of ways to construct them including using a 555. This article goes over what they are and gives solutions using common logic ICs:http://www.n5dux.com/ham/files/pdf/Working%20With%20Monostable%20Multivibrators.pdfAlternatively you might find it easier to incorporate a microcontroller into your design to handle the timing logic.

author: ledtester
author_rank: Super Contributor
timestamp: April 15, 2021, 07:20:50 am
content: I just had an idea... maybe something like this would work to extend the detection pulse...If the input to the diode is a logic 1 the cap will quickly fill up. If it is a logic 0 it will discharge through the resistor on the order of RC seconds keeping the MOSFET on for a while.Update:This thread discusses "pulse stretcher" circuits:https://eevblog.com/forum/beginners/pulse-extender-circuit/

author: badgerthing
author_rank: Contributor
timestamp: April 15, 2021, 07:39:21 am
content: Quote from: ledtester on April 15, 2021, 07:20:50 amDid you see the schematic in the original post? I already devised the pulse stretcher circuit myself (didn't know it was called that however).It may just work, but will depend on the exact specs of the relay (the turn-off voltage and such). I don't have the relay on hand yet.I certainly won't use a microcontroller in this circuit. I won't learn much doing that.I'll investigate the "retriggerable" 555 circuit. That sounds exactly what I need, thanks!

author: badgerthing
author_rank: Contributor
timestamp: April 15, 2021, 08:20:46 am
content: Oh and yes I can use low-side current shunt.Currently investigating using the cheaper LM393 instead of INA180*, although I can't really make the shunt larger than 0.05 ohms (lower would be nice). This means the LM393 needs to trigger around 10mV which seems doable with the 3mV offset (I haven't used op-amps much). INA180* has 0.15mV offset.I've almost certainly come-a-gutsa somewhere, but here's the LM393 idea.

author: Ian.M
author_rank: Super Contributor
timestamp: April 15, 2021, 09:05:32 am
content: Simples!Add another transistor (+ base resistor) to pull down the Discharge pin while the comparator output is high. That will hold (extend) the timing while the comparator output is high. For reliability, you should probably also add a 47R resistor between Discharge and the timing cap to limit the maximum discharge current.

author: Ian.M
author_rank: Super Contributor
timestamp: April 15, 2021, 09:55:52 am
content: Quote from: badgerthing on April 15, 2021, 08:20:46 amIMHO you need to amplify the voltage from the current shunt before comparing it with your threshold voltage. A precision OPAMP configured as a differential amplifier with a gain of 100, with its inputs from directly across the shunt, (or better yet from the sense terminals of a four terminal shunt), would make life a lot easier as you'd then get a far more reasonable 0.5V per 100mA to compare against your threshold voltage.If you are using a low-side shunt just about any cheap OPAMP that has an input offset voltage under 1mV, common mode input range including its negative rail and that will run from 5V single supply will do. Use 1% or better resistors for the differential amplifier - you don't need to match them more precisely for a low side shunt application as the common mode voltage is very small.Use a dual OPAMP and use the other half as the comparator.