Microcontroller-based smart LED controller for 12V–24V DC lighting systems.
The device enables manual, automatic and semi-automatic brightness control based on:
- Ambient light intensity (lux)
- Human presence (PIR sensor)
- Energy consumption monitoring
- Temperature and humidity measurement
Control is performed via a built-in HTTP web interface.
- Manual brightness control (0–100%)
- Automatic brightness control (0–1000 lux setpoint)
- Semi-automatic modes
- PID light intensity regulation
- Motion detection with configurable hold time
- Power, current and energy monitoring
- Temperature and humidity measurement
- EEPROM settings persistence
- Fully web-based configuration (responsive UI)
- Designed for 12V / 24V LED installations
- Compact PCB (40x40 mm)
- Fits into Ø60 mm flush-mounted wall box
- ESP32-C3 SuperMini
- Framework: ESP-IDF
| Device | Function | I2C Address |
|---|---|---|
| INA219 | Current / Power | 0x40 |
| BH1750 | Light (lux) | 0x23 |
| SHT40 | Temperature / Humidity | 0x44 |
| M24C08 | EEPROM | 0x50–0x53 |
- SR602 (3.3V compatible PIR)
- MOSFET (Logic Level) – IRLZ34N
- 8-bit PWM (0–255)
- Controlled using ESP32 LEDC API
- Input: 12–24V DC
- DC/DC: R-78K3.3-1.0 (RECOM)
- π-filter for EMC compliance
User sets LED brightness (0–100%).
- User sets target lux value.
- PID controller adjusts PWM to maintain constant light intensity.
Combination of:
- Manual brightness
- Motion sensor
- Or automatic lux regulation
- PIR can be enabled/disabled.
- Adjustable hold time (seconds).
- When no motion is detected → light turns off after delay.
Using INA219:
- Voltage measurement
- Current measurement
- Power calculation
- Energy integration:
E = P × t
Energy usage stored periodically in EEPROM.
- Built-in HTTP server
- Responsive layout (mobile compatible)
- GET/POST handlers
- Real-time sensor data
- Mode selection
- Brightness configuration
- Motion settings
- Lux setpoint configuration
Tasks handled by FreeRTOS:
- Sensor measurement task
- PWM control task
- PID regulation task
- Web server task
- EEPROM storage task
Custom I2C driver implemented using:
driver/i2c.h
No Arduino libraries used.
Fully implemented in ESP-IDF.
The controller is connected in series between:
Power Supply → Controller → LED Strip
Designed for:
- LED strips
- 12V LED bulbs
- Decorative lighting
- Garden lighting systems
- Scheduled lighting scenes
- Sunrise / sunset automatic mode
- RGB / multi-channel expansion
- Logarithmic dimming curves
- Smooth fading via LEDC API
- External wireless sensor modules
- Multi-channel LED support (up to 6 PWM channels)