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/
46 Comments
11 months ago
Would you be able to help me to build pilot project. I am very new in the area but eager to learn. Thanks!
Question 3 years ago on Step 2
Greetings! I am wondering why two 4-Channel Relay Modules are needed in this design? There is only one in the schematic.
I think this is a great project, BTW!
Let me know!
Best,
Question 3 years ago
Can you make a scalable model for say an area of 43000 sq. ft with use of AC & humidifiers
Question 3 years ago
Dear friend. Please send me the database files. Thank you in advance.
3 years ago on Step 3
Upload in c programming language
4 years ago on Step 2
anybody got .sql file?
Question 4 years ago
Hello, can you give me .sql file, i really wanna try your project. Thx
Answer 4 years ago
i'm stuck in this.
can anyone give me an idea if it's ok or not
i sitll don have all the sensors so i can test it withou errors
-- phpMyAdmin SQL Dump
-- version 4.6.6deb4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: 21-Mar-2019 às 00:15
-- Versão do servidor: 10.1.37-MariaDB-0+deb9u1
-- PHP Version: 7.0.33-0+deb9u3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_basilic`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `commandes`
--
CREATE TABLE `commandes` (
`Etat` int(10) NOT NULL,
`NombreDem` int(10) NOT NULL,
`Mode` int(10) NOT NULL,
`ComManu` int(10) NOT NULL,
`Equipement` varchar(50) NOT NULL,
`ComManu` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Extraindo dados da tabela `commandes`
--
INSERT INTO `commandes` (`Etat`, `NombreDem`, `Mode`, `ComManu`, `Equipement`) VALUES
(0, 0, 0, 0, 'Ventilateur', 0),
(0, 0, 0, 0, 'Servomoteur', 0),
(0, 0, 0, 0, 'Pompe', 0),
(0, 0, 0, 0, 'Lampe_infrarouge', 0),
(0, 0, 0, 0, 'Vanne', 0);
-- --------------------------------------------------------
-- Estrutura da tabela `mesures`
--
--
CREATE TABLE `mesures` (
`IdType` int(10) NOT NULL,
`IdMesure` int(10) NOT NULL,
`Date` datetime(6) NOT NULL,
`Valeur` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Extraindo dados da tabela `mesures`
--
INSERT INTO `mesures` (`IdType`, `Date`, `Valeur`) VALUES
(1, '2019-03-21 00:14:35.000000', '-19\r\n'),
(2, '2019-03-21 00:14:36.000000', '-5\r\n'),
(4, '2019-03-21 00:14:38.000000', '-18\r\n'),
(3, '2019-03-21 00:14:40.000000', '-26\r\n');
-- --------------------------------------------------------
--
-- Estrutura da tabela `types`
--
CREATE TABLE `types` (
`Consigne` int(10) NOT NULL,
`DeltaT` int(10) NOT NULL,
`Type` varchar(25) NOT NULL,
`SeuilBas` int(10) NOT NULL,
`SeuilHaut` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Extraindo dados da tabela `types`
--
INSERT INTO `types` (`Consigne`, `DeltaT`, `Type`, `SeuilBas`, `SeuilHaut`) VALUES
(0, 0, 'Luminosite', 0, 0),
(0, 0, 'Humidite', 20, 60),
(40, 1, 'Temperature_int', 0, 0),
(0, 0, 'Temperature_ext', 0, 0);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Reply 4 years ago
Can you please give me .sql file?
Question 5 years ago
sorry for noob question .. where is the sql file (db_basilic)? i have download the 3 file but cannot find the sql file .. i need this for my thesis .. thank you in advance
Email:patrickpaul1590@gmail.com
Question 5 years ago on Introduction
Hi
How can obtain all this components with one order?...Is it necessary to have remote control for the system?..what i want is to leave alone the sensors to do their job. I would like to activate the system only pressing a switch.
thank yoy
5 years ago
nice project..
How to connect raspberry with arduino?
6 years ago
The project is beautiful and wonderful but you can explain to me how to connect the Arduino device to the site on the computer
this is my email: saraqartallo@gmail.com
6 years ago
Thumbs up guys
I am thrilled with the presentation from hardware to software details. I am tasked to do a project on this topic, may I ask that you assist me in terms of block diagrams from inputs to outputs and details of the interfacing circuits to the controller boards.
my email.. www.zizilegcuuma@gmail.com
6 years ago
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
6 years ago
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
6 years ago
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?
6 years ago
What is a socket and a connecting box? And where can i buy them? Can i have a photo of the two components?
6 years ago
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
7 years ago
hi kindly email me the english version of all the codes jazz.recupero@gmail.com THANKS .