# Can this scheme be used to control multiple solenoids

1. ## Can this scheme be used to control multiple solenoids

I need to control eight solenoid-valves for water drainage outdoors remotely and simultaneously. The valves are normally closed (NC) type which I guess in that context means they open and let the water drain only when they receive ON signal at their input.

Here is the exact model and the datasheet for the solenoid valves. The datasheet says the relay is 4.5W and I guess passes around max 400mA in steady state. Since I don't know the the inductance of the coils, I thought it wouldn't be more than 10uH.

The idea is to keep the 12V power supply and the controller(Arduino in this case) indoors and send the power and the control signal 25m far away to the optocoupler and then to a MOSFET which drives the solenoids.

Here is what I came up with so far:

Since I don't want false triggering I decided to use an optocoupler 4n25 at the far end. This both isolates the ground of the 12V power supply and prevents coupling noise.

If I use a coaxial cable, it has like 80pF/m. So for worst case I assumed the total parasitic capacitance of the cable Cp all the way down is around 10 nF. I also assumed Arduino rising and falling edges as 100ns.

Zener and the flyback diodes are for taking care of inductive kicks fast. This is based in what I saw in some examples.

I found the MOSFET IRF530 suitable for such application current and powerwise.

And here is simulation results for power current and the voltage for the MOSFET:

According to the datasheet Maximum Power Dissipation is given as 88W at 25°C. The peak in my simulation shows max 10W.

And here is the zoomed view of the power during a switch transition:

There is parameter called Maximum Safe Operating Area but I don't know how to relate it to this scenario and plots.

I have made many assumptions such as Arduino digital output rise fall time 100ns; total cable capacitance as 10nF; solenoid LR as 10uH and 30 Ohm.

If these assumptions are reasonable can we say that this MOSFET can handle this application? Is there any fundamental issue with this schematics?

2. ## Re: Can this scheme be used to control multiple solenoids

You don't really need D2 but if the solenoids are widely spaced it would be advisable to connect a diode (like D1) across each individually. If the diode is close to the inductance of the solenoid it will create a short loop for the back-EMF as it switches off. If you use just one diode, there is a risk of spikes radiating from the longer wiring. I think I would add a capacitor across the 12V supply at the solenoid end to help it stay stable as the load changes, maybe 100uF or so. Otherwise it looks OK.

Brian.

3. ## Re: Can this scheme be used to control multiple solenoids

Expect millisecond RL time constant for solenoid valves, respectively 30 to 300 mH coil inductance.

•

4. ## Re: Can this scheme be used to control multiple solenoids

Hi,

The expected 10uH is far too low.
I won't be surprised if it's in the low Henry region.

Klaus

5. ## Re: Can this scheme be used to control multiple solenoids

Okay I increased the solenoid inductances to 300mH.

I CAN take the 12VDC to far end. I added diodes for all and 100uF cap across the power supply.

I also added a buffer to ease the microcontroller digital output pins. Each pin will control a set of 8 solenoids.

What do you think about this scheme now:

And here is the new MOSFET power during switching:

Do you think this is a better scheme? And does the MOSFET need heatsink?

•

6. ## Re: Can this scheme be used to control multiple solenoids

I also added a buffer to ease the microcontroller digital output pins. Each pin will control a set of 8 solenoids.
I could see that the out pin drives only one opto coupler; but why do you need the buffer?

You need a latch or a hysteresis circuit because (i) it is imp to prevent the relays from chattering (ii) and a way for the micro to know the current state of the relay.

7. ## Re: Can this scheme be used to control multiple solenoids

Originally Posted by c_mitra
I could see that the out pin drives only one optocoupler; but why do you need the buffer?

You need a latch or a hysteresis circuit because (i) it is imp to prevent the relays from chattering (ii) and a way for the micro to know the current state of the relay.
Here my last schematics for now:

I set the inductance to more realistic one 300mH. I checked the temperature and it doesn't even need heatsink if the sim is correct. I changed the diodes to 1n001 because 1n4148 was a bit too low power. For stability 100uF cap is added across power supply. And finally one flyback diode for each solenoid.

Arduino's each one of the eight pins will drive one set of relays. Each set of relays composed of 8 solenoids as you see in my schematics(so in total there are 64 solenoid valves). Each set will be controlled by one digital output. The reason for opto is to prevent noise. If I use the 4N24 without buffer it will drive 10mA and if all 8 pins are loaded 10mA I thought I might need to ease the micro by a buffer.

Do you think the buffer is not necessary?

Why is hysteresis needed? You mean should I use a comparator right after the micro output before the opto?

8. ## Re: Can this scheme be used to control multiple solenoids

1. One micro out pin can happily drive one LED: i guess opto can run even at 5mA. The out pin of the micro does not care what happens after the opto...

2. The opto-coupler provides isolation but not much of a noise immunity. I would have put the opto closer to the micro because the micro side of the opto is the low voltage, noise sensitive, high imped comp. On the right side of the opto the volt and curr are high and imped is low and noise sensitivity is low. But exerts can disagree...

3. Suppose the software on the micro gives some error (hypothetical) and the relay is pulsed 10 times a second; within 10 sec, all the relays can go bad (coils burned) but it will be good to see that the relays are not turned on/off within 1 sec.

4. After a warm boot, the micro should know whether the relays are on or off. As you have too many of them, it is good to know the status of the driver FET. You may need another opto but that may an wise investment. It is good to know whether the FET is on or off.

5. A good driver circuit will act like a toggle; one pulse to turn off and next one to turn on. Two pulses within 1 sec and the sec pulse is ignored. Another pin tells whether the driver FET is on or off.

9. ## Re: Can this scheme be used to control multiple solenoids

Originally Posted by betwixt
You don't really need D2 but if the solenoids are widely spaced it would be advisable to connect a diode (like D1) across each individually. If the diode is close to the inductance of the solenoid it will create a short loop for the back-EMF as it switches off. If you use just one diode, there is a risk of spikes radiating from the longer wiring. I think I would add a capacitor across the 12V supply at the solenoid end to help it stay stable as the load changes, maybe 100uF or so. Otherwise it looks OK.

Brian.

Here is my last schematics:

I set the inductance to more realistic one 300mH. I checked the temperature and it doesn't even need heatsink if the simulation is correct. I changed the diodes to 1N4001 because the 1N4148 was a bit too low power.

For stability, 100uF electrolytic cap is added across power supply . And finally one flyback diode for each solenoid.

I would be glad to hear your comment.
Do I need a hysteresis for this application?

- - - Updated - - -

Originally Posted by c_mitra
1. One micro out pin can happily drive one LED: i guess opto can run even at 5mA. The out pin of the micro does not care what happens after the opto...

2. The opto-coupler provides isolation but not much of a noise immunity. I would have put the opto closer to the micro because the micro side of the opto is the low voltage, noise sensitive, high imped comp. On the right side of the opto the volt and curr are high and imped is low and noise sensitivity is low. But exerts can disagree...

3. Suppose the software on the micro gives some error (hypothetical) and the relay is pulsed 10 times a second; within 10 sec, all the relays can go bad (coils burned) but it will be good to see that the relays are not turned on/off within 1 sec.

4. After a warm boot, the micro should know whether the relays are on or off. As you have too many of them, it is good to know the status of the driver FET. You may need another opto but that may an wise investment. It is good to know whether the FET is on or off.

5. A good driver circuit will act like a toggle; one pulse to turn off and next one to turn on. Two pulses within 1 sec and the sec pulse is ignored. Another pin tells whether the driver FET is on or off.

I think opto at far end is better for long cables.

And such 10 pulse per second is nor issue in my application I tested even 100 pulse per second in simulation and both the MOSFET temperature and the relay was fine.

I agree to get the situation of relays but in my case I think I will not go for that.

•

10. ## Re: Can this scheme be used to control multiple solenoids

I smell over-engineering.

You need a single fly-back diode near MOSFET and bypass capacitor. You want to protect the MOSFET, not the solenoid valves. As an alternative to bypass capacitor, a TVS diode across the supply could absorb overvoltage produced by the cable inductance.

Hysteresis avoids switching losses with slow control voltage edges. The MOSFET has however some thermal capacitance so that it's probably not required under usual conditions.

In some cases, shorted solenoid cables or shorted coils may be a possible scenario. If so, you should consider either a fuse or a fully protected smart switch.

11. ## Re: Can this scheme be used to control multiple solenoids

Hi,

some calculations:

4.5W at 12V gives 375mA.
375mA x 8 valves gives 3.0A of current.

Letīs accept a 1V drop on the wiring over the 25m.
This means R_wiring = V_drop / current = 1V / 3A = 0.333 Ohms

1m of copper wire with 1mm^2 is about 1/56 Ohms.
A = 2 x 25m / ( 0,33 Ohms x 56) = 2.7 mm^2

--> use a 2 x 4 mm^2 cable.

*****
Power dissipation.
Your chart shows about 40W peak.
But for your swithcing time (about 40us) the average power is about 10W.
Now if you switch ON 100 times per second you may expect 2 x 100Hz x 10W x 40us = 80mW average switching power dissipation. For this you donīt need a heatsink.

From the SOA chart you can see that the MOSFET can withstand 50A x 50V which is 2500W for a 100us signle pulse.
The given 88W maximum power is not the peak power for a short time, but the maximum continous power dissipation.
And with 80mW average power dissipation you can almost see the 100Hz switching pulse like a single pulse. (At least with your peak power dissipation).

*****
Independent if you use the switch close to the valves or close to the microcontroller. (when we consider 100 duty cycle)
Thus - for ease of installation - I recommend to install the switch close to the microcontroller.

use a "logic level MOSFET", a series resistor to the gate, a pulldown resistor to the gate.
No other parts needed to control the MOSFET. No bjt, no optocoupler. (but you need to take care about power path wiring)
You need to protect the MOSFET. As FvM said: One diode close to the MOSFET is sufficient.

I recommend to install an electrolytics bulk capacitor and a fast ceramics capacitor at the 12V node close to the MOSFET.

Klaus

12. ## Re: Can this scheme be used to control multiple solenoids

Originally Posted by FvM
I smell over-engineering.

You need a single fly-back diode near MOSFET and bypass capacitor. You want to protect the MOSFET, not the solenoid valves. As an alternative to bypass capacitor, a TVS diode across the supply could absorb overvoltage produced by the cable inductance.

Hysteresis avoids switching losses with slow control voltage edges. The MOSFET has however some thermal capacitance so that it's probably not required under usual conditions.

In some cases, shorted solenoid cables or shorted coils may be a possible scenario. If so, you should consider either a fuse or a fully protected smart switch.

By saying "near MOSFET" do you mean across MOSFET a zener diode?

Please see my updated version after your suggestion:

What can be the zener value? I increased the cap to 1000uF cap.

And added a TVS across the supply. For 12VDC supply what TVS do you recommend?

- - - Updated - - -

Originally Posted by KlausST
Hi,

some calculations:

4.5W at 12V gives 375mA.
375mA x 8 valves gives 3.0A of current.

Letīs accept a 1V drop on the wiring over the 25m.
This means R_wiring = V_drop / current = 1V / 3A = 0.333 Ohms

1m of copper wire with 1mm^2 is about 1/56 Ohms.
A = 2 x 25m / ( 0,33 Ohms x 56) = 2.7 mm^2

--> use a 2 x 4 mm^2 cable.

*****
Power dissipation.
Your chart shows about 40W peak.
But for your swithcing time (about 40us) the average power is about 10W.
Now if you switch ON 100 times per second you may expect 2 x 100Hz x 10W x 40us = 80mW average switching power dissipation. For this you donīt need a heatsink.

From the SOA chart you can see that the MOSFET can withstand 50A x 50V which is 2500W for a 100us signle pulse.
The given 88W maximum power is not the peak power for a short time, but the maximum continous power dissipation.
And with 80mW average power dissipation you can almost see the 100Hz switching pulse like a single pulse. (At least with your peak power dissipation).

*****
Independent if you use the switch close to the valves or close to the microcontroller. (when we consider 100 duty cycle)
Thus - for ease of installation - I recommend to install the switch close to the microcontroller.

use a "logic level MOSFET", a series resistor to the gate, a pulldown resistor to the gate.
No other parts needed to control the MOSFET. No bjt, no optocoupler. (but you need to take care about power path wiring)
You need to protect the MOSFET. As FvM said: One diode close to the MOSFET is sufficient.

I recommend to install an electrolytics bulk capacitor and a fast ceramics capacitor at the 12V node close to the MOSFET.

Klaus
Thanks for the suggestions please see below the change I made:

I really wanna isolate tne uC pins and use IRF530. So I kept the opto.
I took all the PSUs and the circuits to the left side.
At the far end there is only solenoid-valves now.

I added TVS at vthe far end.

I didnt get where I should place the diode.
You and FvV mentioned diode near MOSFET. Do you mean across drain and the source?
But then it should be a Zener diode.

What do you think about the rating of Zener(right now it is 36V zener)? And the rating for TVS?

13. ## Re: Can this scheme be used to control multiple solenoids

Hi,

I really wanna isolate tne uC pins and use IRF530. So I kept the opto.
No problem with this.

I took all the PSUs and the circuits to the left side.
At the far end there is only solenoid-valves now.
Looks better now.

I added TVS at vthe far end.
I didnt get where I should place the diode.
* Put D1 where now TVS1 is as freewheeling diode. At switch OFF it prevents the energy stored in the solenoids to be pushed back to the driver circuit.
Most of the stored energy will be dissipated in the solenoids.

The main remaining problem now is the stray inductance of the 25m cable. It will cause a fast high voltage peak at the MOSFET. This may kill the MOSFET.
Thus you need a fast high voltage protection. It needs to be installed close to the MOSFET. Whether you use a fast zener or a TVS is not that critical.
Only one is needed. In schematic the position of D3 is correct.. across drian and source. TVS1 is at the wrong place.
The energy stored in the stray inductance of the cable is low. Even at ideal fast turn OFF it will see max. 3A for some 100ns. If this is within the SOA of the protection device, then you are safe.
With real switching times the current is less.
No need for high current rating, no need to take care about heating.

Klaus

14. ## Re: Can this scheme be used to control multiple solenoids

Originally Posted by KlausST
Hi,

No problem with this.

Looks better now.

* Put D1 where now TVS1 is as freewheeling diode. At switch OFF it prevents the energy stored in the solenoids to be pushed back to the driver circuit.
Most of the stored energy will be dissipated in the solenoids.

The main remaining problem now is the stray inductance of the 25m cable. It will cause a fast high voltage peak at the MOSFET. This may kill the MOSFET.
Thus you need a fast high voltage protection. It needs to be installed close to the MOSFET. Whether you use a fast zener or a TVS is not that critical.
Only one is needed. In schematic the position of D3 is correct.. across drian and source. TVS1 is at the wrong place.
The energy stored in the stray inductance of the cable is low. Even at ideal fast turn OFF it will see max. 3A for some 100ns. If this is within the SOA of the protection device, then you are safe.
With real switching times the current is less.
No need for high current rating, no need to take care about heating.

Klaus
Thanks a lot here is my final schematics(I did what you suggested and added 1uF cermic cap as well next to 1000uF):

For the Zener I found this one. It is 24V transient Zener with specs:
Nominal Zener Voltage: 24V
Maximum Power Dissipation: 3.25 W
Zener Type: Transient Suppressor

What do you think? Hope that would save the MOSFET in case.

If all is fine I have a last question. Should I use a twisted shielded cable or a BNC coaxial would be fine? (Of course if it is 4mm^2 as you suggested)

Thanks a lot for the help!

15. ## Re: Can this scheme be used to control multiple solenoids

Can you really turn on/off these relays 100 times /sec? These are mechanical solenoid valves that control fluid under pressure. The relays may not respond (and the flow will not be controlled) at all at 100 Hz frequency...

16. ## Re: Can this scheme be used to control multiple solenoids

Hi,

With 100Hz I don't expect the valve to mechanically move, but one can activate the relay with 100% duty cycle, then -depending on valve type one may reduce duty cycle to 30% to reduce heating and safe power. This can be done with 100Hz.
At least this was my idea for the 100Hz.

Klaus

•

17. ## Re: Can this scheme be used to control multiple solenoids

Originally Posted by c_mitra
Can you really turn on/off these relays 100 times /sec? These are mechanical solenoid valves that control fluid under pressure. The relays may not respond (and the flow will not be controlled) at all at 100 Hz frequency...
Im not going to use 100Hz, just ON and OFF time to time. That was for worst case for MOSFET in sim.

18. ## Re: Can this scheme be used to control multiple solenoids

With 100Hz I don't expect the valve to mechanically move, but one can activate the relay with 100% duty cycle, then -depending on valve type one may reduce duty cycle to 30% to reduce heating and safe power...
This is an excellent suggestion indeed. But should not C2 be in parallel to the zener?

19. ## Re: Can this scheme be used to control multiple solenoids

Hi,

But should not C2 be in parallel to the zener?
Good point.

If you do it parallel to the zener, thene there will be high inrush current when the Mosfet turns ON.

The initial idea is to stabilize the bus voltage.
This especially is important when there is a free wheeling diode close to the MOSFET like suggested in post#10... to generate a low impedance path for fast rising current through the diode when the MOSFET turns OFF.

Now it is a bit relaxed, because the freewheeling diode is close to the solenoids.
and the TVG is GND referenced...

Iīd leave it where it is..

Klaus

20. ## Re: Can this scheme be used to control multiple solenoids

The free-wheeling diode near the solenoids serves no purpose, the coil current is continuous by nature. Thus I shifted it towards the transistor/bypass capacitor, as suggested in post #10.

Now you have redundant commutation elements. Using either a TVS diode parallel to MOSFET DS or the free-wheeling diode in combination with a bypass capacitor should be sufficient.

The TVS solution involves lower part count, but needs a bit higher Vds,max margin. TVS allows for faster coil release by increasing the breakdown voltage, in case you need it.

--[[ ]]--