RC circuits relay delayed slightly, perhaps 0.05 seconds

Ian0

Joined Aug 7, 2020
9,816
I wish it were that simple. The solenoid is a latching solenoid and takes a pulse to turn the valve on and another pulse of opposite polarity to turn it off. That way only a short pulse is needed and allows the sprinkler valve to use a battery operated timer to operate the valve. I have the timer, but I don't want to use that to get more control over when the valve opens and closes. With 2 x 9V batteries they will last up to 2 years so it's not a lot of amps. Thanks,
It IS that simple.
state 1: output is low capacitor is discharged. Valve is closed. No current flows.
output goes high. Current flows through solenoid latching it in the OPEN position, capacitor charges. Current stops flowing when capacitor is charged.
state 2: output is high, capacitor is charged. Valve is open. No current flows.
output goes low. Current flows from capacitor through solenoid, latching it in the CLOSED position. Current stops flowing when capacitor is discharged.
back to state 1.
 
Last edited:

Thread Starter

billrvolz

Joined Jul 20, 2021
34
It IS that simple.
state 1: output is low capacitor is discharged. Valve is closed. No current flows.
output goes high. Current flows through solenoid latching it in the OPEN position, capacitor charges. Current stops flowing when capacitor is charged.
state 2: output is high, capacitor is charged. Valve is open. No current flows.
output goes low. Current flows from capacitor through solenoid, latching it in the CLOSED position. Current stops flowing when capacitor is discharged.
back to state 1.
Thanks. I'll give it a try. Parts on order. A couple of questions. How do you know that's the right size for the capacitor? Also why doesn't the supply voltage higher than the rated voltage of the solenoid matter?
 

eetech00

Joined Jun 8, 2013
3,951
It IS that simple.
state 1: output is low capacitor is discharged. Valve is closed. No current flows.
output goes high. Current flows through solenoid latching it in the OPEN position, capacitor charges. Current stops flowing when capacitor is charged.
state 2: output is high, capacitor is charged. Valve is open. No current flows.
output goes low. Current flows from capacitor through solenoid, latching it in the CLOSED position. Current stops flowing when capacitor is discharged.
back to state 1.
The spec states a maximum coil voltage of 9vdc.

The only other issue is that the input has to be held high or low to prevent a change of state at the output.

So...the following issue will still exist:

"One issue with this design is if the valve is open and the controller reboots it loses the state of the valve. "
 

Ian0

Joined Aug 7, 2020
9,816
The only issue is that the input has to be held high or low to prevent a change of state.

So...the following issue will still exist:

"One issue with the this design is if the valve is open and the controller reboots it loses the state of the valve. "
No - it will always open on a positive going edge and close on a negative going edge, so the state of the valve will always correspond to the state of the signal.
ANY magnetically latched solenoid should be expected to be in an unknown state after a reboot, unless it is fitted with auxiliary contacts, which I assume it isn't. The reboot circuit must supply an appropriate pulse to ensure it is in the correct state.
It does matter. At 12vdc it will be hit with about 2.5 amps each time and shorten the life of the solenoid or valve.
How is it going to shorten the life?
My calculations were based on the TS's measurement of 47Ω, but it only gets the energy in the capacitor 0.5*4700uF*(12V)^2 = 0.3 Joules. It will easily stand that once a second without overheating. It might even need a larger capacitor, that would have to be a matter for experiment.

I'm not sure whose figures to believe, as it would seem unlikely that a 4.8Ω solenoid could be powered by a 9V battery which I would assume to be a PP3 (too many assumptions and too few facts here)
 

eetech00

Joined Jun 8, 2013
3,951
No - it will always open on a positive going edge and close on a negative going edge, so the state of the valve will always correspond to the state of the signal.
No. the valve doesn't know the state of the signal.
The previous circuit didn't require a high or low at the input...just a pulse of short duration to change the state of the solenoid.

ANY magnetically latched solenoid should be expected to be in an unknown state after a reboot, unless it is fitted with auxiliary contacts, which I assume it isn't. The reboot circuit must supply an appropriate pulse to ensure it is in the correct state.
I know and agree. But for the benefit of the TS. Thanks.

How is it going to shorten the life?
If an excessive current is applied, that "extra current" is converted into "extra mechanical force". That force is transferred to the mechanical parts its interconnected with (the valve). And over time, can cause premature wear and tear.

My calculations were based on the TS's measurement of 47Ω, but it only gets the energy in the capacitor 0.5*4700uF*(12V)^2 = 0.3 Joules. It will easily stand that once a second without overheating. It might even need a larger capacitor, that would have to be a matter for experiment.

I'm not sure whose figures to believe, as it would seem unlikely that a 4.8Ω solenoid could be powered by a 9V battery which I would assume to be a PP3 (too many assumptions and too few facts here)
Well...the spec is from the solenoid manufacture "Hunter"and is for the PN that the TS supplied.
I don't know...Maybe the meter scale was misread (47ohms is oddly close to a mag 10 of 4.8 ohms). I guess we need to confirm.

Maybe you can configure two MCP1415 chips, one to drive each side of the selenoid coil (no output capacitors) , so that the output changes drive polarity based on the chip activated. Then the MCU could simply send a high short pulse to one or the other chip to control the state of the solenoid.
 
Last edited:

Ian0

Joined Aug 7, 2020
9,816
No. the valve doesn't know the state of the signal.
Yes it does - a positive-going edge generates a positive-going current in the solenoid. A negative-going edge generates a negative-going current in the solenoid.
Maybe the meter scale was misread (47ohms is oddly close to a mag 10 of 4.8 ohms)
I too suspect he missed the decimal point, but I'm still puzzled how the usual sort of 9V battery would manage
to drive 4.8Ω
Maybe you can configure two MCP1415 chips, one to drive each side of the selenoid coil (no output capacitors) , so that the output changes drive polarity based on the chip activated. Then the MCU could simply send a high short pulse to one or the other chip to control the state of the solenoid
I drive Albright magnetically latched contactors (which are too big to use a sensibly-sized capacitor) with a DRV8870/A4953, using this circuit.177F3862-F5AA-476F-97D2-D2D9E274A907.jpeg
The non-inverting Schmitt trigger is a 74LVC1G17. It will work without with 10k/47uF as it has to overcome a built-in pull-down on the IC.
Again, it pulses ON with a positive going edge, and off with a negative-going edge, the timing being independent from the microcontroller to avoid the possibility of leaving the solenoid powered up if the processor crashes.
MOSFET gate drivers are usable as half-bridge drivers up to a point - but as they tend to have a resistive output they're not so good at high currents, apart from driving MOSFET gates
 
Last edited:

Thread Starter

billrvolz

Joined Jul 20, 2021
34
I too suspect he missed the decimal point, but I'm still puzzled how the usual sort of 9V battery would manage
to drive 4.8Ω
The 47 ohms comes from a measure that's likely off. At the time, I used my DMM to measure the current when the Hunter timer triggered the valve. It's a quick pulse of under 0.2 seconds and I saw the DMM read about .19 amp. With the sample rate of the DMM and the quick rise and fall of the current it's very possibly off. The battery being 9V then .19/9 = 47. I made the amp measure several times and I got readings between 0.18 and 0.21 but only for a fraction of a second.

Would my DMM be able to measure the resistance considering the induction effects from the coil of the solenoid? I'll measure the resistance today. I have triggered the valve by simply connecting the leads to a 9V battery. I could measure the steady state voltage and current by holding the contacts on the solenoid for a few seconds. I just don't want to burn out the solenoid - those things cost about $25.

Thanks
 

Ian0

Joined Aug 7, 2020
9,816
I have to commend @eetech00 on finding the datasheet, because I couldn't.
My first circuit will probably need a ridiculous amount of capacitance to work, so I would recommend the second (at the end of post #27)
The solenoid is designed to operate at about 2A, so I'd recommend the Texas DRV8870 rather than the Allegro A4953.
The sense resistor which I drew as 0.47Ω should be 0.22Ω to give a maximum current of 2A.
 

eetech00

Joined Jun 8, 2013
3,951
Here is my suggestion using two push/pull drivers.
At power on, the solenoid should be manually set to the appropriate state (if necessary).

1627140717512.png
 

Ian0

Joined Aug 7, 2020
9,816
Here is my suggestion using two push/pull drivers.
At power on, the solenoid should be manually set to the appropriate state (if necessary).

View attachment 244298
The only snag with using the TC1412 is that its output resistance could be as much as 7Ω, and you have two in series. There could be 14Ω in series with the 4.8Ω solenoid, which would limit it to 2.29V. It was OK to use as a driver when we thought it was a 47Ω solenoid.
Also, there's no need to set it manually on power up. Just apply the "open" pulse. If it's already open nothing will happen, but if it is closed it will open.

You've used a lot more parts than my DRV8870/A4953 circuit!
 

eetech00

Joined Jun 8, 2013
3,951
The only snag with using the TC1412 is that its output resistance could be as much as 7Ω, and you have two in series. There could be 14Ω in series with the 4.8Ω solenoid, which would limit it to 2.29V. It was OK to use as a driver when we thought it was a 47Ω solenoid.
may not be a problem...but good point.

Also, there's no need to set it manually on power up. Just apply the "open" pulse. If it's already open nothing will happen, but if it is closed it will open.
I don't want it to do anything on power up. I want the operator to manually set. But see what TS wants.

You've used a lot more parts than my DRV8870/A4953 circuit!
Yes.
 

Thread Starter

billrvolz

Joined Jul 20, 2021
34
This getting way too complicated. This stuff is going to be in the middle of the woods at the end of a 3/4 mile rough gravel road on top of a water tank. I don't have the ability to make circuit boards and am uncomfortable with these components hanging around inside the enclosure.

All I wanted was a simple RC delay circuit.

I tried a 510 ohm resistor in series with a 1000 mf capacitor. It didn't delay anything. (control pulse -> resistor -> capacitor -> relay input). In fact there was no way to discharge the capacitor so eventually the relay would not turn on any longer.

Someone said to connect the relay input between the capacitor and the resistor. When I did that, the relay turned on right away but there was a delay when the relay turned off from after the pulse was removed.. I need the delay on the leading edge.

Fortunately I have a spare controller and relay here at the house so I can do some testing before putting out in the wild.

By the way, no one ever answered what to expect if you energized a solenoid coil (or any inductor I guess) and then suddenly reverse the polarity. What kind of transients would you expect? And is there anything that can be done to lessen them?

I do want to thank everyone that's contributed. It's been a learning experience for me, to say the least.
 

Thread Starter

billrvolz

Joined Jul 20, 2021
34
I drive Albright magnetically latched contactors (which are too big to use a sensibly-sized capacitor) with a DRV8870/A4953, using this circuit.177F3862-F5AA-476F-97D2-D2D9E274A907.jpeg
The non-inverting Schmitt trigger is a 74LVC1G17. It will work without with 10k/47uF as it has to overcome a built-in pull-down on the IC.
Again, it pulses ON with a positive going edge, and off with a negative-going edge, the timing being independent from the microcontroller to avoid the possibility of leaving the solenoid powered up if the processor crashes.
MOSFET gate drivers are usable as half-bridge drivers up to a point - but as they tend to have a resistive output they're not so good at high currents, apart from driving MOSFET gates
I assume the triangle is the Schmitt trigger. It appears to also have ground and V+ connected to it, right? You also mention a 10K/47uF combination but they are not shown on the diagram. I assume the control signal is coming in on the left and V+ is on pin 5 with ground along the bottom?
 

eetech00

Joined Jun 8, 2013
3,951
This getting way too complicated. This stuff is going to be in the middle of the woods at the end of a 3/4 mile rough gravel road on top of a water tank. I don't have the ability to make circuit boards and am uncomfortable with these components hanging around inside the enclosure.

All I wanted was a simple RC delay circuit.
This should have been stated in the first post....

Someone said to connect the relay input between the capacitor and the resistor. When I did that, the relay turned on right away but there was a delay when the relay turned off from after the pulse was removed.
yup...

I need the delay on the leading edge.
On the leading edge of what? clock signal? dc pulse? what?

By the way, no one ever answered what to expect if you energized a solenoid coil (or any inductor I guess) and then suddenly reverse the polarity. What kind of transients would you expect? And is there anything that can be done to lessen them?
There will be large voltage spike of opposing polarity call "Back EMF". It can inadvertently trigger, or damage, other parts of an electronic circuit. Diodes are usually used to supress EMF and are connect across the coil of a relay or solenoid. When a coil is controlled using a bi-polar signal (like a latching type relay or solenoid) four diodes are used. One diode from +V to +coil, and one from GND to -coil, on each terminal of the coil. Like This:

1627156816779.png
 

Thread Starter

billrvolz

Joined Jul 20, 2021
34
This should have been stated in the first post....



yup...



On the leading edge of what? clock signal? dc pulse? what?



There will be large voltage spike of opposing polarity call "Back EMF". It can inadvertently trigger, or damage, other parts of an electronic circuit. Diodes are usually used to supress EMF and are connect across the coil of a relay or solenoid. When a coil is controlled using a bi-polar signal (like a latching type relay or solenoid) four diodes are used. One diode from +V to +coil, and one from GND to -coil, on each terminal of the coil. Like This:

View attachment 244322
The leading edge of the DC pulse from the controller.

Would 1N4001 diodes work in the above?
 

Ian0

Joined Aug 7, 2020
9,816
I assume the triangle is the Schmitt trigger. It appears to also have ground and V+ connected to it, right? You also mention a 10K/47uF combination but they are not shown on the diagram. I assume the control signal is coming in on the left and V+ is on pin 5 with ground along the bottom?
You can either use 470k/1uF and the 74LVC1G17 schmitt trigger (as drawn) and yes, the 74LVC1g17 needs a 3.3V supply and ground;
or you can delete the schmitt trigger and use 10k instead of 470k, and 47u instead of 1u, connecting the junction of the 10k and 47u directly to pin 2.
 
Top