AI-Based Agricultural Anomaly Detection Using kiwisiot A project tutorial published with the KiwisIoT platform shows how an ESP32 microcontroller paired with a DHT22 temperature/humidity sensor, a BH1750 light sensor and an analog soil-moisture probe can flag agricultural anomalies and publish readings to the KiwisIoT dashboard over Wi-Fi and MQTT. The Arduino sketch samples sensors every 5000 milliseconds, maps raw soil readings between DRY_VALUE 3000 and WET_VALUE 1200 into a 0-100 percentage, and raises an anomaly when soil moisture falls below 20, temperature exceeds 40 C, or humidity drops below 30. The code sends soil, temperature, humidity, light and a binary anomaly flag to KiwisIoT channels 0, 1, 2, 6 and 7, which the tutorial labels a proposed channel mapping. Project introduction AI-Based Agricultural Anomaly Detection is a smart farming project that monitors agricultural conditions using an ESP32 and different sensors. The system continuously monitors: - Soil moisture level. - Temperature. - Air humidity. - Light intensity. AI-based anomaly detection identifies unusual readings, such as extremely dry soil, unusually high temperature, or abnormal humidity. The ESP32 sends sensor data to the KiwisIoT dashboard, where farmers can monitor agricultural conditions and identify abnormal situations. Main objective: Detect unusual agricultural conditions early and help farmers protect their crops. Step 1: Install Arduino IDE Download: Arduino IDE Step 2: Install ESP32 board 1. Open Arduino IDE. 2. Go to Boards Manager. 3. Search for ESP32. 4. Install Espressif ESP32. 5. Select your ESP32 Dev Module board. Step 3: Install libraries Open Library Manager and install: - DHT sensor library by Adafruit. - Adafruit Unified Sensor. - BH1750 by Christopher Laws. Install the KiwisIoT library manually: 1. Visit KiwisIoT. 2. In Arduino IDE, select Sketch → Include Library → Add.ZIP Library. The KiwisIoT SDK supports ESP32, Wi-Fi, MQTT communication and sensor-data publishing. 7. Complete ESP32 program This code: - Reads all three sensors. - Converts soil readings into a percentage. - Detects abnormal conditions. - Sends sensor values to KiwisIoT. - Sends anomaly status to the dashboard. Code: include