How andresvasped/signs_of_instability works
Project type and purpose
• This is an embedded IoT application running on an ESP32 using the ESP-IDF framework.
• Its goal is to read environmental data (e.g., moisture, pressure) via I²C sensors, run a rainfall/landslide-risk prediction algorithm locally, and display results on an I²C-driven LCD1602.
File structure
• Top-level build files: CMakeLists.txt, platformio.ini, sdkconfig.esp32dev
• src/ contains main.c and its own CMakeLists.txt – the entry point and application logic.
• / holds project-wide headers.
• lib/ includes two reusable components:
– esp32-smbus: a generic SMBus/I²C driver library
– esp32-i2c-lcd1602: an I²C LCD driver for the 1602 display
• test/ is reserved for unit or integration tests.
README for additional insights
• Confirms use of ESP32 + ESP-IDF to predict precipitation in landslide-prone regions.
• Implies data acquisition, local computation, and on-device feedback (LCD).
a. Main components
– Hardware layer:
• ESP32 microcontroller
• Environmental sensor(s) (e.g., BME280) on the shared I²C/SMBus
• I²C-LCD1602 display module
– Software layer (inside ESP32):
• ESP-IDF RTOS + Wi-Fi stack (optional for future telemetry)
• HAL/I²C driver (from ESP-IDF)
• esp32-smbus library (abstract SMBus transactions)
• esp32-i2c-lcd1602 library (LCD driver)
• Application modules:
· Data acquisition service
· Prediction algorithm
· Display/update service
– Build/deploy tools: CMake, PlatformIO, Wokwi simulator
b. Relationships & interactions
– The application calls the SMBus library to configure/read sensors via the I²C bus.
– Sensor data feeds into the prediction algorithm module.
– Algorithm output is passed to the LCD driver to update the display.
– All software modules sit on top of the ESP-IDF’s HAL and FreeRTOS scheduler.
– Build tools orchestrate compilation and flash the firmware onto the ESP32.
c. Architectural patterns & principles
– Layered architecture: Hardware Abstraction → Driver Libraries → Application Logic
– Separation of concerns: each library handles a single interface (SMBus, LCD)
– Modular design: easy to swap sensor or display by replacing the corresponding library
d. Key technologies & frameworks
– ESP-IDF (FreeRTOS, HAL, I²C peripheral drivers)
– CMake (build configuration)
– PlatformIO (alternative build & upload tool)
– Wokwi (hardware simulation)