Author Topic: How to delay a relay opening  (Read 2043 times)

0 Members and 1 Guest are viewing this topic.

Offline cods4Topic starter

  • Contributor
  • Posts: 11
  • Country: nz
How to delay a relay opening
« on: December 01, 2021, 10:53:53 pm »
I am making a simple battery isolation circuit for my race car. This will allow the battery to be connected/disconnected with a switch in the cabin, and it will also allow the battery to be isolated using a momentary switch on the outside of the car.

The attachment shows the circuit which I have copied from this forum post (https://forums.nasioc.com/forums/showthread.php?p=46666717)

I want to modify this circuit slightly to include a resistor which is switched in between 12V (Fusebox, Starter, Alternator) and Gnd when the battery is disconnected. This is to avoid causing a voltage spike and frying my ECU etc when the alternator is basically open circuited. Most off the shelf battery isolator switches include one of these (i.e https://www.motorsport-tools.com/genuine-autolec-fia-msa-battery-master-cut-off-switch-race-rally-motorsport.html).

My main concern is that I need this resistor to be switched into the circuit just before the Master relay (RY3) opens, but I don't think MBB relays exist in the automotive world. I am looking for a way to do this without using a microcontroller if possible.

My first thought is to add an inductor in series with the Master relay (RY3) coil. This would hopefully keep current flowing in the coil for an extra 10-20ms to allow another relay to switch the resistor in.

My question is, will an inductor do what I am hoping, and how do I go about sizing it?

The Master relay will a TE V23132A2001B200
The coil on this relay is 12V 39ohms and release voltage is 1.2V according to the datasheet.
 

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 3466
  • Country: us
Re: How to delay a relay opening
« Reply #1 on: December 01, 2021, 11:11:46 pm »
I have used a simple RC delay triggering a 2n7000 series mosfet.  There, of course, are more elegant ways to do that.
 

Offline cods4Topic starter

  • Contributor
  • Posts: 11
  • Country: nz
Re: How to delay a relay opening
« Reply #2 on: December 02, 2021, 12:53:20 am »
I think you've got me on the right track. I should be considering a capacitor in parallel with the relay coil (rather than an inductor in series). I just did some basic calculations and came up with a 2200uF capacitor which should keep the relay closed for an additional 50ms which should be plenty.

Basically I just worked out the number of J joules required which is 3.3W x 0.05s = 0.165J
And capacitance = 2E/V^2 = 2291uF
So a 2200uF 16V capacitor should do the job right? Or probably even a 1000uF cap since I only need it to work for about 10ms or so.
 

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 3466
  • Country: us
Re: How to delay a relay opening
« Reply #3 on: December 02, 2021, 07:31:12 am »
As you calculated, you will need a large capacitor to operate a relay for that length of time.  If you use a mosfet to control the relay and then control the mosfet with a capacitor and resistor on its gate, you can control the turn off  (or turn on) with a much smaller capacitor.  The gate of a mosfet is like a capacitor.  Considering an N-channel mosfet like the 2N7000, once charged it stays on until you drain that charge.  For example, a 0.47 uF capacitor and 100k resistor gives a time constant (RC) of 0.047s (47 ms).

Unfortunately that is not a snap action.  You can add additional components to get that, but you may not need it.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: How to delay a relay opening
« Reply #4 on: December 02, 2021, 01:48:19 pm »
The 2N7000 isn't rated to a high enough current for a 12V 39 Ohm relay, which will draw just over 300mA at 12V and nearly 360mA, when the engine is running and the voltage is nearer 14V. Use a higher current MOSFET such as the IRFZ44 or IRF540. Check the maximum gate-source voltage rating of the MOSFET. If it can't handle 16V, you will need to use a potential divider, to drop it to a safe level.

Don't forget to add a freewheeling diode in reverse parallel with the relay coil.

Note that the delay will be approximate, because the threshold voltage is extremely variable. A 555 timer circuit would give a much more consistent delay, but it's many more parts.
 

Offline GerryR

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: us
Re: How to delay a relay opening
« Reply #5 on: December 02, 2021, 05:05:53 pm »
I don't mean to spoil the fun of "rolling your own," but a simple Time Delay Relay like a Magnacraft 822TD-10H/UNI is programmable for various functions, including "off delay," and are not very expensive.  Just a thought.
Still learning; good judgment comes from experience, which comes from bad judgment!!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: How to delay a relay opening
« Reply #6 on: December 02, 2021, 05:57:21 pm »
According to my calcs using the discharge equation Vout = Vin * e-t/Tau, assuming a 13V input and a minimum 2V output, the delay until discharge to 2V with a 1000 ufd capacitor and 39 Ohm coil is 0.073 seconds = 73 ms.

Matlab code:

Code: [Select]
Vin = 13;                       % assume a supply voltage
R = 39;                         % relay resistance in Ohms
C = 1000*10^-6;                 % timing capacitor in Farads
Tau = R*C;                      % time constant Tau
t = linspace(0,3*Tau);          % graph from 0 to 3 Tau
Vout = Vin * (exp((-t/Tau)));   % discharge equation
plot(t,Vout)                    % plot the discharge curve
ylabel("Voltage")
xlabel("Time - seconds")
grid on
[h,~]=legend("Discharge Voltage");
figure(gcf) % or shg command - pull plot to top
t = - (Tau * log(2/Vin));
fprintf("Time voltage will remain above 2V => %.3g seconds\n",t)

% include results from Command Window
% Time voltage will remain above 2V => 0.073 seconds
%
[/font]


Graph attached...  You can see where the trace crosses 2V at a little over 70 ms.  The MATLAB code will also run in Octave which is free.

I would use a capacitor rated at least 25V if not 50V.

The only equation you really care about is "t = - (Tau * log(2/Vin))".  Calculate Tau as R (Ohms) * C (Farads), pick a dropout voltage (here it's 2V) and an input voltage Vin.  Assuming you have accounted for all the parallel load on the capacitor, this equation should work fine.

In the world of Octave and MATLAB, log(x) returns the Natural Logarithm which is usually ln(x) on a calculator.  The Common Logarithm (base 10) is log10(x).



« Last Edit: December 02, 2021, 09:46:52 pm by rstofer »
 

Offline cods4Topic starter

  • Contributor
  • Posts: 11
  • Country: nz
Re: How to delay a relay opening
« Reply #7 on: December 02, 2021, 07:24:28 pm »
I don't mean to spoil the fun of "rolling your own," but a simple Time Delay Relay like a Magnacraft 822TD-10H/UNI is programmable for various functions, including "off delay," and are not very expensive.  Just a thought.

True, however that relay isn't suited to vehicle use. Operating temperature is only up to 55C, and I doubt it would cope with the vibration etc.
 

Offline cods4Topic starter

  • Contributor
  • Posts: 11
  • Country: nz
Re: How to delay a relay opening
« Reply #8 on: December 02, 2021, 07:47:26 pm »
According to my calcs using the discharge equation Vout = Vin * e-t/Tau, assuming a 13V input and a minimum 2V output, the delay until discharge to 2V with a 1000 ufd capacitor and 39 Ohm coil is 0.073 seconds = 73 ms.

Matlab code:

Code: [Select]
Vin = 13;                       % assume a supply voltage
R = 39;                         % relay resistance in Ohms
C = 1000*10^-6;                 % timing capacitor in Farads
Tau = R*C;                      % time constant Tau
t = linspace(0,3*Tau);          % graph from 0 to 3 Tau
Vout = Vin * (exp((-t/Tau)));   % discharge equation
plot(t,Vout)                    % plot the discharge curve
ylabel("Voltage")
xlabel("Time - seconds")
grid on
[h,~]=legend("Discharge Voltage");
figure(gcf) % or shg command - pull plot to top
t = - (Tau * log(2/Vin));
fprintf("Time voltage will remain above 2V => %.3g seconds\n",t)

% include results from Command Window
Time voltage will remain above 2V => 0.073 seconds
%
[/font]


Graph attached...  You can see where the trace crosses 2V at a little over 70 ms.  The MATLAB code will also run in Octave which is free.

I would use a capacitor rated at least 25V if not 50V.

The only equation you really care about is "t = - (Tau * log(2/Vin))".  Calculate Tau as R (Ohms) * C (Farads), pick a dropout voltage (here it's 2V) and an input voltage Vin.  Assuming you have accounted for all the parallel load on the capacitor, this equation should work fine.

In the world of Octave and MATLAB, log(x) returns the Natural Logarithm which is usually ln(x) on a calculator.  The Common Logarithm (base 10) is log10(x).


Thanks very much for that, I haven't used MATLAB for many years, but it still makes sense.

Can I just ask why would I need such a large voltage rating on the cap? I was looking at 16V rated capacitors.
I was planning to use this: https://nz.mouser.com/ProductDetail/661-APSG160E182MJ20S
but since you suggest a higher voltage rating, would this be suitable? https://nz.mouser.com/ProductDetail/KEMET/PHA225KLP4110QE4?qs=iLbezkQI%252BsgOn6OnNZwgMw%3D%3D
It's fairly large, but I should be able to hide it away somewhere.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: How to delay a relay opening
« Reply #9 on: December 02, 2021, 08:56:20 pm »
It seems to me that an alternator charges to 13.8 volts but the output, according to the gauge on my dash, is often up near 15V when I haven't driven the truck and the battery is near discharged.  Clearly, that is too close to the maximum limit for a 16V capacitor.  We need to consider transients and I have no idea what the industry uses for a spec.

Here is a paper on Transient Voltage Suppressors (TVSs) for the automotive sector and they're talking about 87V spikes during a 'load dump' - where the alternator loses the battery.

I may stand corrected, perhaps 100V is a better design.

Pretty pricey at $4.19

https://www.digikey.com/en/products/detail/illinois-capacitor/108CKE100M/5410851

One thing to check: consider what happens when the 1000 ufd capacitor is actually -20% or 800 ufd.  I get 58 ms.  Then too, I made assumptions about the input voltage and the dropout voltage.  These will also affect the timing.

You may want to kick the capacitance up to, say, 1500 ufd @ 100V

https://www.digikey.com/en/products/detail/nichicon/LLS2A152MELZ/2548958
« Last Edit: December 02, 2021, 09:02:57 pm by rstofer »
 
The following users thanked this post: cods4

Offline cods4Topic starter

  • Contributor
  • Posts: 11
  • Country: nz
Re: How to delay a relay opening
« Reply #10 on: December 03, 2021, 12:39:44 am »
It seems to me that an alternator charges to 13.8 volts but the output, according to the gauge on my dash, is often up near 15V when I haven't driven the truck and the battery is near discharged.  Clearly, that is too close to the maximum limit for a 16V capacitor.  We need to consider transients and I have no idea what the industry uses for a spec.

Here is a paper on Transient Voltage Suppressors (TVSs) for the automotive sector and they're talking about 87V spikes during a 'load dump' - where the alternator loses the battery.

I may stand corrected, perhaps 100V is a better design.

Pretty pricey at $4.19

https://www.digikey.com/en/products/detail/illinois-capacitor/108CKE100M/5410851

One thing to check: consider what happens when the 1000 ufd capacitor is actually -20% or 800 ufd.  I get 58 ms.  Then too, I made assumptions about the input voltage and the dropout voltage.  These will also affect the timing.

You may want to kick the capacitance up to, say, 1500 ufd @ 100V

https://www.digikey.com/en/products/detail/nichicon/LLS2A152MELZ/2548958

Hopefully my resistor will eliminate the 87V spike if it works as expected, otherwise ill have much bigger problems. I think I'll go for the 40V cap due to it's higher temperature tolerance and life expectancy. I'm grabbing two, so worst case if they read low, I can install them both in parallel.

Thanks for your help
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf