3D-Printed Arduino-Controlled Hydroponic Garden

by rj2006 in Circuits > Arduino

6794 Views, 76 Favorites, 0 Comments

3D-Printed Arduino-Controlled Hydroponic Garden

Screen Shot 2021-12-29 at 7.10.56 PM.png

Building a device that waters plants is something we all have wanted to or tried to build. Forgetting to water plants is a common struggle, and, in a hydroponic system such as mine, a flow of water from above helps keep the clay substrate moist and allows for nutrients to reach the roots.

I wanted to build something that gives the plant a little bit of water every day. I needed something that could control the water and timing, so I turned to Arduino. However, I don't have a water pump or anything that could control water, so I had to get creative with 3D printing.

This project is a prototype solution that definitely has some issues and areas for improvement. I designed it to use minimal specialized parts and turn whatever I had in my parts bin into something that could actually work. There are always simpler and more efficient solutions on the market, but it's more fun and challenging to do it yourself!

This article covers less of the specific 'click-here' instructions but provides higher-level details and ideas for how to replicate my version of a solution. I hope it gives you some inspiration to try building one yourself!


Supplies

This project uses a Hydroponic Setup, an Arduino microcontroller with some modules, and some 3D printed parts.

Each of those will be explained in-depth in the steps, but this is the list of components:


Hydroponic Setup:

  • LED light strips
  • Power adapter
  • Wall socket timer
  • Growth medium/method (I used a wicking system)
  • Plants!

Arduino:

  • Arduino Board
  • Power supply (battery or cable)
  • Photoresistor
  • Servo
  • Resistor (10k ohms)
  • Wires

3D Printed Parts*:

  • L-Joint for Bottle
  • L-Joint for straws
  • Water Valve/equivalent controller

Other:

  • Straws
  • Plastic Water Bottle


* I haven't provided the STL files for the 3D designs I created for this project. They are prototypes that still have many iterations ahead of them. However, part of the fun is in creating your own parts, and I hope you have enough guidance from this article to create your own parts that work even better!

Hydroponic Setup

Screen Shot 2021-12-29 at 5.54.20 PM.png
Screen Shot 2021-12-29 at 8.52.20 PM.png

The lighting system here uses two LED strips that connect to a +/- wall adapter supplying 12V. I have the adapter plugged into a timer intended for outdoor lights (e.g. Christmas lights), and have the lights on from 6:30 AM to 7:30 PM, giving the plants enough light to survive. There are two 30 minute breaks throughout the day that allow the lights to cool a little bit, which I am going to use as the trigger for the watering mechanism.

The actual plants use a system similar to the one in the second image The nutrients are not dissolved in the water, they are dispersed in the growing medium (calcined clay) in the form of small pellets. As the roots grow, they move lower towards the reservoir, eventually growing straight into the reservoir. This means that, eventually, no water makes it up to the clay, and the nutrient pellets, which require moisture to release their nutrients, stay dormant. This means that the plant doesn't get any nutrients, which can lead to the plant not being able to survive. The watering mechanism helps keep the clay moist.

Arduino

Screen Shot 2021-12-29 at 6.11.36 PM.png
Screen Shot 2021-12-29 at 6.12.27 PM.png
Screen Shot 2021-12-29 at 6.12.52 PM.png

To water the plants, I'm using an Arduino. It uses a repetitive piece of code that checks the amount of light on the plants and actuates a servo if the conditions are met.

The condition for the light is whether the amount of light falls below a certain threshold, which indicates to the Arduino that the lights on the hydroponic setup are off for one of the two breaks during the day.

When the lights are off, the board tells a servo to turn to a specific angle, which opens a special 3D printed valve and lets water flow from the water bottle to the plant using gravity. The details of the parts and water tubes are shown in the next step, after this code breakdown:

  1. Code establishes the servo and specific values that indicate angle values and light levels for reference
  2. Code sets the valve to closed (just to be safe)
  3. Code gets a measurement from the photoresistor, giving us light level
  4. If the light level is less than the threshold, initiate the watering process
  5. If it's greater than or equal to the threshold, do nothing

Throughout the code, you will see the use of the variable 'complete'. I used this to make sure the system doesn't water the plants every time it measures the light (every second) when the lights are off. That would turn into a watery mess. The watering process is completed the first time it runs through the loop, but it assigns the value complete to an arbitrary value greater than 0. The next time it goes through the loop, it is redirected such that it doesn't do anything. Turning on the lights resets the complete value, so the plants get watered in the second light break as well.

3D Printed Parts & Water Tubes!

Screen Shot 2021-12-29 at 6.22.33 PM.png
Screen Shot 2021-12-29 at 6.33.20 PM.png
Screen Shot 2021-12-29 at 6.35.08 PM.png
Screen Shot 2021-12-29 at 6.35.19 PM.png
Screen Shot 2021-12-29 at 6.35.41 PM.png
Screen Shot 2021-12-29 at 6.35.52 PM.png
Screen Shot 2021-12-29 at 6.36.06 PM.png

Turning a servo doesn't move water, so I had to create something that would move the water from the bottle to the plants. Drinking straws were a good option, so I used those as the 'pipes'. However, I couldn't bend the straw to change its direction, as it would kink. More importantly, I couldn't turn off the water flow using just straws.

This meant I had to get creative. I needed to design parts that would fit around the straws and control the water.

To solve the straw-bending problem, I used CAD to create an 'L-Joint' that I could plug into the side of a bottle as well as another L-Joint that just connected two straws.


Water Valve

Screen Shot 2021-12-29 at 6.39.30 PM.png
Screen Shot 2021-12-29 at 7.16.19 PM.png
Screen Shot 2021-12-29 at 6.40.01 PM.png
Screen Shot 2021-12-29 at 6.40.23 PM.png
Screen Shot 2021-12-29 at 6.41.11 PM.png
Screen Shot 2021-12-29 at 6.41.19 PM.png
Screen Shot 2021-12-29 at 6.59.29 PM.png

The water flow problem was a different issue altogether, warranting its own section.

I originally tried using the servo to pinch the straw and stop the flow. However, it did not stop the water fully, so I designed a new mechanism, which I call a 'rotary valve'.

This valve uses a servo to turn a small section of pipe to an angle, disconnecting the flow of water and blocking water from moving. The images show its function clearly.

To control it, I created a flat mounting point for a servo arm.

The tolerance between the inner rotating part and the outer housing was 0.025 in, which translated well into the real thing. I put grease in between the two to make the gap watertight.

I mounted the servo arm to the inner disc and mounted the servo itself to the outer disc. It worked very well.

I attached a video of it working on a 5-second interval, so you can see the open/close of the tube.

Downloads

Final Assembly

Screen Shot 2021-12-29 at 7.00.00 PM.png

Now the three systems would come together.

I took the rotary valve and plugged the servo into the Arduino, and I connected the tubes for the water to the valve. I put the output end of the system at the base of one of the plants.

I experienced many issues in getting it to work, and it still isn't a perfect system. When I turned it on, I got to see exactly where I didn't put enough glue when the water leaked out from a couple of spots. The valve also experienced some slow leakage. After a generous amount of glue and grease, the system was working and the valve was dripping very slowly, nothing that a cup under it couldn't fix.

This project wasn't intended to be an absolutely perfect solution. As I said earlier, there are always better solutions one can buy, but it was a fun project to bring three amazing hobbies together. I highly encourage you to challenge yourself and try to use what resources you have to solve difficult problems. It won't always yield the most effective solutions, but it certainly will be a lot of fun!