Gardening in the modern age means making things more complicated and arduous, with electrons, bits, and bytes. Combining microcontrollers and gardening is a really popular idea. I think that’s because gardens have very simple inputs and outputs that are easy to wrap your head around. I guess people (myself included) see a notoriously simple and relaxed hobby and can’t help but feel compelled to overcomplicate it.
In this project I will show you how to build a simpler version of Indoor garden using Arduino Dev board.
I’m providing a full step-by-step guidance to show you how to make your own beautiful garden, and I'm explaining in details both hardware and software parts in order to turn this guidance the simplest way that leads you to try your own skills in electronic making. This project is so handy to make specially after getting the customized PCB that we’ve ordered from JLCPCB to improve the appearance of our car and also there is enough documents and codes in this guide to allow you create your automatic garden system.
We've made this project in just 7 days only, just three days to finish the hardware making and the assemble, then 4 days to prepare the code and the android app. in order to control the garden through it.
Before starting let’s see first
What you will learn from this tutorial :
- Choosing the right components depending on your project functionalities
- Making the circuit to connect all the choosen components
- Assemble all the project parts and start testing
- Using the Android app. to connect through Bluetooth and start manipulating the system
Step 1: What Is an Indoor Garden!
Most plants have simple needs. As guests go, they're relatively undemanding. There are only three basic things you need to understand before you decide to invite a plant home: light, water and air. If you can master these four elements, from a plant's perspective, you can create an indoor garden just about anywhere in the world and during any season of the year.
- Light - Most garden plants need at least six hours of light a day. But it has to be good light. If you put your hand in front of the window and it doesn't cast a shadow, chances are the light isn't adequate for most plants to live a happy life. However, you can always supplement low light conditions with grow lights.If you have modest natural light in your home and don't want to fuss with special lighting, stick to plants that normally need low-light conditions, or try moving your garden to a sunny windowsill.
- Water - Plants need conditions close to those in their native habitats. A plant that calls the desert home will need less frequent watering than a plant that lives in a bog. Knowing what water conditions a plant prefers is a good first step to keeping a successful indoor garden. It's easier than you think because the plants themselves will often give you clues. Plants with thick rubbery leaves are water hoarders and can typically survive with less water than plants with thin, delicate leaves. If you hate to water your plants, choose varieties that can thrive on less, or pick plant-pots with hidden reservoirs to cut down on your watering chores.
- Air - As a byproduct of photosynthesis, plants produce oxygen and filter nasty gasses, like formaldehyde, from your home environment via their leaves. To keep plants healthy, you need to keep their leaves clean and keep the air around them moving and moist. To do this, you can place them in a spot with good air flow or provide them with a small fan.
I will make an Arduino based system to
supervise the temperature and humidity status of my plant and automatically provide its necessary needs like light intensity, water, and pure fresh air and in order to do this I need some sensors to control some actuators. For example I will control the light intensity depending on the signals received from the light brightness sensor the same for watering I used a moister sensor to turn on and off a water pump and temperature/humidity sensor for on and off controlling of a 12V DC fans.
Step 2: Sensors and Actuators
Making this system is the Assembling of some sensors and actuators in order to access the physical data arround the plant and to be able to find which thing is requested by the plant and when should you supply it.
This is the reason why you should use some sensors and actuators all connected to one Arduino board:
- Light sensor BH1750 : BH1750FVI Is a Digital Light sensor , which is an digital Ambient Light Sensor IC for I2C bus interface. This IC is the most suitable to obtain the ambient light data for adjusting LCD and Keypad backlight power of Mobile phone. It is possible to detect wide range at High resolution.( 1 - 65535 lx ).
- Soil moisture sensor : Moisture sensors that measure the resistance or conductivity across the soil matrix between two contacts are essentially junk. First of all, resistance is not a very good indicator of moisture content, because it is highly dependent on a number of factors which might vary from garden to garden including soil ph, dissolved solids in the water, and temperature. Second, most of them are of poor quality with contacts that easily corrode. For the most part you'd be lucky to get one to last through an entire season.
- Temperature & Humidity sensor : The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old.
- Light white LED : A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n junction diode that emits light when activated. When a suitable voltage is applied to the leads, electrons are able to recombine with electron holes within the device, releasing energy in the form of photons.
- Water pump : A pump is a device that moves fluids (liquids or gases), or sometimes slurries, by mechanical action. Pumps can be classified into three major groups according to the method they use to move the fluid: direct lift, displacement, and gravity pumps.Pumps operate by some mechanism (typically reciprocating or rotary), and consume energy to perform mechanical work by moving the fluid. Pumps operate via many energy sources, including manual operation, electricity, engines, or wind power, come in many sizes, from microscopic for use in medical applications to large industrial pumps.
- DC 12V cooling fan : It is important to understand cooling techniques that can be used to preserve the life of your plant by moving fresh air arround the plant when it is required to keep the plant in a healthy conditions.
Step 3: The PCB Making (Produced by JLCPCB)
JLCPCB(Shenzhen JIALICHUANG Electronic Technology Development Co., Ltd.), is the largest PCB prototype enterprise in China and a high-tech manufacturer specializing in quick PCB prototype and small-batch PCB production.
With over 10 years of experience in PCB manufacturing, JLCPCB has more than 200,000 customers at home and abroad, with over 8,000 online orders of PCB prototyping and small quantity PCB production per day. The annual production capacity is 200,000 sq.m. for various of 1-layer, 2-layer or multi-layer PCBs. JLC is a professional PCB manufacturer featured of large scale, well equipment, strict management and superior quality.
Back to our project
In order to produce the PCB, I have compared the price from many PCB producers and I chose JLCPCB the best PCB suppliers and the cheapest PCB providers to order this circuit. All what I need to do is some simple clicks to upload the gerber file and set some parameters like the PCB thickness color and quantity, then I’ve paid just 2 Dollars to get my PCB after 3 days only and I’ve noticed that there is some free shipping offers from time to time in this online ordering platform.
You can get the Circuit (PDF) file from here.
As you can see in the pictures above the PCB is very well manufactured and I’ve got the same PCB leaf shape that we’ve designed and all the labels and logos are there to guide me during the soldering steps.
Step 4: Ingredients
Now let’s review the necessary components for this project and you can find all the related links for an online ordering so we will need:
- - The PCB that we've order it from JLCPCB
- - Arduino Nano : http://amzn.to/2C7g0YW
- - ESP01 Module : http://amzn.to/2CCRVdL
- - HC-05 or HC-06 Bluetooth module : http://amzn.to/2CCRVdL
- - Light sensor BH1750 : http://amzn.to/2CCRVdL
- - Temperature & Humidity sensor : http://amzn.to/2CCRVdL
- - Moisture sensor : http://amzn.to/2CCRVdL
- - Water pump : http://amzn.to/2CCRVdL
- - 12V dc Fan : http://amzn.to/2CCRVdL
- - white LEDs : http://amzn.to/2CCRVdL
- - Some Header connectors: http://amzn.to/2CCRVdL-
Step 5: The Assemble
We are ready now so let’s start soldering the components and don’t forget to follow the labels to avoid soldering mistakes. We start by soldering Arduino connector to test the power supply and you can also write some basic test code to verify the right connection for each sensor like the Light sensor and its the same for the LEDs because they are all connected directly to the board (Arduino) so you have a full acces to them.
Note: You need to keep your soldering iron nice and clean. That means wiping it on the sponge every time you use it. The tip of your soldering iron should be clean and shiny. Whenever the you see the tip becoming dirty with flux or oxidizing, that means loosing it's shinyness, you should clean it. Even if you are in the middle of soldering. Having a clean soldering tip makes it A LOT easier to transfer heat to the soldering target.
The PCB that we ordered from JLCPCBwill guide you keep everything in the right placement so do not hesitate to visit this link if you want to view the PCB that we've made and make an online ordering.
As you can see, using this PCB is so handy
because of its quality and for sure all the labels there provide the best guidance for you, so you will be 100% sure that you will not make any soldering mistakes.
I’ve soldered each component to its placement and you can use both sides of the PCB to solder you electronic parts.
Now we have the PCB ready and all the components soldered very well, after that I prepared this design to make a CNC laser cutting in order to insert the electronic part and the plant in one support, so if you want to make the same design as mine find the (DXF) files here
Step 6: The Android App.
This app will allow you to connect to your Arduino through Bluetooth, and using the Manual mode you can have access to the fans, and lights and also the water pump for ON and OFF controlling, without forgetting the sensors that you can read them data by pressing the “get data” button and all the appropriate data will be displayed on your smartphone screen.
You can get this android app for free from this link
Step 7: The Arduino Code and Test Validation
the code is available and as usual you can download it from this link. And as you can see in the photos the code is so simple and very well commented so you can understand it you own.
As you can see guys each button has a functionality with the system but what I really appreciate is the automatic mode for light brightness control I placed the light sensor at the lower base of the house then when we select this mode the system will control the brightness of the front light LEDs depending on the sensor signals. Also we can read the temperature and humidity values directly on the screen of the smart phone which is really impressive.