Introduction: Garden Monitor

This is the most recent and complete version of my garden monitors, I have made previous versions with different uses, like one with an LCD and another with a ESP8266. However I have documented this version better so have decided to upload it.

When complete it will monitor Soil moisture, Temperature, Humidity and Luminosity, which is then logged to an SD card in a .csv file. I have chosen a CSV file as I intend on using python to make a analysis program. The circuit is powered by a 9V battery, however in the future I am hoping to make a Li-ion solar circuit to power it or to add a deep sleep mode to reduce power consumption and prolong life. The rate at which data is collected can be changed by simply editing one of the final lines.

you will need:

and of course soldering iron, wire, solder and the arduino IDE and libraries.

Step 1: Breadboard and Testing

Firstly I designed and tested the circuit on a breadboard. Note the original design didn't have an LED, i decided to add this after as thought it would be a nice feature to indicate when logging data. I highly recommend testing the circuit on a breadboard before you start soldering, as many components may have pins switched round or require a different voltage for example.

I have not been able to create an online visual of the circuit but this is the pin connection:

9V battery:

positive terminal >> VIN

Negative terminal >> GND

DHT 11:

negative >> GND

data >> D5

positive >> 5V

Moisture sensor:

negative >> GND

positive >> 5V

analogue pin >> A0

light sensor:

positive >> 3.3V

SCL >> A5

SCA >> A4

ADD >> A3

negative >> GND

SD card:

CS >> D5

SCK >> D13

MOSI >> D11

MISO >> D12

positive >> 5V

negative >> GND

LED:

negative >> GND

positive >> D8 through 220 ohm resistor


You can test if components work and libraries work using the Arduino file and reading the serial output.

If you do not have the libraries need add them by copying the library name at start of code then tools>manage libraries>search>install

Note: You need to create a .csv file for the SD card, do this using notebook and saving as ".csv" and all files not ".txt". Also LED is not in test file but simply use example sketch "blink" and change pin to 8

Step 2: Circuit Board

After successfully making the circuit and checking components transpose this onto a board in desired fashion. I decided to not attach the SD module to the board and use GPIO leads so when I make a project box i can attach it separately in an easily accessible place. On the board I decided to use a 2 pin male and a jumper to act as a switch between 9V battery and VIN as I thought it looked nicer and realistically you won't be switching it on and off regularly. Also i decided to directly mount the moisture sensor and add 2 pins to connect probe to the board. When I made this I had difficulty, as I had to desolder the pins on the modules and resolder vertical ones so the board was flat, therefore I recommend buying modules with pins detached to save time and effort.

Ones you've made the circuit I have attached 3 different variants of code.

V1.0 - contains serial output as well as the monitor code. 5 second cycle

V1.1 - contains no serial ouput and no LED. 5 second log cycle.

V1.2 - contains no serial output but has LED and monitor code. 1 hour log cycle

Step 3: Review

I am very pleased with the project as I believe it works well and fits the purpose. I am hopefully going to design a case and 3D print it and maybe change the power supply to improve the build. As previously stated I have done other versions like this before so if anyone wants to see me upload them or has any improvements or changes they would make please comment below.

Hope you enjoy the build and please leave a like!