living with the lab cascaded switching of a solenoid valve transistor © 2012 David Hall relay solenoid valve living with the lab DISCLAIMER & USAGE The content of this presentation is for informational purposes only and is intended only for students attending Louisiana Tech University. The author of this information does not make any claims as to the validity or accuracy of the information or methods presented. Any procedures demonstrated here are potentially dangerous and could result in injury or damage. Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. If you do not agree, then do not view this content. The copyright label, the Louisiana Tech logo, and the “living with the lab” identifier should not be removed from this presentation. You may modify this work for your own purposes as long as attribution is clearly provided. 2 living with the lab wiring setting digital output on Arduino HIGH switches the transistor the transistor allows current to flow through the relay coil, closing the relay contacts power from the 12VDC supply actuates the solenoid valve, allowing water to flow 5V Arduino digital pin 12VDC power supply C B 1kΩ + • • • diodes - E coil normally open contacts SPST relay solenoid valve 3 living with the lab good and bad wiring: using a flyback diode 5V 5V C 1kW Arduino digital pin B Arduino digital pin B C 1kW E E 4 living with the lab why do we need a flyback diode • when digital pin 8 on the Arduino goes HIGH, electricity is conducted through the coil of the relay, inducing a magnetic field in the coil 5V • energy is stored in the coil as a magnetic field • when digital pin 8 on the Arduino goes LOW, the decay of the magnetic field induces a current that can be harmful to our electronics (can arc across contacts or send a surge through the system) • the diode allows a circular current to be set up in the coil / diode loop so that the magnetic energy stored in the coil can be safely dissipated Arduino digital pin C B 1kW current path broken E void setup() { pinMode(8,OUTPUT); } void loop() { digitalWrite(8, HIGH); delay(500); digitalWrite(8, LOW); delay(2000); } 5 living with the lab power considerations 1. Power to switch transistor source: Arduino digital I/O pin max current per digital I/O pin: 40 mA 2. Power to switch relay source: 5V from Arduino (from the on-board voltage regulator) max current from the voltage regulator: 800 mA coil current for relay: 40 mA 3. Power to switch solenoid valve source: 12VDC wall power supply (converts AC to DC) max current of power supply: 1.5A (depends on power supply purchased) requirements of solenoid valve: 0.29A 6 living with the lab implementation void setup() { pinMode(8,OUTPUT); } void loop() { digitalWrite(8, HIGH); delay(500); digitalWrite(8, LOW); delay(2000); } wire to digital pin 8 12V 5V silver stripe toward positive side solenoid valve 7 living with the lab more compact wiring you will need three relays, two for the solenoid valves and one for the heater transistors turned with round side toward relays 8 living with the lab view from other side of relays stripes on diodes must point toward positive voltage 9 living with the lab another view 10 living with the lab complete assembly of conductivity control system (in class or for homework, as time permits) 11