Tekko BDSimSimulatorProjects

স্মার্ট সেচ ব্যবস্থা (ক্যালিব্রেটেড, LCD সহ)Smart Irrigation System using Arduino

ক্যাপাসিটিভ মাটির sensor বলে দেয় মাটি কতটা ভেজা। ৩৫% এর নিচে নামলে Arduino relay দিয়ে pump চালায়, ৫৫% পার হলে থামায়। দুইটা threshold রাখায় ঠিক সীমায় pump বারবার অন-অফ করে না।

A capacitive soil sensor reports how wet the soil is. Below 35% the Arduino starts the pump through a relay; above 55% it stops. Two thresholds (hysteresis) stop the pump from jittering on and off at one borderline value.

▶ ফ্রি চালিয়ে দেখো / Run it free Parts অর্ডার করো (WhatsApp)

সার্কিট ডায়াগ্রাম · Circuit diagram

Smart Irrigation System using Arduino circuit diagram — Arduino Uno, Capacitive soil sensor v1.2, LCD 16x2 with I2C, Relay module (5V, 1 channel), Mini water pump (3–6V), Jumper wires

যা যা লাগবে · Parts you need

তার লাগানো · Wiring

Capacitive soil sensor v1.2 GND→Arduino Uno GND
Capacitive soil sensor v1.2 VCC→Arduino Uno 5V
Capacitive soil sensor v1.2 AOUT→Arduino Uno A0
LCD 16x2 with I2C VCC→Arduino Uno 5V
LCD 16x2 with I2C GND→Arduino Uno GND
LCD 16x2 with I2C SDA→Arduino Uno A4
LCD 16x2 with I2C SCL→Arduino Uno A5
Relay module (5V, 1 channel) VCC→Arduino Uno 5V
Relay module (5V, 1 channel) GND→Arduino Uno GND
Relay module (5V, 1 channel) IN→Arduino Uno D7
Relay module (5V, 1 channel) COM→Arduino Uno 5V
Relay module (5V, 1 channel) NO→Mini water pump (3–6V) +
Mini water pump (3–6V) -→Arduino Uno GND.3

Code (Arduino C++)

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Smart irrigation: a capacitive soil sensor (it does not rust like the resistive kind)
// drives a pump through a relay, with hysteresis so the pump never jitters on and off.
// AOUT is about 3.0 V in dry soil and drops to about 1.4 V in wet soil.
const int sensorPin = A0, relayPin = 7;
const int DRY_RAW = 600, WET_RAW = 290;      // calibrate these two on your own sensor
const int PUMP_ON = 35, PUMP_OFF = 55;       // two thresholds, not one
bool pumping = false;                        // hysteresis state

void setup() {
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW);
  lcd.init();
  lcd.backlight();
  Serial.begin(9600);
}

void loop() {
  int raw = analogRead(sensorPin);
  int pct = (DRY_RAW - raw) * 100L / (DRY_RAW - WET_RAW);   // 0% = bone dry, 100% = soaked
  pct = constrain(pct, 0, 100);

  if (!pumping && pct < PUMP_ON)  { pumping = true;  Serial.println("PUMP ON"); }
  if (pumping  && pct > PUMP_OFF) { pumping = false; Serial.println("PUMP OFF"); }
  digitalWrite(relayPin, pumping ? HIGH : LOW);

  lcd.setCursor(0, 0); lcd.print("Soil: "); lcd.print(pct); lcd.print("%   ");
  lcd.setCursor(0, 1); lcd.print(pumping ? "Pump ON " : "Pump OFF");
  delay(500);
}

আরো project · More projects