Project tutorial

Greenhouse © GPL3+

A greenhouse capable of dealing independently with the plans inside it communicates with the external environment through signals.

  • 147,160 views
  • 1 comment
  • 22 respects

Components and supplies

Necessary tools and machines

Apps and online services

About this project

This project saves time and keeps the plant healthycontinously thanks to greenhouse automation. It is also able to communicate byboth visual and acoustic signal with external beings capable of receiving them.

INTRODUCTION:

The purpose of this project is to build a greenhouse usingArduino. The greenhouse deals with plants in a totally automatic way. Inparticular, it is based on an Arduino Uno board, to which revolve aroundseveral sensors useful to analyze the conditions necessary for properoperation. These include the presence of the humidity and temperature sensor(TMP36), two photo-resistance, a water level and finally an PIR HC - SR501. Theoperation of this project is to detect a set of data using the sensorsdescribed above and based on the value they detect, different mechanisms willbe activated that can keep the plant healthy.

FUNCTION:

1. In this project, twophotoresistors are placed above the top surface of the greenhouse, whichtransmit various values depending on the brightness of the externalenvironment. Subsequently you will average the values and according to it willturn on an internal light to feed the plants or you will act a servo motor thatis tasked with opening the upper panel allowing the light of the external environmentto radiate the shrubs inside the greenhouse, saving the artificial lighting incase of brightness needed to power them. Outside the greenhouse is placed atemperature sensor that is able to detect the external temperature, this factorinfluences the drive of the servo. If the detected value will be below a presetthreshold then the servo will not act even if the external brightness is highand the lamp will remain on to illuminate the plants.

2. There are two moisturesensors placed inside the vessels where it will check the level of moisture ofthe soil that will determine the dryness level of the plants and based on itwill act a pump that will automatically water the plants under the greenhouse.The pump will only act when the level of the liquid inside the tank, thanks tothe presence of the water level sensor that will allow the measurement, will beabove a certain pre-set threshold and will take the necessary water forirrigation from a where the sensor that will measure the level of the liquidwill be placed inside it. This sensor will allow a buzzer to sound and turn ona red LED only at the end of the liquid inside the container, it will soundonly in the presence of a movement in front of the greenhouse determined by thepir. While if the level will be high you will turn on a green LED. This processwill allow the construction of a greenhouse that manages completelyautonomously the plants it guards within them.

Images of the project being built

Images at the end of the project with two plants inside

Code

listingArduino
#include <Servo.h>
Servo servo;
int level=0;
float temperature=0;
int valhumidity=0;
int detection=0;

int pir=2;
int buzzerPin=3;
int relay1=4;
int relay2=5;
int green=9;
int red=10;

int ldr1;
int ldr2;
int temp;
int waterlevel;
int humidity1;
int humidity2;


void setup(){
Serial.begin(9600);
servo.attach(11);
pinMode(green, OUTPUT);
pinMode(red, OUTPUT);
pinMode(pir, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(waterlevel, INPUT);
pinMode(humidity1, INPUT);
pinMode(humidity2, INPUT);
pinMode(temp, INPUT);
pinMode(ldr1, INPUT);
pinMode(ldr2, INPUT);
}
void loop()
{
  temp=analogRead(A2);
  temperature =((temp * 0.00488) - 0.5) / 0.01;
  detection=digitalRead(pir);
  waterlevel=analogRead(A3);
  
  ldr1 = analogRead(A0);
  ldr2 = analogRead(A1);
  Serial.print("ldr1 is:");
  Serial.print(ldr1);
  Serial.print("  |   ");
  Serial.print("ldr2 is:");
  Serial.print(ldr2);
  Serial.print("  |   ");
  Serial.print("water level is:");
  Serial.println(waterlevel);
  Serial.print("  |   ");
  Serial.print("temperature is:");
  Serial.println(temperature);
  
  if((ldr1-ldr2)>=250 || (ldr2-ldr1)>=250) {// vero se una delle due espressioni è vera
   if(detection==HIGH)
   servo.write(0);
    digitalWrite(relay1,HIGH);{
    for(int i=1; i<6; i++) {
  tone(buzzerPin, 1000, 500);
  digitalWrite(red,HIGH);
  digitalWrite(green,LOW);
  delay(500);    
  digitalWrite(red,LOW);
  delay(500);}
  delay(5000);}}
    
  else{
    if(((ldr1+ldr2)/2)>700 && temperature>15  ){
    servo.write(90);
    digitalWrite(relay1,LOW);
    delay(1000);}
    
    if(((ldr1+ldr2)/2)<700 || temperature>15  ){
    servo.write(0);
    digitalWrite(relay1,HIGH);
    delay(1000);}
    
    
  if(waterlevel<180){
  digitalWrite(red,HIGH);
  digitalWrite(green,LOW); 
  digitalWrite(relay2,LOW);
    if(detection==HIGH){
    for(int i=1; i<5; i++) {
  tone(buzzerPin, 1000, 500);
  delay(1000);}
  delay(5000);}}
    
  else{
  digitalWrite(green,HIGH);
  digitalWrite(red,LOW);
  digitalWrite(relay2, LOW);
  do{
  digitalWrite(relay2, HIGH);
  humidity1=analogRead(A4);
  humidity2=analogRead(A5);}
  while (((humidity1+humidity2)/2)> 500);
  digitalWrite(relay2, LOW);
  delay(1000);
  }}}

Custom parts and enclosures

Arduino
arduino_lhrpsaszxu_X5puJAZDEt.zip
Greenhouse
serra_iqhixlenww_01QDdKiAlP.SLDASM
Element
element_5mvry5bskf_AJL57YZzoq.zip
Shielding
schermatura_3pthuiaprm_wGOzJdJdcM.SLDPRT
Plexiglass
plexiglass_roy9sq8god_OLBN4sRLa0.zip
Photoresistor
ldr_grade_metq4nqlwe_1OZMAdN6Sd.SLDPRT

Schematics

Greenhouse
schema_serra_quasi_terminato_1yzaq40eoi_gHZaUIWsD3.fzz
Greenhouse scheme
Schema serra quasi terminato 7gus3cwr1l gm0imnsq79
Greenhouse
serra_f5vwyvyoop_QvVFpMLN1v.ino

Comments

Similar projects you might like

Autonomous Indoor Greenhouse - Mature Real Working Project

Project showcase by vinikon

  • 24,096 views
  • 45 comments
  • 171 respects

Servo-Controlled, Light-Tracking Solar Panel Platform

Project tutorial by scott mangiacotti

  • 17,455 views
  • 12 comments
  • 52 respects

Smoke Detection using MQ-2 Gas Sensor

by Aritro Mukherjee

  • 323,152 views
  • 54 comments
  • 204 respects

AWS - Arduino Weather Station

Project tutorial by GilettaStefano

  • 26,622 views
  • 14 comments
  • 69 respects

Domotic Greenhouse

Project tutorial by Team cormaz

  • 22,245 views
  • 7 comments
  • 54 respects
Add projectSign up / Login