Status: Hardware Prototyping — In Progress
An autonomous IoT lighting subsystem of the KAFES ecosystem. Designed to track real-time environmental lux levels (like sunsets) and adjust 24V/5A power electronics seamlessly using a dual-core FreeRTOS architecture. Protected by a Zero-Trust MQTT network design.
The KAFES OMEGA Zero-Trust Architecture: More than just "turn on the lights from a phone". The system is strictly autonomous via PID loops based on physical light sensors. Any manual override requires authorization through the Master Dashboard via an [ACTION REQUIRED] prompt to dispatch encrypted MQTT packets, preventing single-click unauthorized access.
[1] SENSING (BH1750)
→ I2C digital read for exact Lux levels
→ Replaces noisy analog LDRs
↓
[2] LOGIC & PROCESSING (ESP32 FreeRTOS)
→ Core 0: Wi-Fi polling and MQTT network subscriptions
→ Core 1: Hardware PWM generation (LEDC) & PID Controller
↓
[3] POWER ELECTRONICS (IRLZ44N)
→ 3.3V logic signal rapidly switches the massive 24V/5A load
→ PWM prevents the N-Channel MOSFET from overheating
↓
[4] MANUAL OVERRIDE (ZERO-TRUST)
→ Master Dashboard requests confirmation before dispatch
→ Fallback to Local AP Mode if the main router drops
Since the microcontroller cannot drive heavy loads directly, an IRLZ44N logic-level MOSFET acts as a rapid switch, safely isolating the 3.3V logic circuit from the 24V power circuit.
By switching the circuit on and off rapidly (PWM) instead of lowering voltage linearly, the system minimizes power dissipation and prevents the MOSFET from burning up under load.
The ESP32 runs Wi-Fi/MQTT blocking functions on Core 0 and the mission-critical hardware PWM fading on Core 1, ensuring the lights never freeze or stutter during network reconnects.
| Component | Selection | Engineering Justification |
|---|---|---|
| Microcontroller | ESP32 | Dual-Core architecture allows splitting network tasks from hardware PWM tasks, crucial for stability. |
| Switching MOSFET | IRLZ44N (N-Channel) | Logic-level threshold (turns on at lower voltages). Can comfortably handle the 5 Amps of current without extreme resistance. |
| Light Sensor | BH1750 (I2C) | Provides highly precise 16-bit digital Lux values directly over the I2C bus, immune to the voltage drop noise of analog sensors. |
| Voltage Regulator | LM2596 Step-Down | Drops the main 24V power supply down to a clean 5V to safely power the ESP32 logic board. |
Even logic-level MOSFETs like the IRLZ44N perform best at 5V. Driving them directly with the ESP32's 3.3V can leave them in a semi-open resistive state, generating excessive heat.
If a person walks past the BH1750 sensor, the sudden drop in Lux causes the autonomous loop to rapidly spike the room's brightness, creating a disco-effect.
Standard Arduino code freezes all operations while attempting to reconnect to a dropped Wi-Fi network, causing the PWM lights to freeze entirely.
The project follows a strict "Virtual to Physical" engineering pipeline to eliminate hardware risks before soldering.
Proving the logic purely in the browser. Testing FreeRTOS core delegation, LEDC hardware PWM fading, I2C BH1750 sensor reading, and Wi-Fi/Web Server routing before touching physical hardware.
Wiring the IRLZ44N and ESP32 with a small test load. Validating heat dissipation, PWM frequency hum, and MQTT latency over the local network.
Designing the industrial schematic. Tracing ultra-thick paths for the high-current power lines and routing the logic layer. Producing the GERBER files for manufacturing.
Designing a 3D-printable housing based on the exact PCB dimensions, incorporating ventilation grilles for thermal exhaust and a dedicated mount for the BH1750 sensor.