r/esp8266

Image 1 — Smart Irrigation System using an ML + ESP32
Image 2 — Smart Irrigation System using an ML + ESP32
Image 3 — Smart Irrigation System using an ML + ESP32
Image 4 — Smart Irrigation System using an ML + ESP32

Smart Irrigation System using an ML + ESP32

I've been working on a Smart Irrigation System using an ESP32 + machine learning, and I've finally got the main pipeline working end-to-end.

The system uses an ESP32, capacitive soil-moisture sensor, and DHT11 to collect environmental data. The readings are sent to a web dashboard, which communicates with a Flask API that runs the ML model and returns an irrigation prediction.

The overall pipeline is:

ESP32 sensors → Web Dashboard → Flask API → ML Model → Irrigation Prediction

The project currently includes:

  • Real-time soil moisture monitoring
  • Temperature and humidity monitoring
  • Web dashboard hosted by the ESP32
  • ML model for irrigation prediction
  • Model evaluation with a confusion matrix
  • Feature-importance analysis
  • Flask inference server
  • API communication between the dashboard and ML model

The first screenshot shows the live dashboard, including the sensor readings and AI irrigation prediction section.

The second shows part of the JavaScript/API integration and project structure, where the dashboard communicates with the ML inference server.

One thing I found particularly interesting was getting the ESP32, web interface, API, and ML model to actually communicate with each other. The AI prediction wouldn't load until the inference server was running, which made the entire pipeline click for me.

This started as a simple ESP32 soil-moisture monitoring project, but I gradually expanded it into a complete IoT + AI system.

I'm planning to improve it further by collecting more real-world data and adding additional environmental inputs such as light intensity.

I'd appreciate feedback from the ESP32 community, especially on the hardware setup, system architecture, and how I could improve the project further.

🔗 GitHub (Full Video and Requirements) :

https://github.com/aqib-ai-ml/ai-powered-smart-irrigation

u/aqib_builds — 2 days ago
▲ 24 r/esp8266

Five years of garden irrigation on a Wemos D1 mini: five sprinklers, one buried pipe, about 80 euros in parts

Every dry season the grass went yellow, so five years ago I put a Wemos D1 mini in a box on the outside wall and gave it the watering job. It is still doing it, power cuts included. I have been meaning to write this up for years, so here it finally is.

The part I would do again is the plumbing. Instead of a valve box near the tap and a pipe per zone, there is one master valve at the tap and a single pipe around the garden. At each sprinkler a clamp saddle taps the pipe (no cutting, it just bolts around it), feeds a 12 V solenoid in a small box in the ground, and the solenoid feeds the head. A drain valve at the far end empties the line for winter. One trench instead of five, and since I only run one head at a time, whichever head is open has the whole supply to itself. No pump, no tank. All the materials together, pipe included, came to about 80 euros.

Power is a 30 W mains-to-12 V DC LED driver: 12 V to the valves through the relays, and a small step-down to 5 V for the board and the relay logic. Everything lives in that one box and runs off a single wall socket.

https://preview.redd.it/ts1wt6095zjh1.jpg?width=3024&format=pjpg&auto=webp&s=3c8ffbbc8bf0e0ec2f29bb48a182a2755b3d3ac6

Things five years of this taught me:

  • The usual cheap relay boards switch on LOW, and an ESP8266's pins float while it boots, so the relays can chatter until the sketch takes over. Write each pin HIGH before pinMode(OUTPUT) so the handover itself adds no LOW pulse. The master valve sits on GPIO 0, which has to be high at boot anyway: the same pull-up that boots the board keeps the water shut through every reset.
  • No valve opens without a time limit. A one-second watchdog closes any valve that has run past its limit and sends a push notification.
  • After a power cut, tell the server the valve state instead of asking for the saved one. Replaying an ON from before the outage would open a valve with nobody home.
  • OTA updates, because walking a laptop out to a wall box in the rain gets old fast. One warning: the ESP8266 updater has no fallback slot, so test every new binary on a desk board first.

Full disclosure: the phone side runs on Plynx, an iOS dashboard app I'm building, so make of that what you will. The write-up with the plumbing diagram and the complete sketch is here: https://www.plynx.cc/blog/esp8266-irrigation-controller-ota/

The buried wiring has been through five winters now and the splices have held so far. What I still have not solved is sensing: I would like the schedule to skip a run after real rain, but every cheap soil moisture probe I have read about seems to corrode within a season. If you have one that lasted outdoors, I want to hear about it.

reddit.com
u/plynx_mod — 3 days ago

esp8266 gpio+ground issue when powered by 12v->5V converter

I'm using an esp8266 (nodemcu v3) powered by a 12v SLA battery with a 12v to 5v step-down converter.

When I connect a rain gauge to a gpio + ground, I get constant spurious triggers.

If I power an esp8266 from a power bank or my computer's micro-usb port, it works fine.

The esp8266 also has an ina219 board and a solid state relay connected to read the voltage and control a battery charger. That all works fine.

Any ideas why the 12v to 5v power supply is causing spurious triggers on the gpio, and if there's any solution?

reddit.com
u/david_ph — 3 days ago
▲ 202 r/esp8266+12 crossposts

Wait..what !? 12 AI applications running entirely on a $5 ESP32. No cloud, no internet. Universal installer + Open source Github + Huggingface available. Test it yourself.

For years, edge AI has promised intelligence everywhere. In practice, most "edge AI" still means sending data to the cloud, relying on large Linux systems, or requiring expensive accelerator hardware.

SuperESP changes that.

Built on Atome LM v2, SuperESP transforms a standard ESP32 into a tiny AI appliance capable of running twelve practical applications entirely offline.

No GPUs.

No subscriptions.

No datacenter.

Just a microcontroller that costs less than a cup of coffee.

Every claim is verifiable and tied to a script.

What SuperESP Actually Is

SuperESP is not another chatbot squeezed onto a microcontroller.

It is a collection of specialized ternary AI models designed to classify events, patterns, behaviors, and anomalies directly on the device.

The current release includes:

Agriculture monitoring

Voice commands

Motion recognition

Gesture detection

Sound event classification

Machine anomaly detection

Air quality analysis

Energy monitoring

Occupancy estimation

Wearable activity tracking

Water leak detection

Predictive maintenance

It comes also with :

+ ESP32 OS

+ Universal Installer

Check out everything :

https://github.com/TilelliLab/atome-lm

u/themoroccanship — 7 days ago
▲ 4 r/esp8266+2 crossposts

ESP8266 RC car with phone control and IR sensor — need advice

I want to build an ESP8266-based RC car controlled by my phone, with an obstacle-avoidance feature. I’m thinking of using IR sensors so that if something comes in front of the car, it automatically stops or changes direction. Is this a good approach, and what sensors/motor driver setup would you recommend for a beginner?

reddit.com
u/Resident-Credit9952 — 6 days ago
▲ 2 r/esp8266+1 crossposts

ESP8266 NodeMCU problem

I have a esp8266 nodmcu version 1.0 wifi when i plug it in my win 11 laptop the device manager shows "Windows has stopped this device because it has reported problems. (Code 43)".I installed ch340 drivers changed my cable changed the port restarted everything and still is show that it could not recognize it PLEASE help me fix this!!

reddit.com
u/Arnav-10 — 7 days ago
▲ 4 r/esp8266+1 crossposts

Can someone help me with this error am facing right now?

Its for a high school project, a smart laser security system.

Idk why am always having this error, i tried everything and it still shows this.

Sorry for the code being AI generated, its my first time ever doing such a project...

CODE:

// --- Pin Definitions ---
const int LDR_ANALOG_PIN  = A0; // Analog light reading (A0)
const int BUZZER_PIN      = 12; // Active Alarm Buzzer (GPIO12 / D6)
const int LED_GREEN       = 5;  // System Armed Indicator (GPIO5 / D1)
const int LED_RED         = 4;  // Interruption Indicator (GPIO4 / D2)
const int ROOM_LIGHTS_PIN = 0;  // Transistor Base (GPIO0 / D3)
// Initial threshold estimate (we will adjust this after checking readings)
int lightThreshold = 500; 
void setup() {
  Serial.begin(115200);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(LED_GREEN, OUTPUT);
  pinMode(LED_RED, OUTPUT);
  pinMode(ROOM_LIGHTS_PIN, OUTPUT);
  // Set initial state
  digitalWrite(BUZZER_PIN, LOW);
  digitalWrite(LED_GREEN, HIGH);
  digitalWrite(LED_RED, LOW);
  digitalWrite(ROOM_LIGHTS_PIN, LOW);
  Serial.println("\n==========================================");
  Serial.println("  Smart Laser Tripwire System Initialized ");
  Serial.println("==========================================");
}
void loop() {
  int ldrValue = analogRead(LDR_ANALOG_PIN);
  Serial.print("LDR Raw Value: ");
  Serial.println(ldrValue);
  // Logic check: if light level changes significantly
  if (ldrValue > lightThreshold) {
// Laser beam broken (Darker / Tripped)
digitalWrite(LED_GREEN, LOW);
digitalWrite(LED_RED, HIGH);
digitalWrite(BUZZER_PIN, HIGH);       // Sound alarm
digitalWrite(ROOM_LIGHTS_PIN, HIGH);  // Turn ON white room LEDs
  } else {
// Normal state (Laser hitting LDR)
digitalWrite(LED_GREEN, HIGH);
digitalWrite(LED_RED, LOW);
digitalWrite(BUZZER_PIN, LOW);        // Silence alarm
digitalWrite(ROOM_LIGHTS_PIN, LOW);   // Keep room LEDs OFF
  }
  delay(200);
}
u/SwimSufficient4789 — 8 days ago