The main purpose of this project was developing a small automated
greenhouse. The project consist on two main actions:
1. Automatic watering system: it will trigger the water supply when
needed using a moisture sensor to send the signal to the water
pump.
2. Proximity door opener: it will be controlled by a Ultrasonic
proximity sensor for it to automatically open without touch. The
purpose is to protect the plant from external factors and only
give access to it when needed.
This automated greenhouse device will provide an opportunity to
study the use of an analog signal from two different sensors
(Ultrasonic Sensor and Soil moisture sensor) to activate their
specific target actuator (electric pump and servo motor)
COMPONENTS AND SUPPLIES
TECHNIQUE: PRINCIPLES OF OPERATION
Automatic watering system:
The soil moisture sensor is inserted in the flowerpot where the soil is located. The Sensor monitors the state of drought of the earth, characterizing the resistance of the earth between two electrodes. When the soil is dry the sensor devise gives the signal to activate the relay module. This will turn on the submersible water pump that is connected to the relay module and an external power supply. Once the soil has moisture the sensor will send a signal to the motor and it will stop pumping water. Furthermore, a LED light is connected to the sensor that will let us know when the soil is dry , since it will be on, contrary when the soil has moist the LED will go off.
Input: soil moisture
Output: water pump motor + Light
Proximity door opener
The ultrasonic sensor works when approaching near the greenhouse . According to the Arduino program, the sensor will read when someone is near and will switch on the servo motor that is attached to the greenhouse door, causing it to rotate 90° and open the door. When moving back or receding the Ultrasonic sensor will command the servo motor to rotate again, as a result the door closes.
Input: Proximity
Output: servo motor 90 degrees movement
CIRCUIT DRAWING
VIDEO
ARDUINO CODE
#include <NewPing.h>
#include <Servo.h>
#define TRIGGER_PIN 6
#define ECHO_PIN 7
#define MAX_DISTANCE 200
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
Servo servoSM;
int soilMoisturePin = A0;
int soilMoistureValue;
int ledPin = 4;
int motor = 9;
void setup() {
Serial.begin(57600);
servoSM.attach(3); // servo’s pin number
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(motor, OUTPUT);
}
void loop() {
delay(50);
Serial.print(“sonarDistance = “);
Serial.print(sonar.ping_cm());
Serial.println(“cm”);
int distance = sonar.ping_cm ();
if (distance <= 30) {
servoSM.write(0);
} else {
servoSM.write (90);
}
soilMoistureValue = analogRead(soilMoisturePin);
Serial.println(soilMoistureValue);
if(soilMoistureValue > 500){ //if soil is not moist enough the led will turn on and the motor will activate
digitalWrite(motor, HIGH);
digitalWrite(ledPin, HIGH);
}else{
digitalWrite(motor, LOW);
digitalWrite(ledPin, LOW);
}
delay (800);
}
Introduction to Programming and Physical Computing – Automated Greenhouse
Student: María Fernanda Rodríguez Orviz
Faculty: Bernat Morato Assistant: Daniil Koshelyul