
I didn’t have chemicals to generate CO2, but had plenty of soda at home, so it was quite easy to create varkous CO2 levels to help test the sensor 🙂 The idea is that the air valve will only need to be open if the CO2 level is above a certain threshold. It is used to conditionally open the air valve at the end of the experiment. The right image above shows a CO2 sensor. So four additional digital pins are used to toggle the 4 relays. Because the linear actuator can draw up to several amps of current, I decided to use a 4-channel relay board (instead of MOSFETs) to implement two H-bridges. This is similar to how a motor works, and it’s typically done through an H-bridge. The way linear actuators work is that they each have two wires - apply positive 12V on the two wires, the actuator will start to extend reverse the polarity, the actuator will retract. To control the linear actuators, I needed two high-power H-bridges. I then used the built-in relay on OpenSprinkler to switch the air valve. OpenSprinkler already has a switching regulator inside that can work with 12V, so that’s not a problem. Because we don’t want to involve too many different power supplies, we decided to go with a single 12V power supply, which powers the OpenSprinkler, linear actuators and the air valve. Next, there are two 12V linear actuators, and a 12V air valve. The SSR works with logic level signals, so I used two digital pins to interface with them. The project also calls for two solid state relays (SSRs) to control 110V pumps. By activating a subset of stations, it sets the selector valve to a specific position. This is pretty easy to achieve using OpenSprinkler - there are 8 stations on the main controller, each station is a open-collector that controls on wire. To set a specific position, you basically use open-collectors (one for each wire) to pull a subset of the wires to ground. The valve has a number of control wires which are normally pulled high. The main component is the fluid selector valve, which selects a specific type of fluid from several input fluid streams. It took me a while to understand the design requirement and how various components worked.
OPENSPRINKLER WITH RELAY BOARD SOFTWARE
Also, this particular project fits well with the existing software design of OpenSprinkler, since the control schedules are somewhat similar to typical sprinkler programs. I don’t typically accept contract work, but felt this was a very interesting project, as I’m always keen to see wider applications of OpenSprinkler.

The goal is to achieve web-based, programmable control of fluid selector valves, linear actuators, relays, and air valve, to automate a custom biology experiment.

Around Thanksgiving last year, I received a request from a biology lab professor who commissioned me to modify OpenSprinkler to become a custom fluidics controller.
