Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Smart Irrigation System with ESP32 and Blynk App Integration

View and Edit Project In Cirkit DesignerImage of Smart Irrigation System with ESP32 and Blynk App Integration

Circuit Documentation

Summary

This circuit is designed to create a smart irrigation system with Blynk integration. It features an ESP32 microcontroller that interfaces with various sensors and actuators, including a rain sensor, temperature sensor, ultrasonic sensor, and a relay module to control a water pump and a solenoid valve. The system's status is displayed on an I2C LCD screen, and the ESP32 allows for remote monitoring and control via the Blynk platform.

Component List

5v Relay

I2C LCD 16x2 Screen

YL-83 Module LM393

Mini Water Pump

LED: Four Pin (Common Cathode)

Resistor (220 Ohms)

Pushbutton

HC-SR04 Ultrasonic Sensor

ESP32 (30 pin)

YL-69 Sonda

Plastic Solenoid Valve

RAIN SENSOR

TEMP

12V Battery (mini)

Wiring Details

5v Relay

I2C LCD 16x2 Screen

YL-83 Module LM393

Mini Water Pump

LED: Four Pin (Common Cathode)

Resistor (220 Ohms)

Pushbutton

HC-SR04 Ultrasonic Sensor

ESP32 (30 pin)

YL-69 Sonda

Plastic Solenoid Valve

RAIN SENSOR

TEMP

12V Battery (mini)

Documented Code

ESP32 Microcontroller Code (sketch.ino)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Smart Irrigation System Code (sketch.ino)

/*
 * Smart Irrigation System with Blynk Integration
 * This code reads sensor data from the YL-83 Module LM393 and controls
 * a relay to operate a solenoid valve and a water pump. The water level
 * status is displayed on an I2C LCD and can be monitored/controlled via Blynk.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <BlynkSimpleEsp32.h>

// Blynk Auth Token
char auth[] = "YourAuthToken";

// WiFi credentials
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

// Pin definitions
#define RELAY_PIN 4
#define WATER_LEVEL_PIN 33
#define TRIG_PIN 12
#define ECHO_PIN 13
#define RED_LED_PIN 27
#define GREEN_LED_PIN 26
#define BLUE_LED_PIN 25

// I2C LCD address and dimensions
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  // Initialize serial communication
  Serial.begin(115200);

  // Initialize the LCD
  lcd.begin();
  lcd.backlight();

  // Initialize pin modes
  pinMode(RELAY_PIN, OUTPUT);
  pinMode(WATER_LEVEL_PIN, INPUT);
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(RED_LED_PIN, OUTPUT);
  pinMode(GREEN_LED_PIN, OUTPUT);
  pinMode(BLUE_LED_PIN, OUTPUT);

  // Initial state
  digitalWrite(RELAY_PIN, LOW);
  lcd.setCursor(0, 0);
  lcd.print("Smart Irrigation");