Project showcase
DHT22 Applied To Automatic Irrigation

DHT22 Applied To Automatic Irrigation © GPL3+

Humidity and temperature sensor DHT22 applied to automatic irrigation.

  • 3,487 views
  • 3 comments
  • 12 respects

Components and supplies

Apps and online services

About this project

Humidity and temperature sensor with DHT22 applied to automatic irrigation and switch with transistor, perfect for projects in which temperature and humidity must be controlled and maintained at a certain percentage. The project in this case is developed with an external power source of 12v connected to a motor for water conduction, only drives voltage to the motor when in the transistor there is voltage sent from the arduino to the door of the same, the programming of the Arduino tells me that the temperature must be less than 30 degrees Celsius, if that temperature is exceeded the arduino sends voltage to the transistor and allows me to drive the voltage from the power source to the motor activating the irrigation with nebulizers.

Code

Humidity and temperature sensor with DHT22 and switch with transistor BC547Arduino
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

#include <DHT.h>
#include <DHT_U.h>

#define DHTPIN 6 //Pin 6 del Arduino Uno
#define DHTTYPE DHT22 //Definir el sensor como un DHT22

DHT dht(DHTPIN, DHTTYPE);

float temperatura;
float humedad;

void setup()
{
  lcd.begin(16, 2);
  pinMode(13, OUTPUT);
 }

void loop()
{
  delay(2000); //Tiempo de espera entre una lectura y otra. Para el DHT22 son 2 segundos
    
  temperatura = dht.readTemperature(); //Lee la temperatura
  humedad = dht.readHumidity(); //Lee la humedad

  lcd.setCursor(0, 0);  //Muestra la temperatura
  lcd.write("Temp.: ");  
  lcd.print(temperatura);  
  lcd.write(" C");

  lcd.setCursor(0, 1);  //Muestra la humedad
  lcd.write("Hume.: ");  
  lcd.print(humedad);  
  lcd.write(" %");

if (temperatura >= 30)
   {
   digitalWrite(13, HIGH); // Enciende el Led 13.
   Serial.write("ON"); // Envía por el puerto ON.

    }
else
   {
      digitalWrite(13, LOW); // Apaga el Led 13.
      Serial.write("OFF"); // Envía por el puerto OFF.
   }
   }


 

Comments

Similar projects you might like

RFID Based Automatic Door System

Project showcase by Robodia Technology

  • 35,762 views
  • 20 comments
  • 97 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,836 views
  • 17 comments
  • 75 respects

Arduino Irrigation System

Project tutorial by smana_00

  • 4,691 views
  • 0 comments
  • 20 respects

Automatic Pet Water Chiller

Project tutorial by Mitomon

  • 966 views
  • 0 comments
  • 7 respects

Advance Automatic Railway Crossing System

Project showcase by Pawan singh and Akansh Saxena

  • 1,839 views
  • 1 comment
  • 13 respects
Add projectSign up / Login