You are on page 1of 9

instructables

Arduino Plant Monitor

by stregoi

Favorite The plants can be monitored online as well. In my


setup i have 16 plants. To make this Instructables
It can be hard enough to keep your plants alive and short and clear i am not going into details explaining
healthy if you dont have time to water them. It gets how software and hardware works, instead i will link
even harder if you are a trying to plant different to Instructables, that can explain topics. I will also
species that requires different climats conditions. share Both my code and schematics, which are
commented.
The Idea with this build is to make a seedstarter /
mini-Greenhouse where i can mimic the necessary Enjoy, and please remember to comment if you have
conditions for different plants. any suggestions and ideas .... and if you like my
Instructable project, please vote for my entry to the
Every one of my plants, have a special watering / contest:)
lightning and temperature needs. The requirements of
each one are stored in a database, and the plant is ( I will keep editing the Instructables over the next
monitored through 3 sensors (Light / Temperature / couple of days, uploading my code and so on :)
moisture). Whenever a sensor register a value bellow
the saved threshold the Arduino reacts, by turning the
water pumps, lightning or the fan to cool the plant.

Arduino Plant Monitor: Page 1


Step 1: List of materials

Here is what you needs : 74HC595 shift registers - 1 USD for 10 pieces

Micro-Sprinklers, 20 nozzles, 10 meter hose - 8.90 74HC4051 multiplexers - 1,85 USD for 10 pieces
USD
16 channel 12 V Relay - 12,52 USD
Storage Plastic box, 45 L, 56x39x28 cm - 5.73 USD
NPN resistor - 1,35 USD for 5 pieces
Mini Water pump DC 3-12V RS-360SH - 3.94 USD
moisture sensor - 1,12 USD
Normally close, solenoid valve, 12 V - 5.2 USD
PCB manifacturing - 17 USD ( you get 10 copies ! )
Ultrasonic Module HC-SR04 - 1.21 USD
Aquarium Plastic tube, 3 meter - 2,89 USD
Photoresistor Sensor Module - 0,99 USD
many x wires and connectors
Arduino mega 2560 - 6 USD

Adafruit CC3000 wifi module - 44 USD

Arduino Plant Monitor: Page 2


Step 2: The Frame And Earth trays

The Frame: The Trays:

The frame it self is made of an old IKEA Expedit, the The trays were made from som cardboard, i cut it so it
one i had laying around had 16 holes in it, which was could fit inside the boxes of the closet, and the
great for what i intended to do. It wasn't manipulated cardboard pieces were taped together. The cardboard
what so ever. Every square was 39x39x39 cm, large tray was then set inside a plastic bag, to make it
enough to starting a grow of a plant. water resistant and then filled with some earth.

Cost : I had stuff so i used - 0 USD ( A new IKEA Cost : I had stuff so i used - 0 USD
Expedit - 82 USD )

Step 3: Watering Sprinklers

Watering Sprinklers: the holes of the sprinklers were too narrow for my low
pressure pumps so i had to make the hole a bit bigger
I was quite in doubt here on how to proceed , there using a drill, i went with 1 mm hole, that worked fine.
are different options, starting by just setting the water Then i secured the sprinkles at the top of every box
tube into the tray and let the water run or use with some wires and staples.
something to spray the plat from above. I decided to
go with the second Option. Cost : Micro-Sprinklers, 20 nozzles, 10 meter hose -
I found some Micro Sprinklers in E-bay, They seemed 8.90 USD
fine since they only sprayed on a small area, so the
wall of my boxes didn't became wet. Once received,

Arduino Plant Monitor: Page 3


Step 4: The water Container

The Water Container: The Pumps:

The water container is made of a storage plastic box For the pumps i chose 3-12V low pressure pumps,
from IKEA, The box holdes 45 L. In the cover i cut although they are a bit noisy, but it wasn't that bad,
holes with my soldering iron according to the and they worked as they should. The pumps were
placement of my pumps. That way the wiring of the secured to a piece of wood of the length of the water
pumps was outside the box. container, and went through the holes that were cut in
the cover of the plastic container cover.
Cost : Storage Plastic box, 45 L, 56x39x28 cm - 5.73
USD Cost : Mini Water pump DC 3-12V RS-360SH - 3.94
USD ( I used 16 of these = 63 USD )

Arduino Plant Monitor: Page 4


Step 5: Adding Filling valve and Ultrasonic sensor

The Filling valve: The Ultrasonic Sensor:

The Filling valve is a normally close 12 V solenoid For automatic refilling the container, i had to know to
valve. At the side of the plastic container i cut a hole level of the water. To achieve that, a couple of
with my soldering iron, and the valve is secured with options are available. You can either use a water
a wire and glued with a glue gun. The Valve is then sensor with a couple of wires or use a Ultrasonic
Attached to a watering hose. sensor. I went with the second option as i found it
more reliable. I cut a couple of holes at the cover of
Cost : Normally close, solenoid valve, 12 V - 5.2 USD my plastic container and then i secured the Ultrasonic
sensor to it with a glue gun.

Cost : Ultrasonic Module HC-SR04 - 1.21 USD water level

se this instructable for more details about measuring

Arduino Plant Monitor: Page 5


Step 6: The software : The web interface

The Web Interface: Details.php

I wanted to be able to control the growth of my plants The detail page, shows information about the chosen
through my plants and also be able to follow the plants, here it displays the last read sensor value
statistics of every plant. I am no programmer, so from the moisture, temperature and light sensors, the
surely the code can be written more effectively, but it values are read by connecting to thingspeak.com. in
works !. addition to that i have toggle switches to manually
activate the water pump, the growing light and the
The website is programmed through JQuery/PHP and fan.
i used a MySQL Database. The website is hosted at
000webhost.com which is a free web hosting service. Stats.php
I wont go into details of explaining the code, but i will
be listing the function of pages i have. I will attach my The stats page shows the values mesured by my
code here so it can be used freely. sensors. The values are presented in a chart. The
values are read by connecting to thingspeak.com.
Index.php There i made a channel of every plant. Every channel
have 3 fields; moisture, temperature, light.
The index page, listes the plants i have, their picture
and name, date of planting and the remaining days to Info.php
harvest. It simply reads the database and displays it.

The info page shows different informations about the


plant.

Arduino Plant Monitor: Page 6


Step 7: The Software : The Arduino

The Arduino software: upload the values to the thingspeak.com website,


then those values are compared to each plants
The hardest part for me was the electronics and the needs, if the program findes it necessary the pumps
coding for the Arduino, as i mentioned earlier i am no are turned on, so the plants gets water, light and air
programmer, so i had to make a lot of research and according to its need. Those are turned on though a
many questions at the Arduino forum. A Special shift register. Between every second watering, the
thanks for Kurt Mckelvey, who helped with some ultrasonic sensor measures the depth of water inside
good advices. the container, and then open the solenoid valve if the
water level is low. The internet connection is then
I am not planning to go through my code here, as i closed. The cycle runs 3 times a day.
am going to attach it here and share it, but i will just
explain the logic behind it. Se This tutorial to understand more about shift
registers, and this tutorial to know more about
In the loop section, the program starts by connection multiplexers.
to the internet through the wifi module, then reads the
sensors values through the multiplexers, and then

Arduino Plant Monitor: Page 7


Step 8: The Electronics

The Electronics: 5 x 74HC4051 multiplexers - 1,85 USD for 10 pieces

That was a confusing part, and needed a lot of 2 x 16 channel 12 V Relay - 12,52 USD each
research, a journey where i learned a lot of stuff, and
this was a big reward itself. At the beginning, i was 1 x NPN resistor - 1,35 USD for 5 pieces
only thinking about making a project involving
moisture sensors for 32 plants, and as the project 32 x moisture sensor - 1,12 USD Each ( 35,84 USD )
evolved and got a bigger picture, the light and
temperature sensors idea emerged. I had also a many x wires and connectors
better idea on how to optimise the hole settings.
Unfortunately i am only going to share my old PCB manifacturing - 17 USD ( you get 10 copies ! )
hardware involving the first set-up, since i want to
want to add my project to contests, and i did not Shift registers and multiplexers:
receive the parts for the light and temperature just
yet. I went with an Arduino Mega due to the many pins
needed. In hope for decreasing the number of the
I am sure this part will confuse alot of digital pins i used 4 shiftregisters, that way 3 Arduino
people,sorry for that, but as soon as i will get the pins allowed me to control 32 water pumps, and for
boards and solder, i will update this step. the analog pins i used 5 multiplexers, 1 Master, and 4
slaves, that way using 6 digital and 1 analog pin of
I had a lot of trial and errors soldering the parts, and my Arduino i could control 32 sensor inputs.
due to the many connection of the shift-registers and
the multiplexers and lot of wires i got confused. The Wifi and moisture sensors:
solution to that was to make a PCB, that was a totally
new field to me. After a bit of research i made my self I used the Adafruit CC3000 wifi module. For the
familiar with the Eagle software, i drew the moisture sensors i used 32 cheap moisture sensors,
schematics and then sent it to manufacturing though To avoid corrosion of my sensors i used a transistor,
dirtypcbs.com, a cheap, and reliable service. so the moisture sensors are only powered when the
reading takes place.
Costs :
Relay:
1 x Arduino mega 2560 - 6 USD
The pumps and solenoid valve are connected to the
1 x Adafruit CC3000 wifi module - 44 USD Arduino though 2, 16 channels, 12V relays.

4 x 74HC595 shift registers - 1 USD for 10 pieces

Arduino Plant Monitor: Page 8


Step 9: Testing

Here i am sharing a bit of my testing of the fan, the water pumps and the lights though my relays. Sorry for the
quality of the video. I was using my Gopro, so a bit difficult to sight when you don't have a screen. But anyway it is
showing the Concept :)

https://youtu.be/rPVhWhPvuyk

Step 10: Final Thoughts

Arduino Plant Monitor: Page 9

You might also like