The Relay Box

ChallengesBringOpportunites YIPPEE!

I am ecstatic to say the 4 channel relay box works!


I made an attempt to be super careful wiring this up:


I should have taken a picture of the daisy chain wiring I did to go between the COM terminals of the 4 channel relay.  Oh well.

So now to turn stuff on and off, I plug the device’s cord into one of the sockets.  Then use the appropriate colored wire to twiddle the Arduino digital IO pin assigned.


I posted the BoM in this Google spreadsheet.

Arduino Wiring

I drilled a hole so the Arduino wires poke through one end.  I am waiting for tube covering so the wires are covered….until then, they dangle out of the top of the relay box:

Pasted Image 1 31 17 4 50 AM


5V -> RED


2 -> WHITE

3 -> GREEN

4 -> BLUE

So if I want to turn on/off a device plugged into the 4th outlet, I’d put the blue wire into an Arduino IO pin (and of course the 5V red into 5V red on Arduino and black wire into the GND pin):


Arduino Code

Here’s simple Arduino code to turn the device on and off:

#define DEBUG 1
#include <DebugLib.h>
 const int relayPin = 4; //arbitrarily use GPIO pin 4
void setup() {
  pinMode(relayPin, OUTPUT);

void loop() {
  //LOW turns on the relay

Measuring CO2

CO2 will be measured in the Grow Chamber.  The first thing I did was to put the Grow Chamber and Base together.


It’s getting there….

Simpson DOHDOH

The vinyl in the front of the Growth Chamber is too short.  I didn’t account for the additional inches:

Pasted Image 1 31 17 8 33 AM

The sides also need to be sealed, however I have been assuming I’ll need to seal these.  I plan to use velcro strips.  So I kludged everything together, put in the CO2 tank, got the fan hooked up to 12V.  


hard to tell in the image, but the duck taped bar is velcro’d onto the edge of the shelf..

Now to test the CO2 level…

Sensor/Automation Setup

After my flirtation with MicroPython, I’m going to finish this version of the Leaf Spa prototyping with Arduino hardware and the Arduino IDE.  One aspect I want to do is data logging.  I’m going to start data logging by logging to an SD card on an Arduino shield I have used in the past.  I’ll add sending data to…I’ll probably start when I get one of the Arduino 101 shields from Adafruit.  Right now they are out of stock.  For now, I can look at the data on my Mac.

Adjusting CO2

I need to get a better feel for how turning on / off the CO2 valve will work.  It is time to mount the Growth Chamber onto the Base.  Then I’ll explore the CO2 measurements within the Growth Chamber as well as outside of the Growth Chamber after I turn on/off the CO2 valve.

Arduino Code

The test code I’ll use is located at this GitHub location.  I’ll run the Arduino from my Mac so that I can control the CO2 regulator from the serial monitor.

Code testing will have to wait until tomorrow.