Using Raspberry Pi to control solenoid

Discussion in 'The Projects Forum' started by JeffR, Feb 18, 2013.

  1. JeffR

    Thread Starter New Member

    Feb 18, 2013
    Hi all, bit of an amateur looking for some advice. Have done quite a bit of web searching but want to validate my proposed design. The project is a little garden watering system controlled by the raspberry pi. The solenoids will have a light load, probably switched on for 20-30 minutes maximum once every 3 days or so.

    We can skip all the logic and get to the electronics question - how to use the I/O from the pi to control the water valve solenoid.

    I found a basic circuit design here

    Since ultimately I will want to control 4-5 solenoids (for watering various areas), I then found a darlington array on an IC that seems to make sense. It looks like it has the diode protection already built into the chip. It looks like it can handle 500mA per output

    Just want to check that all these parts will come together.

    The solenoids are 12V and pull around 320mA

    The pi IO control is 3.3V and can put out 16mA per pin to a total of 51mA.

    I'll put a separate 12V DC feed to the uln2003a.

    - Is the 3.3V from the pi enough to drive the chip?
    - Can I run several solenoids simultaneously, or will that be too much for the chip? I can run them sequentially if necessary.
    - I was reading that these solenoids have a large load to initially lift them, then a lower load to keep them lifted. Is there any sense to integrating some kind of capacitor(s) into the circuit, or is it overkill?
    - If for some reason the chip will not work, can you suggest the components for each individual circuit? I was thinking but don't know what resistor to use.

    Thanks for any advice, and please go a bit easy on me if my terminology is not too perfect.
  2. JeffR

    Thread Starter New Member

    Feb 18, 2013
    Dang, 112 views and no replies? Am I missing some key info?
  3. MrChips


    Oct 2, 2009
    R-pi is a tad overkill. I would look at the arduino.
  4. JeffR

    Thread Starter New Member

    Feb 18, 2013
    Pi is already a done deal.

    More on adding a capacitor to the circuit:

    My thought is that the power required to hold the solenoid is much less than the power required to initially lift the solenoid. So a capacitor of some type seems to make sense. Not so much worried about the power savings (the solenoids will only engage for 10-20 minutes a few times a week), it's more about limiting the power going through the uln2003 and keep that from overheating.

    Saw this as an example but need help with adjusting to my loads/voltages.
  5. Meixner


    Sep 26, 2011
    That circuit would work but it could only power one solonoid at a time. Myself I would not worry about the power savings. If you want to reduce the load on the uln2003 you could either run only one solonoid at a time or skip the uln2003 and use a separate transistor for each solonoid. Also you have to size your power supply for the number of solonoids you want to power at the same time. Also it's best to mount the protection diode at the solonoid.