Objectives
The goal of this project was to create a WiFi-enabled RGB lighting controller using an ESP microcontroller. The system needed to be simple, reliable, and easily integrated into Homeassistant.
Another objective was to allow remote control of lighting effects without requiring complex infrastructure.
Working Principles
The ESP microcontroller drives RGB lighting channels using PWM outputs. Each colour channel (Red, Green, Blue) is controlled independently, allowing full colour mixing.
The device connects to a local network and can receive commands to change colours, brightness, and effects. This allows for flexible control from external interfaces such as web dashboards or automation systems.
MOSFETs are used to switch the higher current required by the LED strips, while the ESP provides the control signals.
ESPHome Configuration
Below is a simplified ESPHome configuration used to control the RGB lighting via PWM outputs.
esphome:
name: staircase-rgb
friendly_name: staircase-rgb
esp8266:
board: esp01_1m
api:
encryption:
key: REDACTED
ota:
password: REDACTED
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
light:
- platform: rgb
name: "Staircase Lights"
red: output_component1
green: output_component2
blue: output_component3
output:
- platform: esp8266_pwm
id: output_component1
pin: GPIO2
- platform: esp8266_pwm
id: output_component2
pin: GPIO0
- platform: esp8266_pwm
id: output_component3
pin: GPIO1
Key Components
- ESP8266 / ESP32 - Microcontroller
- N-Channel MOSFETs - LED switching
- RGB LED strips - Lighting output
- Power supply - 5V / 12V depending on LEDs
- Resistors and connectors (standard passives)
Results & Insights
The system successfully allowed wireless control of RGB lighting and proved to be flexible for different use cases.
This project reinforced concepts such as PWM control, power switching using MOSFETs, and integrating microcontrollers with network-based control systems.