Project Overview
EcoSense is an IoT solution designed to help small-scale farmers monitor crop health and environmental conditions in real-time. By deploying a network of low-power ESP32 microcontrollers, the system collects data on soil moisture, temperature, and humidity, while a local camera module checks for early signs of leaf disease.
Architecture
The system consists of three main layers:
- Edge Layer: ESP32 + ESP32-CAM running TensorFlow Lite models.
- Connectivity Layer: MQTT protocol over WiFi/LoRaWAN.
- Cloud Layer: AWS IoT Core + Lambda for data processing.
Machine Learning on the Edge
Running ML on a microcontroller with 520KB RAM was a significant challenge. I used quantization to reduce the model size.
// Loading the quantized model on ESP32
#include "model_quantized.h"
void setup() {
tflite::MicroErrorReporter micro_error_reporter;
model = tflite::GetModel(g_model_quantized_data);
// Define tensor arena
constexpr int kTensorArenaSize = 60 * 1024;
static uint8_t tensor_arena[kTensorArenaSize];
}
Results
- 92% accuracy in detecting Tomato Blight.
- 30% reduction in water usage through smart irrigation triggers.
- Battery life extended to 6 months using deep sleep cycles.