Wiring of the Solenoid Valves

Overview of Wiring for the Salinity Sensor

Other pages describing fish tank wiring:

Return to the main page for the fish tank wiring.



The following schematic shows the circuit for supplying power to one of the solenoid valves.

The power to the solenoid comes from the 12V power supply circuit. The relay and the transistor are powerd from the 5V circuit, which is fed from the Arduino.

Wiring of the Solenoid Valves schematic

Cascade Switching

The solenoid is controlled by a cascade-switched circuit. A digital output pin of the Arduino is connected to the base of a transitor which controls the current to a normally open, SPST relay. When the relay coil is energized, it closes the contacts, which allows current from the 12V supply to flow through the solenoid. When the solenoid coil is energized, the valve opens, allowing water to flow from the reservoir into the fish tank.

The following photograph shows coil-side view of three relays. Two of the relays control separate solenoid. The third relay controls the heater. The wiring for the three relays is identical. The short red and green jumpers connect the relay circuit to the 5V power rail along the nearest edge of the breadboard.

Wiring of the Solenoid Valves

The brown, yellow and blue wires are connected to digital I/O pins on the Arduino. Each of those wires is connected to an NPN transistor by a 220 Ω resistor. The transistors are on the ground side of the relay coil. Power diodes are in parallel with the relay coil act as snubbers to the charge stored in the coil. When the current to the coil is switched off, the snubber diodes (a.k.a. flyback diodes) allow the electro-magnetic field in the coil to safely dissipate through the coil windings.

The following photograph shows the contact side of the relay circuit. There are three sets of long read and black leads that connect the relays either to one of the two solenoid valves or to the heater. Two of the three relays have red indicator LEDs to provide visual confirmation that the contact is closed. The rightmost relay circuit has its LED circuit removed to make the connection to the solenoid leads more clear.


For more detail: Wiring of the Solenoid Valves

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top