Close
0%
0%

SkyLight

SkyLight : Get beyond TV's ambient light

Similar projects worth following
SkyLight is an advantage of the TV's ambient light, extending to smart wireless light bulbs such as MiLight, LimitlessLED and Easybulb. SkyLight is developed on RF based wireless bulb because the cost is reasonable than Wifi build-in bulb in this time. SkyLight is based on raspberry pi main processor that drive LED strip via arduino board, of course arduino is a key to develop the control signal of the wireless bulbs. If you already have a DIY ambient light TV system such as lightberry, this is a good time to apply Skylight to your system.

This project, SkyLight, is the continue version of ambient light with hdmi input. I used 50 of WS2801 LEDs behind the screen.

The WS2801 was controlled via arduino, as know as "ttyACM0" device in Hyperion that was run on raspberry pi. The adalight protocol is a medium between arduino and raspberry pi

Last and most important, With-any-HDMI-input was provided by 1) HDMI Splitter, 2) HDMI to RCA converter, 3) Capture Dongle and 4) Raspberry pi2. That was Lucky, the iso file of raspberry pi was create by Lightberry. The download iso was on bottom of page. That all I have before I start this project. Oh, one more thing, I rewrite an arduino sketch which has gamma correction and smooth color change.

SkyLight that I have started here is based on

- I do not touch process of ambient light now that mean I still use WS2801 LEDs, don't worry, WS2812 is in my plan but come no first.

- The LED frame of SkyLight is insert in front of ambient light frame, Why? because the ambient light still work perfectly when I update "\etc\hyperion.config.json" file even if I do not touch the sketch.

- RF based light bulb has some limited about color protocol that I'll discuss later. The final result is bulb's color is not perfectly match witch screen color but I will do it the best.

- When "power on" SkyLight is DISABLE and try to change color of bulb to warm white initially.

- SkyLight change bulb color to warm white before power off that why i add some super cap in this project.

- Skylight is not limit for ceiling light merely, applied to table lamp, wall lamp, work lamp and so fourth.

Preparing :

Bulbs was shipped to my house today, been house brand in Thailand. there came with remote. The prices is reasonable compare with China clone product that have a 2-3 weeks delivery time. I'm hasty :-)

SkyLight is not require Wifi bridge module, being bypass it via RF module, nRF24L01.

It connect to arduino board simply.

It's is the time to make it done.

Come with me.

  • 4 × RF Based rgbww light bulbs MiLight bulb
  • 1 × RF light bulb remote MiLight Remote
  • 1 × nRF24L01 Breakout board
  • 1 × Arduino Uno
  • 50 × WS2801 LEDs

View all 11 components

  • Keep going...

    Songkord Thirachai03/25/2016 at 18:02 0 comments

    A few day ago, I tried some demo of the SkyLight. The result was vary POOR.

    The Big problem was some glitter after SkyLight is enable. RF module used more time to send packet that make some serial packet from raspberry pi lost in the middle of Adalight packet train. There is a weak point of Adalight protocol that is not check a complete of the whole packets. Rx buffer was increased to make it better however arduino uno also reached their limit.

    I've surveyed another solution founded this : Hyperion-Controlling multiple devices. That is a good idea to separate Ambient light and SkyLight controller.

    - Conventional ambient light is controlled by raspberry pi directly.

    - SkyLight is controlled via arduino uno exclusively.

    The surveyed document which is in the link is very clearly, I, however, take a time to experiment.

    ----- MAY THE FORCE BE WITH ME -----

  • First Demo

    Songkord Thirachai03/23/2016 at 16:44 0 comments

    Detail will come later :-)

    It's look good.

    I need more time to calibrate color mapping of bulb.

  • Rewrite code with FastLED + Gamma Correction

    Songkord Thirachai03/21/2016 at 18:59 0 comments

    Today, i rewrite a code of ambient light of arduino module applied FastLED library carefully. Why? there are 3 important thing, 1) the legacy code of adalight is based on SPI that is used by a RF module too. I think move pin in code of adalight from HW to SW is not complicated. 2) FastLED library support many LED brand. Finally, Gamma Correction is applied.

    /* This SkyLight Demo used Adalight(From octows2801 lib) + FastLED lib  */
    
    #include "FastLED.h"
    
    // How many leds in your strip?
    #define NUM_LEDS 50
    
    // For led chips like Neopixels, which have a data line, ground, and power, you just
    // need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
    // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
    
    //--- SPI ---
    //#define DATA_PIN 11
    //#define CLOCK_PIN 13
    
    //--- Software ---
    #define DATA_PIN 2
    #define CLOCK_PIN 4
    #define GND_PIN 5
    
    // Define the array of leds
    CRGB leds[NUM_LEDS];
    
    // Gramma Correction (Defalt Gamma = 2.8)
    const uint8_t PROGMEM gammaR[] = {
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,
        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,
        2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,  4,  5,
        5,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  9,
        9,  9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14,
       15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
       23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33,
       33, 34, 35, 36, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46,
       46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
       62, 63, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 80,
       81, 83, 84, 85, 87, 88, 89, 91, 92, 94, 95, 97, 98, 99,101,102,
      104,105,107,109,110,112,113,115,116,118,120,121,123,125,127,128,
      130,132,134,135,137,139,141,143,145,146,148,150,152,154,156,158,
      160,162,164,166,168,170,172,174,177,179,181,183,185,187,190,192,
      194,196,199,201,203,206,208,210,213,215,218,220,223,225,227,230 };
      
    const uint8_t PROGMEM gammaG[] = {
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
        1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,  2,
        2,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,  4,  5,  5,  5,
        5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  9,  9,  9, 10,
       10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16,
       17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25,
       25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
       37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50,
       51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68,
       69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89,
       90, 92, 93, 95, 96, 98, 99,101,102,104,105,107,109,110,112,114,
      115,117,119,120,122,124,126,127,129,131,133,135,137,138,140,142,
      144,146,148,150,152,154,156,158,160,162,164,167,169,171,173,175,
      177,180,182,184,186,189,191,193,196,198,200,203,205,208,210,213,
      215,218,220,223,225,228,231,233,236,239,241,244,247,249,252,255 }; 
    
    
    const uint8_t PROGMEM gammaB[] = {
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,
        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,
        2,  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
        4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,  7,  8,
        8,  8,  8,  9,  9,  9, 10, 10, 10, 10, 11, 11, 12, 12, 12, 13,
       13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 19,
       20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28,
       29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40,
       40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53,
       54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 69, 70,
       71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 83, 84, 85, 86, 88, 89,
       90, 92, 93, 94, 96, 97, 98,100,101,103,104,106,107,109,110,112,
      113,115,116,118,119,121,122,124,126,127,129,131,132,134,136,137,
      139,141,143,144,146,148,150,152,153,155,157,159,161,163,165,167,
      169,171,173,175,177,179,181,183,185,187,189,191,193,196,198,200 };
    
    
    void setup...
    Read more »

  • Test bulb functions

    Songkord Thirachai03/20/2016 at 18:28 0 comments

    First, I install a bulb into floor lamp in a speed of light, at the same time pushing the buttons of remote insanely. OK. it work fine. I found it have 2 mode that is "RGB" and "warm white". they are independent. see this picture. Centre is a receiver circuit. Inner LEDs are RGB and the rim is warm white. they do not active at the same time. I think RGBW and RGBWW are identical inner RGB.

    Second, Sniff RF signal from a IR remote using arduino and nRF24L01 breakout board. The method is on http://fablab.ruc.dk/controlling-the-mi-light-from-arduino/. They used Guino to interface an arduino with this sketch, However it worked on RF24 Library from "Reverse-Engineering the milight on-air protocol". Thank you.

    Last, I observe for a while. found this:

    - Control signal is 7 words = 3 ID, 1 Hue, 1 Brightness, 1 RemoteButton and 1 Incremental number. that is noted in above reference.

    - Every button have own button key and hold button key for example press "ON" -> get 0x01, press "ON[hold]" -> get 0x10 (push key + 16 or +0x10). Remote key finally show:

    - Hold "OFF" button is USELESS key, there is not functional. I plan to use this key to ENABLE and DISABLE the SkyLight.

    - Colour wheel is base on HSL format. they only have 256 colour which is mixed of 2 major colour, R&G, G&B and R&B (No R&B&B simultaneous). The colour information is definitely lost then converted from RGB (24bits) to HSL(16bits, bulb protocol). Switching mode of RGB and WW is an alternative to avoid this effect if a transition is fast enough. I'll try.

    - Control bulb from GUI, they work only parameter from matching RemoteButton. For that reason, control words is required 2 words, first is Hue, second is Brightness sequentially.

    - Change mode, "M button", make a first ID value change. My remote that i have has ID which is [(176-184) 62 32]. The first ID can rotate 9 value = 9 mode.

    Next, Control bulb from RGB signal via arduino.

View all 4 project logs

Enjoy this project?

Share

Discussions

Songkord Thirachai wrote 04/03/2016 at 12:24 point

Dear followers, SkyLight is delayed for a couple of week. I was operated and being in a hospital now. everything is fine. don't worry. I will complete my project, sworn. Maybe i'm planing to get reenforcement form my friends. see you soon :-)

  Are you sure? yes | no

iPAS wrote 08/08/2019 at 03:31 point

To my senior, RIP.
To his followers,
Mr. Thirachai passed away early this year.
He did not only contribute knowledge to his friends including me,
  but also gave us friendship which will be attached to our hearts forever.
I hope you guys continue his legacy project, and share it back for the sake of humanity.
Just the same as what he will do.

  Are you sure? yes | no

Songkord Thirachai wrote 03/19/2016 at 14:30 point

Thank for your advice, @Woodster . I got bulbs yesterday and tested it slightly. There's plenty of room to make it clear. I don't worry about the difference between RGBW and RGBWW, nevertheless I have a big problem that is the bulb declare the colour in HSV format, not RGB. The converter is specially needed.

  Are you sure? yes | no

Woodster wrote 03/19/2016 at 14:38 point

Hi, the new rgbww 8w milight leds are more advanced as they can have their saturation set also. Something the old ones can't. Currently I'm controlling the dual whites with a custom board with a PL1167, and it works quite well, but I would like to add support for the new 8w rgbww but as mentioned it uses a different protocol. If you have any info regarding this any info would be appreciated. Currently I have the channels and sync word used, but haven't figured out the format of the frame. It seems it's using a key to scramble it. 

  Are you sure? yes | no

Woodster wrote 03/19/2016 at 14:45 point

  Are you sure? yes | no

Songkord Thirachai wrote 03/19/2016 at 14:53 point

Thank a lot. ;-)
And sorry about 8w rgbww protocol, i have no idea. I do not have any advance instrument here and now. Maybe i must own it one and try it soon.

  Are you sure? yes | no

Woodster wrote 03/19/2016 at 07:08 point

Hi there, looks like a cool project. Regarding the WiFi bulbs authometion.com has an arduino library for controlling the old dual white and rgbw, but not the rgbww. Do you have the protocol for those? 

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates