I love the new possibilities that modern leds provide (cheap, efficient, small, ...) and I wanted a nice project to play with for my home automation. As I could only find a dimmer for one-color-leds and domoticz and mysensors recently added support for rgb(w) lighting I started to build a control pcb for just that.
I got some help here.
The board should be relativly easy to build and use and shouldn't be too big. The maximum size was 5x5cm as thats what cheap pcb manufactures mostly support. In the end I used a 30 by 50mm board with rounded edges and 2 mounting holes.
I tried to use small but easy to solder components. IRML2502 mosfets in a smd formfactor are used to control the channels of the leds. They are pretty small but one can still solder them by hand without too many problems. I had an earlier version where I used through hole mosfets but these take up a lot of space. An AMS1117 is used to generated the 3.3V from the 12V (led power) input. I tried a buckconverter for more efficiency but these need a lot of filters otherwise the radio doesn't work anymore. As the whole thing doesn't draw too much power a linear regulator should be sufficient. The core is an arduino pro mini. That one is cheap and already has all components it needs to run. Perhaps I will create another version with just the atmega 328P but at the moment this is the easiest solution. Beside the NRF24L01+ radio I and some passive components I also added an ISP programmer 6-pin port to be able to change the program without using the serial connection if need be.
The enclosure - Added 08.2018
I recently got a 3d printern and so I started to design and print a custom enclosure for my RGBW controller(s). It features labels on the front, a mounting point for cable management on the side and standoffs with screw holes for the pcb on the inside. The front has a matching cutout to connect all cables otherwise its closed. The lid just clips in and can be (re)opened at any time.
The cases work great for me you only need to trim the headers on the pro mini (if they are soldered at all). The stl files can be found here and on my github repo if you want to print some enclosures too.
At the moment the software relies on domoticz as a controller or some software that sends the same kind of information. The program stores the current target level for the leds which it gets from domoticz and then fades from its current values to the target ones. As the human eye doesn't see changes in brightness linearly I tried to use non linear scaling for but that doesn't seem to work yet.
Update: I just added a newer version of my sketch that is based on MySensors 2. The most update-to-date version can always be found in my github repo.
I build a custom lighting system for my living room which uses this controller. It's still work in progress but I will try to upload some pictures soon.
- Make non linear fading work
The old version (that I have tested and where these pictures are from) had an error where I switched outputs for the mosfets! They have to be rotated to work! In the newest (gerber) files in the linked github repo I fixed these mistakes. Although I haven't tested these new boards (yet) they should work without this fix now. Wrong: Right:
Update: 5 RGBW controllers using the first generation (with the switched mosfets) have been running here for months now without error.
Update2: They have been running for about 2 years now mostly without problems. The only disadvantage is that my Mysensors network overall is quite "slow" (~1s reaction time). I am currently experimenting with Wifi RGBWW controllers (H801) so there wont be to many more updates to this project
The pcb can be bought here. Read the error part above!