Author Topic: Help with circuit to turn relay on above a certain current  (Read 323 times)

0 Members and 1 Guest are viewing this topic.

Offline badgerthing

  • Contributor
  • Posts: 46
  • Country: nz
Help with circuit to turn relay on above a certain current
« on: April 15, 2021, 05:20:37 am »
Hello

I 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 drop
I 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 tbh

Current sketch:
« Last Edit: April 15, 2021, 05:27:40 am by badgerthing »
 

Offline badgerthing

  • Contributor
  • Posts: 46
  • Country: nz
Re: Help with circuit to turn relay on above a certain current
« Reply #1 on: April 15, 2021, 06:42:41 am »
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.
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: us
Re: Help with circuit to turn relay on above a certain current
« Reply #2 on: April 15, 2021, 06:59:36 am »
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.

Quote
don't switch the relay off immediately when measured current stops. 5-30 seconds delay is fine.

To 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.pdf

Alternatively you might find it easier to incorporate a microcontroller into your design to handle the timing logic.
 
The following users thanked this post: badgerthing

Online ledtester

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: us
Re: Help with circuit to turn relay on above a certain current
« Reply #3 on: April 15, 2021, 07:20:50 am »
I just had an idea... maybe something like this would work to extend the detection pulse...

[attach=1]

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/
« Last Edit: April 15, 2021, 07:32:08 am by ledtester »
 

Offline badgerthing

  • Contributor
  • Posts: 46
  • Country: nz
Re: Help with circuit to turn relay on above a certain current
« Reply #4 on: April 15, 2021, 07:39:21 am »
I just had an idea... maybe something like this would work to extend the detection pulse...

[attach=1]

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/

Did 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!
 

Offline badgerthing

  • Contributor
  • Posts: 46
  • Country: nz
Re: Help with circuit to turn relay on above a certain current
« Reply #5 on: April 15, 2021, 08:20:46 am »
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.
« Last Edit: April 15, 2021, 09:04:49 am by badgerthing »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 10104
Re: Help with circuit to turn relay on above a certain current
« Reply #6 on: April 15, 2021, 09:05:32 am »
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.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 10104
Re: Help with circuit to turn relay on above a certain current
« Reply #7 on: April 15, 2021, 09:55:52 am »
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.
IMHO 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf