Introduction: Automated Greenhouse

We decided to design a greenhouse as subject for our electronic project. The goal was to regulate the temperature inside the greenhouse thanks a lamp, a servomotor to open a window and a PC fan. We wanted to maintain a quite constant level of soil moisture with a pump and to receive temperature, soil moisture and luminosity measurements. Finally, we designed a website to be able to control it remotely.

This project was made for our electronic course and we wanted to use a raspberry pi and an arduino board. We know that it can be improved in so many ways but we want to give you ideas to redo it and improve it.

Step 1: Presentation

This greenhouse has different sensors to measure the ambient temperature, the external temperature, the soil moisture and the luminosity.

The ambient temperature sensor allows us to start the fan and to drive a servomotor to open the window when the internal temperature is above the temperature setpoint. Conversely, if the temperature descends under the temperature setpoint, the fan is stopped and the window is closed. Furthermore, a lamp is switched on to warm the plant. The soil moisture sensor allows to drive a pump and an electrovalve for the watering system when the earth is too dry.

Thanks to a USB cable, the Arduino uno board is connected to the raspberry 3 board. This connection allows us to recover the measures and the states of actuators. These data are stored in a mysql database. A script in python allows us to communicate with arduino uno (master/slave communication) and save the data in the database or read the database and send new values in the arduino.

Next, an apache server is installed on the raspberry in order to host a website. With the help of php, we can make the bridge between the mysql database and the website.

On the website, we can define the temperature and moisture setpoints. It is also possible to control each actuator manually and to look their states.

Step 2: List of Components

We wanted to use as much as possible components stemming from the recycling

Step 3: Coding

For this part, we give you the different programs and code that we made for this project:

Arduino's program:

The new version is now available. The issue with the window is now fix and some little bugs.

Raspberry:

We installed the MySQL server and the Python bindings for MySQL. For the web server we installed the Apache2 package

Website:

The CSS files are now available in the .rar folder.

Raspberry script:

For this script, we used the MySQLdb library. You need to use python 2.7 to be able to run the script.

The script is the bridge between the arduino and the raspberry pi. It allows us to save the data from the arduino bord into the database and send the new setpoint values defined by the user into the arduino program.

Step 4: Mounting

Step 5: Wiring

Step 6: The Website and Database

EDIT: The new version of the website is now available.

The website that we disgned is composed of three pages.

The first one is the main page. With this page, the user can see the states of the devices and the different measures.

The second page, Commands and parameters, the user can easily change the device's mode and switch them on or off. The setpoint values and the parameters can be changed on this page too. For the parameters, we validate the new entered value to be sure that it is correct.

The last page is just about us.

Our database is made of three tables. The "mesures" table is dedicated to the collected data storage.

The "types" table contains the parameters of each measurement and the "commandes" table allows us to control the devices and to know their state.

Step 7: Time to Save Your Time and Your Plants

This is it! You have all the tools to make your own automated greenhouse !

You can take a look to the video to see the automated greenhouse in action.

Feel free to contact us if you have any questions !

Guillaume, Mathieu, Vincent and Kevin.

Engineers from Isicht Mons

Others cool projects ? Visit : https://electroniquehelha.wordpress.com/

Comments

author
tmsraji99 made it!(author)2017-06-20

nice one.

i want do these project part of my academic year final year project i have lot of confusion can you explian where to i am start what is the process and all other things .

my mail id::tms.raji99@gmail.com

author
jacktravis made it!(author)2017-06-14

Salut, auriez-vous des plans plus explicites pour la réalisation de votre serre ?? Comme par exemple un plan plus détaillé pour réaliser la fenêtre!!

merci

author
hughneri made it!(author)2017-06-01

Im very new to micro controllers and website hosting, but what do you do with the website files in order to have them run on the Raspberry Pi?

author
SalvatoreC20 made it!(author)2016-11-26

What is a socket and a connecting box? And where can i buy them? Can i have a photo of the two components?

author
SalvatoreC20 made it!(author)2016-11-25

Hi,this is a great project! Could you do a clip when you mount all the components? This would help a lot! Thanks! Anyway my mail is salvatoreciaramitaro12@gmail.com

author
TUPT-3H1+COET+2016 made it!(author)2016-10-09

WE MADE IT, yey THANK YOU SO MUCH .. we surpassed

IMG_9762.JPG
author
diy_bloke made it!(author)2016-10-11

Maligayang bati sa inyong proyekto

author
JasminR8 made it!(author)2016-08-01

hi kindly email me the english version of all the codes jazz.recupero@gmail.com THANKS .

author
diy_bloke made it!(author)2016-10-09

Jasmin, I doubt that anyone would make a seperate program with english comments :-)
Anyway for the compilation it shldnt make any difference, but maybe for yr understanding it would.
The remarks appear to be french, cant google translate help? is there an specific word you are struggling with?

author
JasminR8 made it!(author)2016-08-01

we're having a hard time translating the codes to english ... please help us .. thank you !!!!!! EMAIL ME jazz.recupero@gmail.com

author
JasminR8 made it!(author)2016-08-01

please email me the english version of all the codes .. we are currently doing this project .. we just don't understand why it came up with that kind of language , email me jazz.recupero@gmail.com

author
GiuseppeB27 made it!(author)2016-06-30

Great project. Can you post the list of components with the relative reference to buy it on internet. thanks a lot.

author
LeeC93 made it!(author)2016-06-19

Script_Arduino_BDD_1.0.py

so the script is run using python

Basilic_V2.1.inoBasilic_V2.1.ino

this is easy use my PC to put code to the arduino

I think I have php5 installed,

not sure how to test php5

I have Apache2 installed

when I go to a web page 192.168.1.104

I see

It works!

the default web page

Website.rarWebsite.rar

I can not get my PI to extract an RAR

I had to do that on a windows

you should use tar files

so where do move the extracted website.rar files too on my PI

in order to get it to work

Then I run python script, right?

Lee

author
Giedriukas made it!(author)2016-06-13

there is another version built by Technarium hackerspace https://github.com/Technariumas/opengreenhouse

author
SethPM made it!(author)2016-06-12

While more expensive than a servo. You could use a stepping motor for your venting. You just need two pieces of acrylic with slots. This way depending on how they overlap you can vary how much air is allowed to escape. This way with some testing you could figure out how many steps the motor needs to do for specific temperature drops for different types of plants.

author
Nestordane made it!(author)2016-06-03

Is your green house suitable for growing auTomatoes?

Just kidding, great project!

author
diy_bloke made it!(author)2016-05-31

Other than a technical remark, let me also make a growers remark.
As the housing is of clear plastic, obviously it will receive its light from the sun. The lamp, i understood, is to maintain temperature. Beware though that this means that if it is night, and the temperature drops the lamp might go on disturbing the dark/light rhythm eventhough it is an IR lamp. Though for some plants this is not a problem, for other plants it is.

http://www.ehow.com/about_6744341_effect-infrared-...

There is an LDR, so I guess there is a possibility for protection against that (not switch on the lamp when it is night) but that might be defeating the purpose. Consider a ceramic heater.

When checking the software, I came upon some statements that were more complicated than necessary. e.g.

if (temp_int <= (tempmoyenne - deltat))
{
chauffage = true;
}
if (temp_int >= tempmoyenne)
{
chauffage = false;
}
if (chauffage == true)
{
cmdlog7 = 1;
}
else
{
cmdlog7 = 0;
}

couldnt this be replaced by:

if (temp_int <= (tempmoyenne - deltat))
{
chauffage = true;

cmdlog7 = 1;
}
else // or if really necessary: if temp_int >=tempmoyenne)
{
chauffage = false;

cmdlog7 = 0;
}
I am not sure what values 'deltat' can have but if it is 0 your loop gets confused. Unless it is really necessary to have a state in which your chauffage is false but your cmd7 is still true

author
WORMSS made it!(author)2016-06-02

I may be boiling stuff down to a silly level here, but a IR lamp generates electromagnetic waves in the IR frequency and not the visible frequency.. The ceramic heater generates heat, which is the electromagnetic waves in the IR frequency and not in the visible frequency.. Can the plant tell the difference?

author
diy_bloke made it!(author)2016-06-02

I knew someone would point out the relation between thermal radiation and heat ;-)

Well yes you are right. The main point I tried to make was that the IR lamp right above the plant might disturb the daylight cycle and when I quickly suggested another heater (wether ceramic or not), I kinda was thinking putting it in another position than the lamp right above, maybe even behind a wooden screen so there would be mainly convection heat. Admitted though that als such a wooden screen would warm up and radiate heat... which again would be infrared, however, not as much as a lamp right above.
Eventually ofcourse upon warming a greenhouse, every material in that greenhouse would radiate a certain amount of infrared, but I just wanted to keep my comment a bit limited, thinking my main point was made.

But sure you are right, the best way to heat would be warm air so it would be convection heat, but in a greenhouse this size that might be a bit of a hassle to keep the heat source ' out of sight'

author
ViDes made it!(author)2016-06-01

Thank you for your remark.

We know that with the using of a simple lamp could disturb the day/night rhythm. We considered the use of a ceramic heater. In fact, we can easily change the lamp without changing the code. The restriction for the night is a very good idea for the optimization .

For the software, we are still working on it to fix some issues and simplify the code ;)

author
BarryV made it!(author)2016-06-02

nice

author
diy_bloke made it!(author)2016-05-31

Very cool though having both an Arduino and a Raspberry may be a bit overkill. Admitted, a MySql server on an arduino is a bit too much, but the Raspi could have read moisture etc..
It seems you are reading the soil moisture with an analog port. The module you are using has a digital and analog output I believe... but if you are using the analog output you dont need the module, as it is directly looped through to the sensor.
Greenhouse looks great, now I would love to see that one scaled up.

I support the suggestion for aliexpress

author
ViDes made it!(author)2016-06-01

Thank you for your remark.

This project was made for one of our electronic courses. So we wanted to explore some possibilities to use an Arduino board and a Raspberry Pi. We are aware that this solution is a bit overkill ;)

author
WORMSS made it!(author)2016-06-02

Would using nodejs be a bit easier for direct SQL database access rather than going via PHP?

author
PascalC12 made it!(author)2016-06-02

Tomber là-dessus alors que j'ai justement des étudiants qui ont fait un projet équivalent et qui soutiennent demain. Ca méritera un instructables également :)

author
dvlr made it!(author)2016-05-31

très bon instructable les gars.! pourquoi n'avez vous pas intégré directement une version hydro ou aeroponique ?.
why didn't you adapt this with Aero or hydroponics?. Anyway awesome work done, congrats.

author
ViDes made it!(author)2016-06-01

Merci ! C'est vrai que nous n'avons pas pensé à ces deux solutions. Dans l'état actuel du projet, cela demanderait quelques modifications structurelles ainsi que logicielles. Le projet que nous avons fait ici est surtout fait pour donner des idées aux gens et leur permettre de l'améliorer ;)

author
J-Max made it!(author)2016-06-02

Très instructif et inspirant en tous cas ! Merci ;)

author
Multidomar made it!(author)2016-05-31

Cool project! It could be so much cheaper when you bought the electronics from Aliexpress ;)

author
ViDes made it!(author)2016-06-01

Thank you for your tip :) We don't usually use Aliexpress but we will consider it next time.

author
dangduyhao made it!(author)2016-05-30

This is Awesome. <3

author
ViDes made it!(author)2016-06-01

Thank you ! :)

author
DIY+Hacks+and+How+Tos made it!(author)2016-05-30

This is awesome. You need to enter this in the Automation contest that is currently running.

author
ViDes made it!(author)2016-06-01

Thank you ! :)

author
GloriousDJ made it!(author)2016-05-31

Could you show how you made your green house?

author
diy_bloke made it!(author)2016-05-31

I realized that my comments may sound too critical. That was not my intention. I think your project is fantastic and just the design of the greenhouse is worth a lot of compliments

About This Instructable

71,118views

877favorites

License:

More by ViDes:Automated Greenhouse
Add instructable to: