drive a solenoid with mega digital I/O

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

probably a simple one but i can't seem to find something obvious :?

Looking at a 24v AC solenoid to control water flow (sprinkler system) and want to control it from a MEGA's IO. Have no idea what to look at - opto couplers, relays, and 24vac power supplies......

From my research, i think i'll need a transistor (plus diode) to allow the mega to switch a relay, that switches the 24vac supply on/off as needed, thats connected to the solenoid. Anything else I'm missing?

thanks in advance

BP

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would depend also on how often you would have to turn it on/off, if it is very often a relay will soon wear out. How high current will it draw? If not too high a transistor and a diode might drive it directly.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The simplest method is as you describe. As for kherseth's comment about the relay wearing out, I don't think that would be a problem as a correctly sized relay will probably last over a million operations and your solenoid valve will probably have worn out by then.

The other option is a use triacs but that introduces a few problems of its own. You can't go too wrong with a relay.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably will want to use a relay driver to handle the relay coils current requirements. On Semi makes some little driver IC for less than 1$. They have the diode built in to protect the AVR from the back voltage of the relay coil. See NUD3112 for one example.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Relays may not be perfect for this.
Yes, you could use a transistor and diode to drive a relay coil with DC voltage, and control 24VAC with the relay, but depending on the load switching the relay on and off may wear out the contacts unless you design a snubber over the relay contact pins.

You could consider putting a opto-isolated triac there. To your AVR it would look like a LED. Examples are MOC3010 or similar.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jepael, the moc3010 style devices are not specced to switch loads other than triacs - this is mentioned in the datasheet, so you would also need to add a triac.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

some more info from me, and some more questions, of course...

i have no idea about the solenoid i've seen (which I only saw as I was strolling the aisles in Bunnings). I am guessing I need to find out it's curent draw (if i was to buy one) to figure out the relay sizing?

(edited for clarity) Duty cycle impact on relay life should be small. Initially i'd expect several switching events in a day, most likely only say 4 on/off event combos a day MAX. Nothing too stressful for a relay I'm guessing.

Kartman, any jaycar (or other AU based commodity component place) pointers/refs on relays?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Jepael, the moc3010 style devices are not specced to switch loads other than triacs - this is mentioned in the datasheet, so you would also need to add a triac.

Sorry. I just know there are some similar chips that can drive 230VAC loads directly, and I thought wrong.
Edit: Oh yes, solid-state relays could be for this?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Something like this:

http://www.jaycar.com.au/product...

rated for 5A so that should be more than enough.

Using a BC548 or similar transistor will drive the relay - use a 1k resistor in series to the base or use a ULN2003 chip and get 7 high current drivers in the one package.

You could also try Oatley Electronics, paying $6 at Jaycar seems a bit steep for me. You could also troll electronic junk places for boards with 12V relays on them.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
if you are talking about 24V AC you should use a triac which can handle the solenoids current. Let the ATmegas I/O drive the gate and that's it. Reliable, noiseless and easy.
Duty cycle very often is limited by the power not by the number of usage.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey uC-Harry, do you have any references to triacs that would help me design that?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just about any triac with the required current rating. In your instance this would be less than 1A. Something like a BT136 should be easy to get.

Without using any isolation, this means the 0V rail of your AVR and associated electronics becomes one of the 24VAC wires - this is something you need to consider carefully in regards to your power supply to the AVR. I suggested the relays since this gives you isolation and is quite easy however, commercial products would most likely use a triac due to cost.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
it's a couple of years ago that I used a triac. But Kartman suggestion sounds good to me. I had a look into the datasheet and I think it will work. With TIC225D or better 2N6075B you will find one with a little bit more sensitive gate.