Questions on control of solenoid valves.

wllshaw

Member
Guys, and Gals:
I'll start with a little background. I am aiming to control a servo valve to control the watering of my garden. I have done a search on the forum and read what is available. At this point I haven't picked a chip yet although I believe I am right in saying that the pic chips will sink or source 20 milliamps per pin with a maximum of 90 milliamps per chip. This would also be at 5 volts. I bought an Orbit servo valve that has an inrush current rating of .4 amps and a holding current of .2 amps. I also found an Opto 22 OAC5 Standard AC Output Modules that I had sitting around. I downloaded the data sheet on it and I guess that is where my questions start. The line voltage, operating voltage range, and current rating all are within the parameters I will be using. The logic voltage is 5 VDC Nominal. The logic voltage range is 2.5 to 8 volts so that should be within my range also.The logic picup voltage is 2.5 volts and the dropout voltage is 1 volt DC The logic input current is 12 milliamps. Am I right to state that I can drive this directly from a pic chip? The logic input current is 12 milliamps so that should be under the max 20 milliamps for the chip, and the voltage is within the chips range. Having said this I am assuming I really should use a transistor to drive it just to provide a little isolation to the pic chip. Also, if I want to drive a bunch of these from one chip I would need to drive transistors to keep me from running above the 90 milliamps per chip. I am powering the orbit with a 24 volt AC wall wart that I bought from Radio Shack. Does this sound like I am on the right track? Right now I am working on controling the valve. I'll work on the sensor after I get this figured out. Any thoughts, corrections, or ideas are welcome. Tks.
 
Last edited by a moderator:

eclectic

Moderator
Possibly I'm over-critical, but I find the original text
very difficult to read.
Please could folks insert a few paragraphs and line-feeds.

Guys, and Gals:
I'll start with a little background. I am aiming to control a servo valve to control the watering of my garden.

I have done a search on the forum and read what is available.
At this point I haven't picked a chip yet although I believe I am right in saying that the pic chips will sink or source 20 milliamps per pin,
with a maximum of 90 milliamps per chip.
This would also be at 5 volts.

I bought an Orbit servo valve that has an inrush current rating of .4 amps and a holding current of .2 amps.
I also found an Opto 22 OAC5 Standard AC Output Modules that I had sitting around.

I downloaded the data sheet on it and I guess that is where my questions start.
The line voltage, operating voltage range, and current rating all are within the parameters I will be using.
The logic voltage is 5 VDC Nominal.
The logic voltage range is 2.5 to 8 volts so that should be within my range also.
The logic picup voltage is 2.5 volts and the dropout voltage is 1 volt DC The logic input current is 12 milliamps.
Am I right to state that I can drive this directly from a pic chip?

The logic input current is 12 milliamps so that should be under the max 20 milliamps for the chip, and the voltage is within the chips range.
Having said this I am assuming I really should use a transistor to drive it just to provide a little isolation to the pic chip.

Also, if I want to drive a bunch of these from one chip I would need to drive transistors to keep me from running above the 90 milliamps per chip.
I am powering the orbit with a 24 volt AC wall wart that I bought from Radio Shack.
Does this sound like I am on the right track?

Right now I am working on controling the valve.
I'll work on the sensor after I get this figured out.
Any thoughts, corrections, or ideas are welcome.

Tks.


Secondly, could you please post a link for the Datasheet?

e
 

wllshaw

Member
Eclectic:

Sorry for the confused writing. I don't post very many questions. In the past my browser has ignored line feeds and just jumbled everything together. This time I just tried to get as much information into the message as possible. I will check with my son and see if I can do this better.

In regards to your request. I believe this link will take you to the OPTO 22 data sheet
http://www.opto22.com/documents/0449_Std_Dig_AC_Outputs_data_sheet.pdf

Once again, sorry for the confusion.
Will
 

boriz

Senior Member
"Does this sound like I am on the right track?" Yep.

One question though. That opto is designed for AC with zero-cross switching. Not sure how well that would work with a DC load. It could in theory never switch on because the load voltage never crosses zero. Maybe? Or is your valve AC powered?
 

westaust55

Moderator
I think :confused: eclectic was asking about the datasheet for the "Orbit servo valve"

In the absence of the datasheet I ask are you sure it is a servo valve.
Here is Australia many houses use reticulation for lawns and gardens due to low rainfall.
Our valves are solenoid (not servo) controlled and use a coil rated 24 Vac. Some I have just purchased for a new house are around 0.4 Amp pull-in and 0.2 Amp hold-in.
 

wllshaw

Member
Boriz and Westaust55:

The valve I bought is an Orbit 24 volt AC valve. It is driven off a 24 volt wallwart transformer I bought at Radio Shack. I also need to correct a mistake. Westaust55, you are correct, it is a solenoid valve. Sorry about that, I had servo valves stuck in my mind from working with an agricultural sprayer.

I would like some advice on how to pick a transistor to drive the Opto 22 Modules. How do I go about sizing one. I can get them out of Jamico electronics, I just don't know how figure the size. Ohms law I have down. I believe there is something about transistor gain in here though, and that I don't understand that yet.

I'll look for the data sheet on the orbit valve. It came with one in the package, but I haven't got the link for it online yet. What information do you need to know about the Orbit Valve?

Thanks for the help!
 
Last edited:

MPep

Senior Member
The way I read it, the PICAXE can be directly connected to the OPTO (logic voltage range of 2.5V - 8V). The output of the OPTO can be connected directly between 24Vac and the valve. Should be straightforward to do.
Remember to use fuses for the 24Vac system. ;)

You don't specifically need a transistor if you use only one OPTO. If more than 1, then use a BC547 transistor type per output. A 1k resistor should be connected between PICAXE output pin and BC547 base.
 

John West

Senior Member
The transistors more likely available in the US for such jobs would be the common 2N3904 or 2N4401 or 2N2222 if an NPN transistor is used. If switching is with a PNP transistor circuit then values such as 2N3906 or 2N4404 will work nicely.

The 1k Ohm resistor in each PICAXE output protects the PICAXE by limiting how much current the transistor switch Base may draw under worst-case scenarios.

Keep in mind when you choose a drive circuit that you don't want the valves to be stuck open if power to the PICAXE or the transistors is turned off or fails. Things could get very, very wet before you solved the problem, or even noticed it.

I have several of the Opto-22 devices and they are both reliable and handy for direct interfacing to PICAXE's, but as you say you wish to drive several of them a transistor used to shift even the small Opto-22 input current from the PICAXE to an external device is a good idea. However, if you are sure you will only be enabling one or two solenoids at a time, (as is often the case in irrigation systems where maintaining sufficient water pressure is a problem,) then you could easily get away with using no transistors at all, and just put 220 Ohm protection resistors in the PICAXE outputs and be done with it.
 

Bill.b

Senior Member
This may be of some help. this is the schematic of my watering system controlling 6 24v solenoids
The system also doubles as a christmas light controller.

watersystem1.jpg

watercontroller.jpg
Bill
 

Bill.b

Senior Member
No. any combination of solenoids can operate.

you can set the day, On Time and duration for each solenoid.

The controller can operated 5 circuits plus one main solenoid on the water supply as well as
supplying 240v (110v) for the solenoid transformer(s).

Power box schematic.

watersystem2.jpg

Bill
 
Last edited:

wllshaw

Member
If possible could you tell me if I am on the right track here.

John, you said to use a 1K resistor between the PICAXE and the transistor to limit the current. If I am getting 5 volts out of the PICAXE, and I use the 1K resistor, then I should be drawing a current of 5 milliamps. That should be well with in the range of sinking or sourcing 20 milliamps per pin and a max of 90 milliamps per chip. Is that right?

I would also like to know how did you come up with the 1K transistor? Can it be bigger or smaller, or is this just a rule of thumb? Also, when you are just going from the PICAXE to the Opto you use a 220 ohm resistor. That works out to 22 milliamps current. A tad over the rate, but I am guessing close enough. Are my conclusions accurate?

Many thanks for the responses guys. Especially Bill's schematic. Very nice!
 

MPep

Senior Member
If possible could you tell me if I am on the right track here.

John, you said to use a 1K resistor between the PICAXE and the transistor to limit the current. If I am getting 5 volts out of the PICAXE, and I use the 1K resistor, then I should be drawing a current of 5 milliamps. That should be well with in the range of sinking or sourcing 20 milliamps per pin and a max of 90 milliamps per chip. Is that right?

I would also like to know how did you come up with the 1K transistor? Can it be bigger or smaller, or is this just a rule of thumb? Also, when you are just going from the PICAXE to the Opto you use a 220 ohm resistor. That works out to 22 milliamps current. A tad over the rate, but I am guessing close enough. Are my conclusions accurate?

Many thanks for the responses guys. Especially Bill's schematic. Very nice!
1k is a rule of thumb. You can change it as required.
Internal to the OPTO, from what I read, is a resistor already. The extra 220R is a bit of extra protection.
 

boriz

Senior Member
"...If I am getting 5 volts out of the PICAXE, and I use the 1K resistor, then I should be drawing a current of 5 milliamps..." - No. depends on the bangap. Could be 1.7v at 3.3mA or less.

"...That should be well with in the range of sinking or sourcing 20 milliamps per pin and a max of 90 milliamps per chip. Is that right? ..." - 3.3mA per pin is easy on all Picaxes.
 

Bill.b

Senior Member
Four 240 vac 20amp circuits from the MSB for a few christmas lights seems like a bit over the top.
Hi bluejets

I have 3 20A circuit breakers dedicated to christmas lights. (the Griswelds). I have not counted the number of lights, rope, LED and music controlled lights, but it
must be in the order of 100,000 give or take a few. All circuits are loaded fully which increases my power bill by several hundred dollers for that quarter.

This is a small section.

_IGP2672b.jpg



Bill
 

Phil bee

Member
Hi Bill.B

a nice finished project, why not submit it to Finished Projects list and add your code?

But don't let my wife see the show or our electric bill will go through the roof.
 

craigcurtin

Senior Member
Why not just use an AC relay board ? Someone posted in just the last couple of days about a $6 4 channel relay board with Opto isolation

Am i missing something here - i would have thought this would do the job just fine - it is rated to 10AMP at 240v

Craig
 

Bill.b

Senior Member
The controller was constructed two years ago.

Today I may consider useing these relay boards for the eight low voltage outputs.

The power boxes are some distance from the controller, the optos provide protection for the picaxe outputs from any induction .

I would still use the power contactors to switch the mains load, up to 20A. The relays may be rated at 10A 240v, from experience there is
no way I would used these realys in this application.

Bill
 
Last edited:

bluejets

Senior Member
I would still use the power contactors to switch the mains load, up to 20A. The relays may be rated at 10A 240v, from experience there is
no way I would used these realys in this application.

Bill
I agree....relays would end up an ionized mangled black carbon deposit.
Also I didn't realise you had so many lights. Looks great.
 

fritz42_male

Senior Member
I have 3 20A circuit breakers dedicated to christmas lights. (the Griswelds). I have not counted the number of lights, rope, LED and music controlled lights, but it
must be in the order of 100,000 give or take a few. All circuits are loaded fully which increases my power bill by several hundred dollers for that quarter.Bill
I was wondering why Newcastle street lights are dimmer on the run up to Xmas - now I know!

:D
 
Top