Use Arduino Uno to control solenoid valves.
Follow the steps below to set up your own valve control station.
- Clippard, E310C-2C012, 10 mm N-C 3-way Valve, In-line Connector w/LED, 0.030" Orifice, 1.3W, 12 VDC
- Valve connector cable
- Manifold
Details can be found on page 215-221 in Clippard Full-line Catalog
Send PCB design Out For Manufacturing
- Highly recommend JLCPCB. Fabrication and shipping took ~1 week for me in the U.S.
- If you choose JLCPCB, go here, upload plots.zip, and leave everything else as default.
- If you have access to a PCB baking oven, buying a SMT-Stencil will save you a lot of time for soldering. If not, all the components can still be soldered by hand.
Top Layer | Bottom Layer |
---|---|
![]() |
![]() |
Part | Label on PCB | Qty. (per PCB) | Purchase |
---|---|---|---|
Shift register, SN74HC595N | plug on the DIP socket (U1) | 1 | link |
Optoisolator, HCPL 2731 | plug on the DIP sockets (U2-U5) | 4 | link |
Resistor, 2.32 kΩ, package 0805 | R1-R16 | 16 | link |
Common anode diode | D1-D4 | 4 | link |
PMOS | Q1-Q8 | 8 | link |
1 uF capacitor, package 0805, voltage rating 10V | C1 | 1 | link |
DIP socket, 2x8 | U1 | 1 | link |
DIP socket, 2x4 | U2-U5 | 4 | link |
Stacking headers | J2-J4, H1, H2 | 1 | link |
Connector, Molex 50212-8000 | N/A | 18 | link |
Connector housing, Molex 0873690200 | N/A | 9 | link |
JST header, Molex 0894010210 | J5-J13 | 9 | link |
2.5 mm barrel jack, 5A max, CUI PJ-057BH | J1 | 1 for each setup | link |
Download zip and extract all files.
- Connect an Arduino Uno to computer via USB
- Download and Install Arduino IDE
- Open
arduino_valve_control.ino
inarduino_valve_control
folder with Arduino IDE - Select USB port:
Tools
>Port
- Click
Upload
(the right arrow at the top left corner) - Wait for uploading to complete
- Download and Install Python 3.6
- The Python distribution, Anaconda is recommended, because it comes with pre-installed packages.
- Note: On Windows, the directory of installed Python must be added to environment variable.
- Install Python dependencies
- Windows: double click
platforms/windows/setup.bat
- MacOSX:
$ bash <path to>/platforms/macosx/setup.sh
- Windows: double click
(ADD photos of top and bottom layer after soldering)
Solder all the components according to the table above. The surface mount components are soldered to the bottom layer, while the rest are mounted on the top layer.
In the table above, the stacking headers contains the following headers.
Stacking Header | Label on PCB | Qty. |
---|---|---|
1 x 10 | cut out a 1x2 for J4 | 1 |
1 x 8 | H1, H2 | 2 |
1 x 6 | 2 | |
2 x 3 | J2+J3 | 1 |
Because the JST headers at J11 and J12 block H3 on the top layer, I would do the following:
- Cut a 1x2 stacking header out of an unused one
- Solder it on H3 from the bottom layer
- Cut off the female portion on the top layer
- Put more solder from the top layer
Each setup only needs one barrel jack to connect to a 12 V power supply. The barrel jack can be soldered on any one of the boards.
(The images shown below are all taken for the previous PCB design, which is marginally different from the current design.)
After soldering, plug the shift register and optoisolators into their corresponding DIP sockets. Refer to the following image for their orientation.
- Bend or remove the data pins on all boards except Board 1. See the left image below.
- Make a connector for serial input and serial output. See the right image below.
- Stack the PCBs and plug in the connector just made.
Data Pin | Serial Input/Output |
---|---|
![]() |
![]() |
In the images above, there are 4 boards stacked on an Arduino Uno.
Each board provides 8 solenoid valve connectors, and the current design supports up to 6 boards.
Before putting the boards together, the data pins on all boards except Board 1 must be bent or removed.
This is because the data pin connects to the serial input of shift register.
On Board 1, the shift register receives data from the Arduino directly.
For the Board 2-n, their shift registers must have its serial input connected to the serial output of board right beneath it.