Some time ago I bought a led strip dioder from Ikea, it was funny and not so expensive for a led bars sold by a big store, in Europe is about 20 euros. Though after a while, when I started to make home automation projects I left it in my canteen replaced by a controllable led strip made by a famous maker. Today, the way to the domotic world has brought myself to several mysensors projects and when I got back in my hand the dioder suddenly I thought that I could make it controllable from my home automation system. Thanks to this page I was able to figure out how the dioder is working: basically we have 4 bars each with 8 common anode RGB led (picture 2); the bars are connected to a connector box (picture 3) where we have also a plug for the power unit (12V) and a plug for the controller unit. This project is focused on the controller unit: this unit has the power button, a wheel to change colors from white (not real white but all RGB on) to red and other two buttons to make colors changing automatically. This unit is described here but my version is a newer one (picture 4) so I investigated about the new electrical schema (picture 5). The capacitors and diode values are not correct but for my scope was not so important. There's a voltage regulator to get 5V but the core is the MC SC91F729BM that get as analog input a level going from 0V (white) to 5V (red) according to the wheel position and 3 digital input coming from the buttons (push button = 0V). The three PWM outputs goes to the 3 MOSFET used to command the led bars, connecting and disconnecting (PWM) the 3 RGB leds cathodes to the ground. Now that we know how the dioder is working we can decide what we want to do. There are different approaches:
I went for the last one, and I decided to change the first and third button behavior (that I never had used) to make a dimmer-able led bar with a UP and DOWN buttons. My electrical schema now changes as in picture 6. Since there's already a 5V logic I'm using an arduino pro mini 5V node sensor, the Radio nRF24LU1+ and than a DC-DC step down voltage regulator to provides 3.3V to the radio module. The picture 7 shows the new components together with the control unit (I removed the original microcontroller).
From mysensors point of view it's both a S_RGB_LIGHT and a S_DIMMER (2 child sensors) and for each variation it'll send to the gateway 3 sensors messages: V_STATUS (1/0), V_DIMMER (level 0-100) and V_RGB (rgb hex, i.e. "ff0000"). The node could also process the same sensors messages coming from the gateway, both type set and req for the messages V_DIMMER and V_RGB and only req for the message V_STATUS. Actually, to command the led strip, the V_RGB message is enough but the V_DIMMER it is necessary to store the dimmer level otherwise the physical buttons don't know the current status and the next variation starts from the last level set by the buttons. Since we have the opportunity to change the color/level values remotely the only strange thing is that the color pointed by the wheel is different from the led colors.
The arduino program is based on dimmer sensor node and this post where Jason Judge explains how to make a RGB colours wheel via arduino, basically how to convert an analog value to RGB and then to HSV. The standard RGB wheel goes from red to yellow, to green, to blue, to purple and red again, but the ikea dioder goes from white to yellow, to green, to blue, to purple and to red, so to keep the same behavior I made a change in the algorithm.
My gateway is connected to Openhab, so I'm able to integrate the led strip in my smart system as showed in this video.
In order to finish the project, I have only to find an elegant way to put in an enclose all the new parts: arduino, radio module and voltage converter.