Connect with us

Unable to get solenoid controlled by Arduino to work anymore

Discussion in 'Microcontrollers, Programming and IoT' started by EK61, Nov 15, 2018.

Scroll to continue with content
  1. EK61


    Jan 5, 2014
    Hi. I’m having trouble setting up a solenoid water valve controlled by an Arduino. I am following the guide here

    Except I am using a 12V solenoid with a power pack to power the solenoid instead of the Arduino itself, and I got the code from another site, which uses a web interface on the Arduino to control it.

    It worked perfectly on the bench, but would not work once connected to the water. I even disassembled it and could not get it to work on the bench any more.

    I have tested the power pack connected straight to the solenoid, this works.
    I have replaced the transistor twice and tested the resistor with a multimeter.
    I have probed for voltage when I press “on” and the Arduino does output 3.3V.

    Should I be able to test for continuity to check the transistors? I'm thinking I received bad transistors.

  2. Alec_t


    Jul 7, 2015
    Post a schematic of your complete circuit, including the power pack and its connections to the oother components. If the breadboard layout is exactly as per the tutorial then it is essential that the relay +ve connection is removed from its present location so that it does NOT connect to the Arduino supply.
  3. hevans1944

    hevans1944 Hop - AC8NS

    Jun 21, 2012
    It is likely that you have either wired the transistor incorrectly or have damaged it by wiring it incorrectly.

    You should be able to turn the transistor on, thereby actuating the solenoid valve, by connecting its base current-limiting resistor to +5 VDC derived from the voltage regulator on the Ardunio board, or to +12 VDC from your power pack. Either connection should provide enough base voltage to turn the transistor on. If so, then connecting the base current-limiting resistor to power supply common (ground) should turn the transistor off, thereby de-actuating the solenoid valve. This simple test does not require the Arduinio to be programmed nor connection to any of the Arduino digital outputs. It is a simple voltage test to determine whether or not the transistor is properly connected and operational.

    Make sure the "snubber" diode is installed with the proper polarity, white band (cathode terminal) toward the positive supply terminal. Make sure the "snubber" diode is functional. Check the "snubber" diode for continuity. It should conduct, showing a low ohms reading, when your multimeter test leads apply a forward voltage to the diode; it should not conduct, showing a high, open, or "infinite" ohms reading when the two test leads are reversed. If the diode shows a low ohms reading with both of the two possible connections to the test leads, or if it shows a high, open, or "infinite" ohms reading with both of the two possible connections to the test leads, the diode is defective (shorted in the first case and open in the second case) and must be replaced. Do not place your hands on the metal probes of the test leads when performing the continuity tests, lest the resistance of your body cause irrelevant readings.

    It is wise to solder the "snubber" diode directly across the terminals of the solenoid valve and then add additional wires to connect the solenoid to the transistor and the power supply.

    Solderless breadboards should be used only for "proof of concept" and you should be aware of their limitations. In the previous century, they were sometimes installed in lieu of a custom-made circuit board, but this is not a recommended practice. Their spring-wire edge connections are not a reliable, long-term, connection solution.
  4. Minder


    Apr 24, 2015
    Also the valve in the article will not work with gravity fed water or next to zero pressure.
  5. gorgon


    Jun 6, 2011
    I suppose you have connected minus from the power pack to GND/0V of the Arduino?
  6. EK61


    Jan 5, 2014
    Sorry for the lack of response, I haven't had any time to work on this lately.

    I have simply substituted the +ve and ground of the Arduino in the original schematic for a power brick. I didn't have any diodes, but I thought it was only there to prevent from accidentally connecting it backwards so left it out. I realise now the real reason behind the "snubber" diode.

    The transistor should be turned on by applying voltage to the centre pin though shouldn't it? The schematic on the site I linked in the first post would be wrong because it applies it to the left pin which should be the emitter, correct?


    The solenoid I have works regardless of pressure.
  7. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    Which pin is base, emitter and collector is best determined by looking at it's datasheet. The middle pin is frequently NOT the base.

    If you're lazy, the collector is connected to the tab of a TO220 transistor. The emitter will show a high resistance (or open) with the multimeter probes either way around. The remaining terminal is the base (that will show a lowish resistance from it to the emitter (or collector) with the multimeter leads one way around and a high (or open) reading the other way around).

    You do not show the ground lead from the arduino connected to ground on your transistor circuit (that would be the emitter in this circuit)

    Either of these errors will stop the circuit from operating.
  8. duke37


    Jan 9, 2011
    Your schematic shows the output connected to the base of the transistor. This is wrong. The arduino shoud drive the base through th 1k resistor. The emitter should go to negative supply and the collector to the solenoid.
  9. BobK


    Jan 5, 2010
    Actually, it shows the base connected to the solenoid and the emitter or collector connected to Arduino. Cannot tell which since he omitted the arrow to indicate which is the emitter.

  10. hevans1944

    hevans1944 Hop - AC8NS

    Jun 21, 2012
    What!? That's supposed to be a drawing of a transistor? I thought it was an end-view of a picnic table.

    Or mebbe one of them "peace symbol" thingies done wrong...
  11. Tha fios agaibh

    Tha fios agaibh

    Aug 11, 2014
    It's likely fried for leaving out the snubber diode hevans1944 spoke of.

    Its probably wise to double check that the base resistor is sized correctly for the solenoid load.
  12. Bluejets


    Oct 5, 2014
    Never seen a goyen valve that allows water control with zero pressure, it's basically against the working principle of the thing.
    Apart from that, I would have thought if you had followed the instructions on the linked site that it should work as expected.
    Trying to decipher just what you have changed that stops it operating will depend on a full description of what you have done.
  13. EK61


    Jan 5, 2014
    Ok. I will add the snubber diode, and figure out which pin is which on the transistor. My schematic is not right because I misunderstood which physical pin of the transistor was which. I will also post a photo of a hand drawn circuit diagram.

    EDIT: Just tested 3 separate transistors from the 5 I bought as steve said. They all had infinite resistance between the collector and the other two pins, so that would mean they are all faulty?
    Last edited: Nov 28, 2018
  14. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    If you used this without a diode, then yes. However I would not expect it to have failed with all pins open. Are you sure you were trying on a resistance range?
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day