Garduino © GPL3+

Automatic garden control!

  • 637 views
  • 0 comments
  • 1 respect

Components and supplies

Apps and online services

About this project

To manage your garden easily... not being present, you can use this as a robot that checks whether it needs to be watered or not.

Code

codeC#
#include<Servo.h>
#include"DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN,DHTTYPE);
int sensor=A0;
Servo myservo;
int pos=0;
void setup()
{
  Serial.begin(9600);
  myservo.attach(9);
  pinMode(sensor,INPUT);
  dht.begin();
}
void loop()
{
 int sensorvalue=analogRead(sensor);
 int percentage=map(sensorvalue,1023,450,0,100);
 delay(1000);
 Serial.print("moisture");
 Serial.print(percentage);
 Serial.print("%\t");
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  float f = dht.readTemperature(true);
  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
float hif = dht.computeHeatIndex(f, h);  
float hic = dht.computeHeatIndex(t, h, false);
  Serial.print("Humidity: ");
  Serial.print(h);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(t);
  Serial.print(" *C ");
  Serial.print(f);
  Serial.print(" *F\t");
  Serial.print("Heat index: ");
  Serial.print(hic);
  Serial.print(" *C ");
  Serial.print(hif);
  Serial.println(" *F");
  if(percentage<=15)
  {
    pos=45;
    myservo.write(pos);
  }
  if(percentage>30)
  {pos=135;
  myservo.write(pos);
  
}
}

Schematics

SCHEMATIC
plant_environment_monitoring_with_arduino_E9rKVpJKE3.docx

Comments

Similar projects you might like

Garduino

Project in progress by biswa11

  • 3,232 views
  • 0 comments
  • 9 respects

Drip - Low-Cost Precision Irrigation for Developing Nations

Project showcase by Waleed Sawan

  • 1,845 views
  • 0 comments
  • 17 respects

Automatic garden irrigator (AGI)

Project in progress by Daniel Rossi

  • 902 views
  • 0 comments
  • 4 respects

Track the Sun

by Ameduino

  • 97 views
  • 0 comments
  • 2 respects

Servo-Controlled, Light-Tracking Solar Panel Platform

Project tutorial by scott mangiacotti

  • 11,543 views
  • 10 comments
  • 38 respects
Add projectSign up / Login