স্মার্ট সেচ ব্যবস্থা (ক্যালিব্রেটেড, 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.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno Arduino Uno
- 1 × Capacitive soil sensor v1.2 ক্যাপাসিটিভ মাটির সেন্সর v1.2
- 1 × LCD 16x2 with I2C LCD ১৬x২ (I2C)
- 1 × Relay module (5V, 1 channel) রিলে মডিউল (5V, ১ চ্যানেল)
- 1 × Mini water pump (3–6V) ছোট পানির পাম্প (৩–৬V)
- 13 × Jumper wires জাম্পার তার
তার লাগানো · 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
- অগ্নিনির্বাপক রোবট (আগুন খুঁজে পানি ছাটে)Fire-fighting robot (finds the flame, pumps water)
- ব্লুটুথ গাড়ি (HC-05 + L298N)Bluetooth-controlled car (HC-05 + L298N)
- বৃষ্টির এলার্ম (বৃষ্টি ধরার যন্ত্র)Rain alarm (rain detector with buzzer)
- ৫৫৫ টাইমার astable — code ছাড়াই LED জ্বলা-নেভা555 timer astable — an LED blinker with no code