Arduino Indoor Garden Box with Data Logger
TAGS: electronics; software; nature projects; Arduino Uno; data logger shield; real time clock; relay; water pump; DC motor fan;
Why I Did This
One of my passions is with nature related automation (because I like growing food plants and I love the idea of them being cared for through automation). Normally I can achieve this with minimal equipment (like a bubbler alone), but I have an Arduino, lots of sensors, and data logger shield; and, as an engineer, I figured this would be a perfect project for testing all of this equipment.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_40.jpg)
Arduino sensor system with data logger for a hydroponics planter. The black thing on the right is a constant air bubbler that is not part of the Arduino system.
Design Walkthrough
Parts: Arduino microcontroller (Uno); data logger shield; real time clock; 2 relays; low voltage water pump; low voltage DC motor fan; water level sensor; photoresistor; temperature resistor; 1602 LCD display; BME280
The main two goals of this Arduino project are to make a system that controls relays and
sensors, and, to do data logging of said sensors.
Basically, I installed the data logger shield (which includes a built-in real-time clock and
requires an SD card and watch battery) on top of the Arduino Uno.
I then wired the fan, pump, LCD, and sensors to the appropriate digital and analog ports on
the Arduino.
I uploaded some basic Arduino code used for: turning on the relay controls for the fan and
pumps, capturing sensor
data through the LCD, and recording the data on the SD card.
My system was setup to record the temperature, barometric pressure, humidity, altitude,
water level (and analog value),
analog light value (photoresistor), analog temperature value (not seen on LCD), and time
(not seen on LCD). The BME280 sensor produces
digital readings of temperature, barometric pressure, humidity, and altitude.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_0.jpg)
System can display current values on 16x2 LCD.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_4.jpg)
System of 1602 LCD display, arduino, logger, relays, BME280, and 9V battery.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_5.jpg)
The arduino data logger shield includes prototype grids for adding new compenents; I added more 5V and ground terminals.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_6.jpg)
The arduino data logger shield also includes a place for the SD card, real-time clock, and uninterrupted supply battery for clock.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_9.jpg)
The system includes a 5V water pump for watering plants from above the container
(I put another white model in the picture to show what it looks like).
Relay and water pump in action.
I added a 5V fan to blow away stagnant air from the roots (to prevent mold).
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_19.jpg)
A water level sensor to track the container's water height.
The system will light a red LED as an alarm indication for low water level (below 15%).
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_24.jpg)
I made a small 3D printed block in a previous project, for holding analog photoresistors and temperature sensors.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_25.jpg)
Here the photoresistor is displaying a normally high value for been in the presence of light.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_26.jpg)
Here the photoresistor is displaying a zero value while being within a dark cardboard box.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_41.jpg)
Here is a sample of the CSV data captured from the system, displayed on an excel sheet.
![](articleAssets\Arduino-Indoor-Garden-Box-with-Data-Logger\Indoor-Garden-Box_42.jpg)
Here is a sample of the CSV data plotted to a chart. Notice the overnight drops in photoresistor and temperature values.
Lessons Learned and Future Changes
Bird’s nest on a wire. If I were to professionally build this I would tie down the bundle of wires better and place the system in an electronics compartment/box.Data Logger for Uno only. I had a heck of a time trying to get this logger to work with an Arduino Mega but turns out that it just wasn’t natively compatible to work with (at least not that I knew of), it seemed to only work with the Uno model.
9V batteries are handy. I only have the water pump and wind fan on for like a minute at a time, so this was acceptable to be powered by a 9V battery (both motors could handle that voltage, and the drainage from the battery at set intervals was minor).
Works pretty decently, but unnecessary for me. As mentioned before, I don’t need this system for my garden boxes (they are fine with just the bubblers), I just wanted to test this project just to get the experience from trying out the data logger and sensors. They work pretty well.
References
Data Logger and RTC tutorial:
https://learn.adafruit.com/adafruit-data-logger-shield/using-the-real-time-clock
Photoresistor and temperature resistor tutorial:
https://github.com/adafruit/Light-and-Temp-logger/blob/master/lighttemplogger.ino
BME280 Temperature, humidity, and barometric pressure sensor tutorial:
https://lastminuteengineers.com/bme280-arduino-tutorial/
Soil capacitive moisture sensor tutorial:
https://how2electronics.com/interface-capacitive-soil-moisture-sensor-arduino/
Liquid level sensor tutorial:
https://lastminuteengineers.com/water-level-sensor-arduino-tutorial/