Simple RGB LED-strip Controller for Home Assistant
by headseth in Circuits > Electronics
455 Views, 2 Favorites, 0 Comments
Simple RGB LED-strip Controller for Home Assistant
I love to hack my way into cheap LED-strips! Most of them use Tuya. I do not like Tuya so I always try to modify these my own way.
This LED-strip was a cheap Tuya strip that I bought at the Action (Holland) some years ago. I destroyed the controlled back then because I tried to reprogram the Tuya controller. After that mistake (haha), I wanted to use the LED-strip still by controlling it with ESPHome via home assistant. With help of a selfmade PCB and some YAML code, I succeeded!
PS: dont mind the weird male to female connector between the LED-strip and the ESP32, this will be done by soldering a nicer connector onto it.
Supplies
- LED-strip with RGB (or RGBWW or single color, I am planning on making a Instructables about that)
- Breadboard, perfboard or custom PCB (like I did)
- ESP32 (I used the Wemos D1 Mini)
- A transistor for each light channel (RGB = 3, RGBWW = 5, single color = 1)
- 100Ω & 10kΩ resistor for each light channel (RGB = 3, RGBWW = 5, single color = 1)
- Headers for ESP32 (if you like)
- Soldering tools (and skills)
Making the Circuit on a Breadboard
The circuit is easy. The picture shows how to make it and how it works;
The 100Ω resistor is limiting the current from the ESP32 to the base of the transistor. The 10kΩ is added to make sure the line is pulled down on the gate. The ESP32_pin label is there to indicate that this wire is going to the ESP32 analog pin. It needs to be analog in order to dim the brightness (making different colours).
I also connected the 5V of the ESP32 to the LED-strip to power it. It is an 5V LED-strip. Dont forget to make the ground common! GND needs to be attached to each other in this case (GND from ESP32 to GND of LED-strip). Because we are toggling the GND lines of the LED-strip, you do not need an additional GND wire.
Important note! This circuit is used for an LED-strip that toggles the channels by pulling the channels to ground. This is called "common anode LED strip". For a "common cathode LED strip", you need to change the emitter and collector part of the transistor. Please make sure you follow this tutorial with use of a common anode LED strip. I will not explain how the common cathode circuit works.
Test the Circuit
With use of the home assistant YAML code in ESPHome, you can program the ESP32 and toggle the transistor with the home assistant entity.
Solder the Perfboard or PCB (optional)
If it works, you can solder it to a piece of perfboard to make it cleaner! The PCB that is shown in the picture, is from another LED-strip. That LED-strip is using 12V, therefore the barrel jack connector. It is also a five channel LED-strip, thats why there are five transistors.
Enjoy the newly made LED-strip made!