Here’s what I want to do by priority:
- start using The Leaf Spa
- figure out how to build MicroPython and add extensions like Software Serial (teach a person how to fish and give them fishing poles like Vagrant, MicroPython forum…)
- build a PCB with a CCS811.
I’ll do these in parallel but try to focus the majority of time on the priority order.
I’ve been caught up the last week in getting connecting to the Internet through ESP8266. Exploring what I have and the options. I learned from this I really like MicroPython to the point I could see myself writing extensions so that MicroPython can be used in my specific case. I also learned I am not a fan of sensors that use UART instead of I2C. I2C is just easier when going between software platforms. Not all ESP8266 hardware platforms are equal. There’s this PyBoard thing for more robust MicroPython. Yet the more generic environment relies on just having an ESP8266. So I’ll probably end up with the ESP8266 down the road but the PyBoard to test out stuff with MicroPython.
Priority 1: Start Using the Leaf Spa
- Test water pump with ON/OFF every hour. Figure out a reasonable period of time between waterings and length of time to leave the pump on.
- Drill holes on Base as needed for cords.
- Test turning LEDs on/off.
- Test adjusting CO2.
- Drill holes on the Grow Chamber as needed for cords.
- Mount the Grow Chamber on the base.
- TBD: Internet/LCD display/logging.
I’m going back to the Arduino Uno to get this stuff going. I’ll continue where I left off yesterday.
- Run RelayTest.ino on relay 4. OK.
- Wire up pump to VAC side.
- Test pump turning ON/OFF and hope to live to tell about it.
- Set up the Base with a few rock wools and get the feeders in the right spot so the water pumped is working properly.
- Write Arduino code to turn the pump on for two minutes every half hour.
- Run the Arduino code on the Base for several hours periodically checking on the moisture level of the rock wool (I guess I could set up a moisture sensor and measure but then I’d have to add logging so I’ll keep it informal for now).
…you know what? I just remembered I have a PowerSwitch.
So before wiring up the 4 channel relay, I’ll test stuff using the PowerSwitch. Should be Easy Peasy.
I evolved the RelayTest.ino (version with pump on/off) to switch on every 1/2 hour for 2 minutes using Dr. Monk’s Timer library. Note: The Power Switch is turned on when the pin is set to HIGH. This is the opposite of the 4 channel relay. From Timer.h:
int8_t every(unsigned long period, void (*callback)(void));
YIPPEE! The size of period handles 60 secs / min * 1000 ms/secs * 30 min = 1,800,000ms
Time to set up the test on the Base.
- Get setup working without Arduino timer + power switch. OK.
- Add Arduino timer + power switch. OK.
YIPPEE! Was EasyPeasy to get going and works. Does make me start thinking about enclosures for everything. But first, I want go get a better feel for the relays. I know the LED one will work. So now I need to test the CO2 amount.
To test the CO2 amount:
- Set up the Growth Chamber so the chamber is easy to access with the WH-Z16 CO2 sensor.
- Use a SD card Shield with the Arduino and take measurements of the CO2 as it is without adjusting.
- Run the measurements for an hour to get a feel for the variability in readings.
- Use the measurements to inform an Arduino sketch that measures and adjusts the CO2 to 1,200ppm.
As I was looking at the Grow Chamber, I noticed the fan holder held the fan 2” lower than ideal:
I’ll adjust the model in Fusion 360 and 3D print another holder that is 2” shorter. Wait a second. Given that I glued the fan down and it takes time to redo, I’ll first try cutting two in. off the current one and see if I can reattach. Might be difficult because the screw holes won’t be there. Well, that didn’t work so I’m printing out a new fan holder. I was able to detach the fan from all the glue I had used to attach it to the fan holder in the picture.
I updated the print profile based on Russell’s advice (MakeIt has exceptional support!):