A professional embedded systems project featuring real-time environmental monitoring with temperature and humidity sensing, visual indicators, web-based control, and TinyML-powered anomaly detection. Built on ESP32-S3 using FreeRTOS for robust multi-tasking architecture.
This is a smart environmental monitoring system that watches the temperature and humidity in your room and provides visual alerts and web-based control:
π‘οΈ Temperature Monitoring
- Continuously measures room temperature
- LED blinks at different speeds based on temperature:
- Slow blink = Cold (below 20Β°C)
- Medium blink = Normal (20-30Β°C)
- Fast blink = Hot (30-40Β°C)
- Always ON = Critical! (above 40Β°C)
π§ Humidity Monitoring
- Tracks room humidity levels
- NeoPixel changes color to show humidity:
- Blue = Too dry (below 40%)
- Green = Comfortable (40-60%)
- Yellow = Getting humid (60-80%)
- Red = Too wet (above 80%)
** Web Dashboard Access**
- Connect your phone/laptop to WiFi:
ESP32-S3-LAB(password:12345678) - Open browser to:
http://192.168.4.1 - See live temperature, humidity, and system status
- Control 4-LED light bar with 5 different modes:
- OFF, BAR graph, Rainbow animation, SOS emergency, or Blinking
π¨ Fire Alert System
- Enable "Fire Alert Auto Mode" from the dashboard
- Set your danger temperature (e.g., 45Β°C)
- System automatically switches to SOS mode when temperature exceeds threshold
- Automatically returns to normal when temperature is safe
- Perfect for fire prevention or equipment overheating alerts
π§ Remote Control
- Adjust temperature/humidity thresholds from anywhere
- Control GPIO pins remotely
- Switch between WiFi modes (Access Point or connect to your home WiFi)
π§ Smart Anomaly Detection
- Built-in AI monitors sensor patterns
- Detects unusual temperature/humidity combinations
- Helps identify sensor failures or environmental issues
π 16x2 LCD Display
- Shows current temperature and humidity
- Displays classification bands (COLD/NORMAL/HOT/CRITICAL)
- No phone needed - see status at a glance
- What Does This System Do?
- Features
- System Architecture
- Hardware Requirements
- Pin Configuration
- Software Architecture
- Task Synchronization
- Web Dashboard
- Installation
- Configuration
- Usage
- API Reference
- Project Structure
- Contributing
- Troubleshooting
- License
- Real-time Environmental Monitoring: DHT20 I2C sensor for accurate temperature and humidity readings
- Multi-Task Architecture: 6 concurrent FreeRTOS tasks with semaphore-based synchronization
- Visual Indicators:
- Temperature-responsive LED blinking patterns
- Humidity-based NeoPixel color indication
- 4-pixel NeoPixel UI bar with multiple display modes
- LCD Display: 16x2 I2C LCD showing real-time sensor data and system status
- Web Dashboard: Full-featured web interface for monitoring and configuration
- WiFi Connectivity: Access Point and Station modes with seamless switching
- TinyML Integration: On-device machine learning for anomaly detection
- GPIO Control: Remote GPIO manipulation via web API
- Configurable temperature and humidity thresholds
- Real-time task performance monitoring
- SOS emergency mode for NeoPixel strip
- Fire alert system with customizable behavior
- Comprehensive telemetry and diagnostics
The system employs a modular, event-driven architecture using FreeRTOS for task management and binary semaphores for inter-task communication.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ESP32-S3 System Core β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Task 1 β β Task 2 β β Task 3 β β Task 4 β β
β β DHT20 ββββ LED ββββ NeoPixel β β NeoPixel β β
β β Sensor β β Control β β Hum β β UI Bar β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββββββββ β
β β β β β
β β ββββββββββ΄ββββββββββββββ β
β ββββββ€ β
β β β
β ββββββββββββ ββββββββββββ β
β β Task 5 β β Task 6 β β
β β LCD β β TinyML β β
β β Display β β Anomaly β β
β ββββββββββββ ββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β WiFi + Web Server β
β HTTP API + Dashboard β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | Model/Specification | Quantity | Purpose |
|---|---|---|---|
| Microcontroller | ESP32-S3 (YOLO Uno board) | 1 | Main processor with WiFi |
| Temperature/Humidity Sensor | DHT20 (I2C) | 1 | Environmental sensing |
| LCD Display | 16x2 I2C LCD (0x21) | 1 | Status display |
| LED | Standard LED (any color) | 1 | Temperature indicator |
| NeoPixel Strip | WS2812B (1 pixel) | 1 | Humidity indicator (GPIO 45) |
| NeoPixel Strip | WS2812B (4 pixels) | 1 | UI Bar (GPIO 6) |
- Operating Voltage: 3.3V logic, 5V for NeoPixels
- Power Consumption: ~500mA peak (with all NeoPixels on)
- I2C Speed: Standard mode (100 kHz)
- WiFi: 2.4 GHz 802.11 b/g/n
// I2C Bus (Shared by DHT20 and LCD)
SDA_PIN = 11 // I2C Data
SCL_PIN = 12 // I2C Clock
// Outputs
LED_GPIO = 48 // Temperature indicator LED
NEOPIXEL_HUM = 45 // Single pixel humidity indicator
NEOPIXEL_UI = 6 // 4-pixel UI bar
// I2C Addresses
DHT20_ADDR = 0x38 (default)
LCD_ADDR = 0x21 ESP32-S3
ββββββββββββββββ
β β
DHT20 SDA βββββ€ 11 (SDA) β
DHT20 SCL βββββ€ 12 (SCL) β
LCD SDA βββββ€ β
LCD SCL βββββ€ β
β β
LED (-) βββββ€ 48 (LED) β
β β
NeoHum DIN βββββ€ 45 (NEO_H) β
NeoUI DIN βββββ€ 6 (NEO_UI) β
β β
β USB-C βββββ Power & Serial
ββββββββββββββββ
Key Connections:
- I2C Bus (GPIO 11/12): Shared between DHT20 (0x38) and LCD (0x21)
- GPIO 48: Built-in LED for temperature indication
- GPIO 45: Built-in NeoPixel for humidity indication
- GPIO 6: External NeoPixel 4-LED strip for UI bar
- USB-C: Power (5V) and serial communication (115200 baud)
src/
βββ main.cpp # Entry point & main loop
βββ config/
β βββ config.h # System constants & pin definitions
β βββ system_types.h # Data structures & enumerations
β βββ system_types.cpp # Helper functions & globals
βββ hardware/
β βββ hardware_manager.h # Hardware object declarations
β βββ hardware_manager.cpp # Hardware initialization
βββ tasks/
β βββ tasks.h # Task declarations & documentation
β βββ tasks.cpp # Task creation & management
β βββ task1_sensor.cpp # DHT20 sensor reading
β βββ task2_led_neopixel.cpp # LED & NeoPixel control
β βββ task3_lcd.cpp # LCD display updates
β βββ task5_tinyml.cpp # TinyML inference
βββ web/
β βββ web_server.h # Web server declarations
β βββ web_server.cpp # HTTP handlers & routing
β βββ web_pages.h # HTML dashboard
βββ ml/
βββ tinyml.h # TensorFlow Lite includes
βββ dht_anomaly_model.h # Trained ML model
- Framework: Arduino (ESP32-S3 core)
- RTOS: FreeRTOS (built-in with ESP32)
- Web Server: ESPWebServer library
- ML Framework: TensorFlow Lite Micro
- Libraries:
- DHT20 sensor library (v0.3.1)
- Adafruit NeoPixel (v1.15.2)
- LiquidCrystal_I2C (v1.1.4)
- TensorFlowLite_ESP32 (v1.0.0)
Key Points:
- Task 1 (DHT20 Sensor) acts as producer, reading sensor every 500ms
- Tasks 2, 3, 5 act as consumers, waking only when semaphore signaled
- Zero polling: Consumer tasks sleep with 0% CPU usage until needed
- <1ms response: Semaphore wakeup latency under 1 millisecond
- 99.86% efficiency: Eliminates 99.86% of unnecessary task wakeups vs polling
Boot Phases:
- Core Init (0-50ms): Bootloader, Arduino framework, Serial
- Hardware Setup (50-200ms): Semaphores, I2C, DHT20, LCD, NeoPixels
- Network Layer (200-2000ms): WiFi AP, HTTP server, 11 API endpoints
- Task Creation (2000-2100ms): 6 FreeRTOS tasks with priorities and stacks
- Scheduler Active (2100ms+): FreeRTOS scheduler takes control
Observations:
- Task 1 (P:3) preempts all lower-priority tasks when it wakes
- 88% CPU idle time - system highly efficient, tasks sleep when not needed
- Deterministic behavior - high-priority tasks complete within 1-2ms of wakeup
- No starvation - even lowest-priority tasks get sufficient CPU time
The system uses binary semaphores for efficient inter-task communication with minimal CPU overhead.
ββββββββββββββββ
β Task 1 β (Priority 3 - Highest)
β DHT20 β
β Sensor β
ββββββββ¬ββββββββ
β
β Every 500ms: Read sensor
β
ββββ IF temperature band changed ββββ semBandChanged
β β
β ββββββββββββββββ
β β Task 2 β (Priority 2)
β β LED Blink β
β ββββββββββββββββ
β
ββββ IF humidity band changed βββββββ semHumChanged
β β
β ββββββββββββββββ
β β Task 3 β (Priority 2)
β β NeoPixel H β
β ββββββββββββββββ
β
ββββ ALWAYS βββββββββββββββββββββββββ semLcdUpdate
β
ββββββββββββββββ
β Task 5 β (Priority 1)
β LCD β
ββββββββββββββββ
Note: Task 4 (NeoPixel UI) and Task 6 (TinyML) run independently
- Producer: Task 1 (Sensor)
- Consumer: Task 2 (LED)
- Trigger: Temperature band transition (COLD β NORMAL β HOT β CRITICAL)
- Behavior: Task 2 blocks until new temperature band is detected
- Producer: Task 1 (Sensor)
- Consumer: Task 3 (NeoPixel Humidity)
- Trigger: Humidity band transition (DRY β COMFORT β HUMID β WET)
- Behavior: Task 3 blocks until new humidity band is detected
- Producer: Task 1 (Sensor)
- Consumer: Task 5 (LCD)
- Trigger: Every sensor reading (500ms interval)
- Behavior: LCD updates continuously with latest readings
- Default SSID:
ESP32-S3-LAB - Default Password:
12345678 - Dashboard URL:
http://192.168.4.1 - Port: 80 (HTTP)
- Live temperature and humidity readings
- Task execution counters
- Last execution timestamps for each task
- TinyML anomaly scores
Configure temperature bands:
- COLD: < T_COLD_MAX (default: 20Β°C)
- NORMAL: T_COLD_MAX - T_NORMAL_MAX (default: 20-30Β°C)
- HOT: T_NORMAL_MAX - T_HOT_MAX (default: 30-40Β°C)
- CRITICAL: > T_HOT_MAX (default: > 40Β°C)
Configure humidity bands:
- DRY: < H_DRY_MAX (default: 40%)
- COMFORT: H_DRY_MAX - H_COMF_MAX (default: 40-60%)
- HUMID: H_COMF_MAX - H_HUMID_MAX (default: 60-80%)
- WET: > H_HUMID_MAX (default: > 80%)
- OFF Mode: All pixels disabled
- BAR Mode: 4-LED bar graph showing humidity percentage
- DEMO Mode: Rainbow color animation
- SOS Mode: Emergency SOS pattern (Β·Β·Β· βββ Β·Β·Β·)
- BLINK Mode: Synchronized blinking pattern
- Switch between Access Point and Station modes
- Configure SSID and password
- View current connection status
- Remote GPIO manipulation (pins 0-48)
- Safety lockout for critical system pins
- Real-time state control (HIGH/LOW)
GET / β Dashboard HTML page
GET /state β JSON with all system state
POST /set β Update thresholds (query params: tcold, tnorm, thot, hdry, hcomf, hhum)
POST /ui/off β Set NeoPixel UI to OFF mode
POST /ui/bar β Set NeoPixel UI to BAR mode
POST /ui/demo β Set NeoPixel UI to DEMO mode
POST /ui/sos β Set NeoPixel UI to SOS mode
POST /ui/blink β Set NeoPixel UI to BLINK mode
POST /fire-alert β Control fire alert system (param: enable=0|1)
POST /wifi β Configure WiFi (params: mode, ssid, pass)
POST /gpio β Control GPIO (params: pin, state)
{
"ms": 123456,
"tC": 25.3,
"rh": 55.2,
"tBand": "NORMAL",
"hBand": "COMFORT",
"led": 1,
"blink_on": 300,
"blink_off": 300,
"giveTemp": 5,
"takeTemp": 5,
"giveHum": 3,
"takeHum": 3,
"tcold": 20.0,
"tnorm": 30.0,
"thot": 40.0,
"hdry": 40.0,
"hcomf": 60.0,
"hhum": 80.0,
"dht_runs": 247,
"led_runs": 1024,
"neo_runs": 12,
"lcd_runs": 247,
"tiny_score": 0.023,
"tiny_runs": 49,
"uiMode": 1,
"wifiMode": "ap"
}- Install VS Code: Download here
- Install PlatformIO Extension: Search "PlatformIO IDE" in VS Code Extensions
- USB Driver: Install ESP32-S3 USB drivers for your OS
- Git: For cloning the repository
git clone https://github.com/leonathn/MidtermProject_ESP32_PlatformIO.git
cd MidtermProject_ESP32_PlatformIOcode .Or: File β Open Folder β Select project directory
PlatformIO will automatically install required libraries on first build:
- DHT20 sensor library
- Adafruit NeoPixel
- LiquidCrystal_I2C
- TensorFlowLite_ESP32
Follow the Pin Configuration section to wire components.
- Press
Ctrl+Alt+B(Windows/Linux) orCmd+Alt+B(Mac) - Or click the checkmark (β) icon in the bottom toolbar
- Wait for compilation to complete
- Connect ESP32-S3 via USB-C
- Press
Ctrl+Alt+Uor click the arrow (β) icon - Monitor serial output with
Ctrl+Alt+S
Look for this output in the serial monitor:
ββββββββββββββββββββββββββββββββββββββββββββββββββ
β ESP32-S3 Multi-Task Environmental Monitor β
β FreeRTOS + DHT20 + LCD + NeoPixel + Web β
ββββββββββββββββββββββββββββββββββββββββββββββββββ
[HW] Hardware initialized successfully
[SYNC] Semaphores created successfully
[WiFi] AP IP: 192.168.4.1
[WEB] Web server started on port 80
[TASKS] All tasks created successfully
ββββββββββββββββββββββββββββββββββββββββββββββββββ
β System Ready β
β Connect to: ESP32-S3-LAB (password: 12345678) β
β Dashboard: http://192.168.4.1 β
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Edit src/config/config.h:
/* WiFi Settings */
#define AP_SSID_DEFAULT "ESP32-S3-LAB"
#define AP_PASS_DEFAULT "12345678"
/* Default Thresholds */
#define DEFAULT_T_COLD_MAX 20.0f
#define DEFAULT_T_NORMAL_MAX 30.0f
#define DEFAULT_T_HOT_MAX 40.0f
#define DEFAULT_H_DRY_MAX 40.0f
#define DEFAULT_H_COMF_MAX 60.0f
#define DEFAULT_H_HUMID_MAX 80.0f
/* Task Timing */
#define DHT_READ_INTERVAL_MS 500 // Sensor polling rate
#define UI_STRIP_UPDATE_MS 120 // NeoPixel UI refresh rate
#define TINYML_INFERENCE_MS 5000 // ML inference interval
/* Task Stack Sizes */
#define TASK_DHT_STACK_SIZE 4096
#define TASK_LED_STACK_SIZE 3072
#define TASK_TINYML_STACK_SIZE 8192 // Larger for ML operationsAll thresholds can be modified via the web dashboard without recompiling.
The project uses a custom board definition: boards/yolo_uno.json
Modify platformio.ini if using a different ESP32-S3 board:
[env:combined]
board = esp32-s3-devkitc-1 ; or your board name- Power On: Connect ESP32-S3 to power via USB
- Connect to WiFi:
- Find WiFi network "ESP32-S3-LAB"
- Password: "12345678"
- Open Dashboard: Navigate to
http://192.168.4.1in browser - Monitor: View real-time sensor data and system status
The LED blink pattern changes based on temperature:
- COLD (< 20Β°C): Slow blink (1s on, 1s off)
- NORMAL (20-30Β°C): Medium blink (300ms on, 300ms off)
- HOT (30-40Β°C): Fast blink (120ms on, 120ms off)
- CRITICAL (> 40Β°C): Solid ON (no blinking)
Single pixel color indicates humidity level:
- π΅ Blue: DRY (< 40%)
- π’ Green: COMFORT (40-60%)
- π‘ Yellow: HUMID (60-80%)
- π΄ Red: WET (> 80%)
4-pixel strip with multiple modes:
- OFF: All pixels dark
- BAR: Visual bar graph of humidity (0-100% = 0-4 LEDs)
- DEMO: Rainbow animation
- SOS: Emergency SOS pattern
- BLINK: Synchronized blinking
Open serial monitor (115200 baud) to see:
- Task creation logs
- Sensor readings
- Semaphore give/take events
- TinyML inference results
- HTTP request logs
Example output:
[TASK1] β Temp band changed: HOT (32.5Β°C) β semBandChanged given
[TASK2] β Received semBandChanged (new band: HOT)
[TASK3] β Received semHumChanged (new band: HUMID)
[TASK5] β LCD updated - Values: T=32.5Β°C H=65.2%
[TinyML] Score 0.045 (T=32.5Β°C H=65.2%)
struct LiveState {
// Sensor readings
float tC; // Temperature in Celsius
float rh; // Relative humidity (%)
TempBand tBand; // Current temperature band
HumBand hBand; // Current humidity band
// LED state
uint8_t ledOn; // LED on/off state (0 or 1)
uint32_t onMs; // LED on duration (ms)
uint32_t offMs; // LED off duration (ms)
// Semaphore counters
uint32_t giveTemp; // semBandChanged given count
uint32_t takeTemp; // semBandChanged taken count
uint32_t giveHum; // semHumChanged given count
uint32_t takeHum; // semHumChanged taken count
// UI control
uint8_t uiMode; // NeoPixel UI mode (0-4)
// Task telemetry
uint32_t dht_last_ms; // Last DHT read timestamp
uint32_t led_last_ms; // Last LED update timestamp
uint32_t neo_last_ms; // Last NeoPixel update timestamp
uint32_t lcd_last_ms; // Last LCD update timestamp
uint32_t dht_runs; // Total DHT task runs
uint32_t led_runs; // Total LED task runs
uint32_t neo_runs; // Total NeoPixel task runs
uint32_t lcd_runs; // Total LCD task runs
// TinyML
float tinyml_score; // Anomaly detection score
uint32_t tinyml_last_ms;
uint32_t tinyml_runs;
};// Classify temperature into band
TempBand classifyTemp(float tC);
// Returns: TempBand::COLD, NORMAL, HOT, or CRITICAL
// Classify humidity into band
HumBand classifyHum(float h);
// Returns: HumBand::DRY, COMFORT, HUMID, or WET
// Convert temperature band to LED blink pattern
void bandToBlink(TempBand b, uint32_t& onMs, uint32_t& offMs);void task_read_dht20(void* pv); // Task 1: Sensor reading
void task_led(void* pv); // Task 2: LED control
void task_neopixel_hum(void* pv); // Task 3: Humidity indicator
void task_neopixel_ui(void* pv); // Task 4: UI bar
void task_lcd(void* pv); // Task 5: LCD display
void tiny_ml_task(void* pvParameters); // Task 6: TinyML inferenceMidtermProject_ESP32_PlatformIO/
β
βββ platformio.ini # PlatformIO configuration
βββ boards/
β βββ yolo_uno.json # Custom ESP32-S3 board definition
β
βββ include/ # Public headers (empty - using src/)
β
βββ lib/ # Custom libraries (empty - using dependencies)
β
βββ src/ # Main source code
β βββ main.cpp # Application entry point
β β
β βββ config/ # Configuration & data structures
β β βββ config.h # Constants, pins, task config
β β βββ system_types.h # Enums, structures, prototypes
β β βββ system_types.cpp # Helper implementations
β β
β βββ hardware/ # Hardware abstraction layer
β β βββ hardware_manager.h
β β βββ hardware_manager.cpp
β β
β βββ tasks/ # FreeRTOS task implementations
β β βββ tasks.h # Task declarations & documentation
β β βββ tasks.cpp # Task creation
β β βββ task1_sensor.cpp # DHT20 sensor task
β β βββ task2_led_neopixel.cpp # LED & NeoPixel tasks
β β βββ task3_lcd.cpp # LCD display task
β β βββ task5_tinyml.cpp # TinyML inference task
β β
β βββ web/ # Web server & dashboard
β β βββ web_server.h
β β βββ web_server.cpp # HTTP handlers
β β βββ web_pages.h # HTML dashboard
β β
β βββ ml/ # Machine learning
β βββ tinyml.h # TensorFlow Lite includes
β βββ dht_anomaly_model.h # Trained model data
β
βββ test/ # Unit tests (empty)
β
βββ data/ # Project documentation & media
β βββ Diagram/ # System architecture diagrams
β β βββ ExcutionTimeline.png # Task scheduling timeline
β β βββ HardwareWiring.png # GPIO and I2C connections
β β βββ SystemBootSequence.png # Boot initialization flow
β β βββ TaskCommunicationFlow.png # Semaphore signaling
β β βββ WebUserFlow.png # Web dashboard flow
β β βββ README.md # Diagram documentation
β β βββ QUICK_EXPORT_GUIDE.md # How to generate diagrams
β β
β βββ Hardware/ # Hardware photos
β β βββ FullSetup.jpg # Complete system assembly
β β βββ Yolo_Uno_ESP32-S3kit.png # Development board
β β βββ DHT20Module.png # Temperature sensor
β β βββ LCD1602Module.png # Display module
β β βββ NeoPixel4LED.png # LED strip
β β βββ Relay.png # Relay module
β β βββ GPIO.png # GPIO pinout
β β βββ SensorsAndLCD.jpg # Sensors assembly
β β βββ Sensors_Relay_NeoPixelModule.jpg
β β
β βββ Dashboard.png # Main web dashboard screenshot
β βββ ConfigurationPage.png # Configuration interface
β βββ ControlPage.png # Control panel
β βββ MainPage.png # Landing page
β β
β βββ Dashboard/ # Dashboard detailed screenshots
β βββ Configuration/ # Configuration page screens
β βββ Control/ # Control interface screens
β
βββ README.md # Comprehnesive Instruction for the ProjectProject
β
βββ .gitignore # Git ignore rules
βββ .pio/ # PlatformIO build artifacts (ignored)
βββ .vscode/ # VS Code settings (ignored)
We welcome contributions! Here's how you can help:
- Check existing issues first
- Provide detailed reproduction steps
- Include serial monitor output
- Specify your board and environment
- Open an issue with
[FEATURE]prefix - Describe the use case
- Provide implementation ideas if possible
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Follow existing code style
- Add comments and documentation
- Test on hardware
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
- Use meaningful variable names
- Add comments for complex logic
- Follow existing indentation (4 spaces)
- Document public functions with Doxygen-style comments
- Keep functions focused and modular
Problem: Can't upload code to ESP32-S3
Solutions:
- Hold BOOT button while connecting USB
- Try different USB cable (data cable, not charge-only)
- Check driver installation
- Press RESET button after upload starts
Problem: LCD backlight on but no text
Solutions:
- Verify I2C address (use I2C scanner sketch)
- Check SDA/SCL connections (GPIO 11/12)
- Adjust LCD contrast potentiometer
- Verify 5V power supply to LCD
Problem: Temperature/humidity show NaN
Solutions:
- Wait 2 seconds after power-on (warm-up time)
- Check I2C connections
- Verify DHT20 is at 0x38 address
- Ensure proper pull-up resistors (if required)
Problem: NeoPixels don't light up
Solutions:
- Verify 5V power supply (NeoPixels need 5V)
- Check data pin connections (GPIO 45 and 6)
- Add 330Ξ© resistor on data line
- Add 1000Β΅F capacitor across power supply
Problem: ESP32-S3-LAB network not visible
Solutions:
- Check antenna connection on board
- Verify AP is enabled:
gWifiMode = "ap" - Look for serial message: "AP IP: 192.168.4.1"
- Try power cycle ESP32
Problem: Can connect to WiFi but can't access 192.168.4.1
Solutions:
- Disable mobile data on phone
- Clear browser cache
- Try different browser
- Check firewall settings
- Verify device got IP: 192.168.4.x
Problem: No sensor readings or LED activity
Solutions:
- Check serial monitor for task creation messages
- Verify semaphores created successfully
- Look for stack overflow warnings
- Increase task stack sizes in config.h
Enable verbose logging by modifying serial output in code:
Serial.setDebugOutput(true);To reset all configurations:
- Press and hold BOOT button
- Press RESET button briefly
- Release BOOT button
- WiFi settings will reset to defaults
- GitHub Issues: Create an issue
- Serial Logs: Always include serial monitor output
- Hardware Photos: Pictures help diagnose wiring issues
| Task | Execution Time | Stack Usage | Priority |
|---|---|---|---|
| Task 1 (DHT20) | 50-100ms | ~2KB | 3 (High) |
| Task 2 (LED) | <1ms | ~1KB | 2 |
| Task 3 (NeoPixel H) | 5-10ms | ~1KB | 2 |
| Task 4 (NeoPixel UI) | 10-15ms | ~1.5KB | 1 |
| Task 5 (LCD) | 20-30ms | ~1.5KB | 1 |
| Task 6 (TinyML) | 200-500ms | ~6KB | 1 (Low) |
- Flash (Program): ~850KB / 8MB (10.6%)
- SRAM (Runtime): ~180KB / 512KB (35%)
- Task Stack Total: ~22KB allocated
- TensorFlow Arena: 8KB for ML model
- Idle: ~120mA @ 5V
- Active (All tasks): ~180mA @ 5V
- Peak (NeoPixels max): ~500mA @ 5V
- TensorFlow Lite Micro
- Edge Impulse - Train your own models
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2025 ESP32-S3 Lab
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- DHT20 by Rob Tillaart - Temperature/humidity sensor driver
- Adafruit NeoPixel - WS2812B LED control
- LiquidCrystal_I2C by Marco Schwartz - LCD display driver
- TensorFlowLite_ESP32 by Tanaka Masayuki - On-device ML inference
- FreeRTOS documentation and examples
- ESP32 community tutorials
- Embedded systems best practices
- Tran Hoai Nhan - Head Engineer and Manager, Initial development and architecture
- Vo Phuc Thien - Assistant Engineer and Maintenance
- Community contributors (see GitHub contributors page)
- MQTT support for IoT cloud integration
- SD card logging for long-term data storage
- OTA (Over-The-Air) firmware updates
- Mobile app (iOS/Android)
- Advanced TinyML models (fire detection, air quality)
- BLE support for low-power communication
- Multi-sensor support (additional DHT20 units)
- Time-series graphing in web dashboard
- Alert notifications (email, push)
- Web dashboard uses HTTP (not HTTPS)
- Single WiFi client support in AP mode
- No persistent storage (settings lost on reboot)
- TinyML model is placeholder (needs training)
- GitHub Repository: MidtermProject_ESP32_PlatformIO
- Issue Tracker: Report Bugs
- Pull Requests: Active PR
- Maintainer: leonathn
If this project helped you, please consider giving it a β on GitHub!
Built with β€οΈ using ESP32-S3, FreeRTOS, and PlatformIO











