UjuziLab · 3h · Intermediate
Step 1
Step 1
Step 2
Step 2
Step 3
Step 3
Step 4
Step 4
Step 5
Step 5
Join this solution to track your progress.
Copy this template into your Arduino IDE to get started.
// UjuziLab smart irrigation sketch
#include <WiFi.h>
#define MOISTURE_PIN 34
#define RELAY_PIN 26
void setup() { pinMode(RELAY_PIN, OUTPUT); }
void loop() {
int moisture = analogRead(MOISTURE_PIN);
digitalWrite(RELAY_PIN, moisture > 2800 ? HIGH : LOW);
delay(60000);
}Join to unlock step tracking and save your progress.
Sign in required to join
3 hours to complete
1 people building this