Smart Garden

An automatic plant monitoring and watering system, that records the water humidity in the soil and waters accordingly. It also reads the temperature and humidity of the room.

Engineer

Victoria

Area of Interest

Interested in Structural Engineering

School

Lowell High School

Grade

Rising Sophmore

Final Milestone

Demonstration

Explanation Video

After connecting the pump, I encountered difficulties that were not accounted for in my code started showing up. I had added in a two-second delay so that the DHT22 (the temperature and humidity sensor) wouldn’t crash the LCD screen with too much data. But in turn, my whole code would be slowed, and the other two sensors would read every two seconds as well. Since the pump depends on output from these two sensors to know when to turn on, it also turns off two seconds late. While two seconds may not seem like too long, the soil could easily be drowned with too much water, and the pump would run dry. But after tweaking the code with a “while” statement, and changing around the delay time, the pump now prompty turns on and off.

Links

Final Code

Bill of Materials

Build Plan

How it works/ Additional Notes

It looks like I’m just about done with the project, minus modifications. This is an overview of how the Smart Garden works, altogether. It starts with an Arduino Uno, which is powered by a small power brick. Connected to the Arduino are three sensors, a Water Level Sensor (WS), a Soil Humidity Sensor (SH), and a DHT22 Room Temperature and Humidity Sensor. There is a water pump attached, which turns on when the WS reads “full”, and the SH reads “dry”. It also turns off if either the WS reads “none”, or the SH reads “good”. In other words, it turns on if both the soil (currently just a box of soil) is dry and the water tank (currently just a plastic cup) has water and turns off if either the water tank is empty, or the soil is sufficiently watered. There is also a 16×2 LCD screen that displays all of the info. It writes if the soil is “dry”, “good”, or “wet”, and if the water tank is “full” or “none”. It also displays the temperature and humidity, to the right of the screen. There is currently a very long pump that connects the water tank to the soil.

Reflection

Overall, I thought this project was a fun yet challenging way to create something I could use and be proud of. It has taught me a lot about C++, circuit boards, sensors and of course, the Arduino. While I still have a lot to learn, this project has taught me the basics. There were many setbacks, especially in the beginning, when I was completely lost. But as I gained steam, and started to get into my project, I found myself looking forward to jump right into work, and disappointed when I had to stop. My biggest challenge was definitely in the very beginning when I felt as though I knew nothing. I was a bit too shy to ask for help, and spent a day or two aimlessly fiddling around with a raspberry pi I didn’t even end up using. But when I started to code a little bit for my Arduino, it became semi-smooth sailing. My favorite parts were definitely seeing my LCD light up after many errors and looking at odd sources, and finally getting my DHT22 to cooperate with the water pump. Overall, I’m proud of my Smart Garden, with all the time and energy I spent on it, and am ready to start modifying.

Second Milestone

Demonstration

Explanation Video

I encountered two major difficulties before reaching my second milestone. When I first connected the DHT22 Temperature and Humidity Sensor along with a relay that powered the water pump, they would cause the DHT22 to spit out garbage instead of the temperature. So instead of using a relay, I switched to a transistor. It seemed to of fixed the DHT22 for the most part. But then when I wired in the DHT22 along with the Soil Humidity sensor, it caused odd jumbles of text and pixels to appear on the LCD screen. The code seemed to be fine though. So I had to take everything apart and reassemble it. It works fine now, except when the SH Sensor reads dry, the DHT22 gives me odd readings for a second, before it resets itself, as seen in the video.

Current Schematic

milestone-2-fritzing_bb

Links

Milestone #2 Arduino Code

Source for DHT22

Source for Transistor

How it works/ Additional Notes

In addition to the two sensors from my previous milestone, I’ve added a transistor (in replacement of a relay that my guide called for) to power a water pump. It’s powered by 4 AA batteries. When both the Water Level Sensor reads full, and the Soil Humidity Sensor reads dry, the pump turns on. In other words, when the soil is dry and the water tank has water, the pump will start watering. It will soon be able to water the soil via a tube. The DHT22 sensor had caused many problems, I believe because it can only read the temperature and humidity every two seconds, while the other sensors were much faster. The temperature of the room in Fahrenheit is displayed on the LCD screen below the humidity of the air. I’m not sure why, but the temperature reading is much hotter then it actually is. It’s only 60 or so degrees in the room. I’ve also left out the Raspberry Pi entirely, and just wired everything onto the Arduino. I think that if I really wanted networking, I could just use Bluetooth instead. My guide calls for saving the data on AWS, but I’ve moved on from my guide because it’s directions aren’t very good. My next step is to try and fix the momentary glitch the DHT22 experiences, and then permanently wire in the jumper cables. I also want to try programming an app on my phone to read the data via Bluetooth.

First Milestone

Demonstration

Explanation Video

Some difficulties I had were using both the Raspberry Pi and the Arduino on the same project. The only reason why the RPi is necessary is that it has Wifi, so I’ve decided to just set up all the sensors on the Arduino before I figure out the networking. I’m also having trouble fitting all the data on the small 16×2 LCD screen because it must also display the humidity of the air and the temperature. Currently, there is an LCD screen that says whether or not there is water in the tank, and the humidity of the soil. My next step is to write in all the code for these sensors.

Current Schematic

milestone-1.1-fritzing_bb

Links

Milestone #1 Arduino Code

Source for LCD

How it works

There are currently two sensors connected to the Arduino, a soil humidity sensor, and a water level sensor. These two sensors each output a number, which the code translates into text on the LCD screen. The water sensor tells whether there is or isn’t water in the cup. The soil humidity sensor detects water within the soil and displays whether the soil is dry, good or wet. My next step is to add the relay and the temperature and air humidity sensor.

LED Rainbow Light Show

Demonstration

Explanation Video

Some difficulties I had encountered was that I had rushed the soldering, so when I first plugged it in, the LEDs didn’t light up. There was not enough solder in some places, and it was shorted in another place. After resoldering some parts and cutting the short, the lights worked fine. Another difficulty was the stands were acrylic and snapped easily. When I was screwing in a stand, I forced a stand too much, and the tabs holding the nut in snapped right off. I ended up just hot gluing it back on.

How it works

The Rainbow Light Show (RLS) is a microprocessor that uses motion control to light up a LED strip in red, green and blue. The closer an object is to the sensors, the brighter the LED lights shine. The infrared sensors shine an infrared light up, a phototransistor detects how much light is reflected. The more light that is reflected, the more electrical current the phototransistor lets through. Therefore, the closer an object to the sensor, the more infrared light is reflected, then more current is let through, leading to a brighter LED light. The reset button calibrates the sensors in the ambient lighting they are in. When the button is pressed, the sensors record the amount of infrared light and set that as the cutoff. So any light that is weaker then the cutoff amount won’t be detected. Therefore, the sensors can be adjusted to whatever lighting they are in.

Leave a Comment

Start typing and press Enter to search