Introduction: Awesome Greenhouse With Automatic Watering, Internet Connection & Much More
Welcome to this Instructables. On beginning of march, I was in a garden shop and saw some greenhouses. And since I wanted to make a project with plants and electronics for a long time already, I went ahead and bought one:
Before reading, I ask you to check out the other Instructables in the "indoor gardening" contest and vote for your favourites (maybe also my one?) =) Thanks.
I wanted to have the following features:
- Soil humidity sensors
- Pump for watering
- DHT11 for air temperature and humidity
- Automatic ventilation
- Time-lapse function
- Internet control
It also sends you an E-Mail once the water tank is empty.
Since you probably do not have the exactly same functions in mind, and also not the same materials as me, I will write this Instructables more generally.
Step 1: The Water Source
What I learned that you should definitely begin with looking for a water source. Because now afterwards, I could not manage to add a big enough container in the box. My initial plan was to 3D-print a container, but I quickly realised that it is not the best and most reliable solution.
I then tried to use a 0,5l water bottle and make an adapter for it, but once again it was not tight at higher pressures. What I ended up doing is just zip-tieing the bottle to my box. Also, I cut the tube and then in the end about 20cm missed. I 3D-printed a small pipe to add a new piece. However, that is not the best solution yet and I am still searching for a better alternative.
Step 2: The Greenhouse and the Wooden Box
After looking for a good water storage, I would beginn with the greenhouse. I found one in a local store for a pretty affordable price, and also with sufficient space. Do not underestimate the needed space for all the electronics!
I began with building a wooden box, whose wood I reused from an old guinea-pig shed. Obviously, you will have to find your own dimensions. I decided to use 3D-printed corners to get a nicer connection to the round greenhouse. While this does look nice and also is easier, I think it would have also be good if I only printed an adapter for the top part.
Later I decided to add two handles (which I had to remove of for the bottle) and also hinges to use for the greenhouse top and some mounts for a rubber band. Everything was designed with the great CAD-program Autodesk Fusion 360 and printed on my Ender 3 with Redline PLA. You can find the files on thingiverse because I think they are useful for many applications.
Step 3: The Arduino and Circuits
I chose to use an Arduino MEGA 2560 simply because I had one laying around and also to have enough pins. I ordered a ENC28J60, because it was way cheaper than the alternatives, however I only later realised that it is a really old module with limited functionality. I got it to work with Blynk, however it is very sensible to the power input, for example when the pump is activated. Powering is also a big problem, because it is very hungry. I soldered a shield using a buck converter and also added a big capacitor.
I do recommend choosing one of the more expensive modules. Also, a crimping tool is highly recommended. However, I do not have one and thus, I decided to solder an adapter circuit which connects everything. Solid copper wires were used.
The copper wires were also used as soil sensors. For that, we need a voltage divider. I did the same with the water sensor. For the pump, I used a relais and for the camera, an ESP32-Cam board, as well. Initially, I wanted to run it all the time, but I realised that pictures were not visible at night, though the flash was used.
Powering everything also turned out to be more challenging, every time the pump was activated, the ethernet adapter lost connection. I am still waiting for a bigger wall plug, but I think 9V, 2A should be fine. I did connect the adapter with the on-board jack on the Arduino, though I am aware that this is not the best solution because it needs to go through the PCB of the Arduino. I recommend looking for a different solution, like a breakout-board or so.
To connect the components on top, I made a small adapter so that the wires for the servo motor are enough and also could be removed if needed. Two cheap SG90 servo motors were used and I found them to be completely enough.
Also, I made my own soil humidity sensors from a 3D-printed part and some copper wire. Those work really fine.
The ESP32-cam board was powered over another relais. I followed this tutorial from BnBe club, however I set the timer to 30 minutes. He also helped me at my first try to use a transistor, however the ESP is just too sensible for that. I printed a really nice case made by Electronlibre on thingiverse.
Step 4: Mounting Electronics
Next, you should find a way to mount everything. For the Arduino as well as for the adapter board I printed a small piece. I am not exactly happy with the case for the Arduino, because assembly is very difficult. However, I am very happy how the ventilation flaps worked out. It is a print-in-place design, so the hinge is included. I used a piece of wire to be able to pull the flaps up.
The soil sensor is also available on thingiverse. I printed 6 of them.
Step 5: Water Circuit
I decided to make a wooden frame to hold the water pipe. The plan is to make small holes where the water can flow out. A big difficulty is to make everything water-tight. I learned that you should think very much about making holes into the plastic form...
There is also a pipe that will go back to the water tank. I found the pipe to be too short, therefore I made a hole into the bottle.
There is even a water sensor in the bottle, which is just a wire taped to the pipe. I noticed it began to rust after some time, a friend on Instagram recommended to use switching current (NOT directly out of the wall, obviously...) to prevent this. Now after a few days, there is electrolysis, so I highly recommend not to do this!!! Better use a ultrasonic distance sensor or so. Or you might try using a relais to turn it on only a few times in a hour.
I am pretty happy with the pump, you should choose one which is beginning to pump automatically! Mine can be powered from 6V to 12V, so 9V was fine.
Step 6: Programming
Since I am neither very good, nor does it make fun to me, I decided to use Blynk over programming everything. I also bought some more energy in the app to have more freedom. The sketch is pretty easy, you might need to adjust it!
You will have to insert your key and your email.
The app is fully customisable, so you can design it how you want.
Step 7: The Final Result
Last steps were to assemble everything and - obviously - plant something. I decided to go with basil.
It is important that it has enough water, so I began with manually watering it.
I had it running only for testing, so I will keep you updated as soon as the wall adapter arrives.
Edit: The wall adapter also did not help much. But I am very sure that the problem is the ethernet card, because the Arduino has no problems switching the pump without blynk. So, you should definitely buy a better module!
I hope this Instructables inspired you, or gave you some helpful tips. If so, maybe consider voting for the "Indoor Plants" challenge and check out the other Instructables! Thank you for reading.
Second Prize in the
Indoor Plants Challenge