Arduino Micro Ambilight - Boblight on Raspberry Pi + Raspbmc with custom WS2801 6-LED strips


Here is my second - better - version of Ambilight.


The system is running on custom made single sided PCB board with Atmega 32U4 (Arduino Leonardo, Arduino Micro) with a few add-ons.


Two USB ports: 

 - one is connected to the computer for receiving data (atmega 32u4 has build-in USB)
 - second is optional and is connected to the TV USB port and its only purpose is to monitor if the TV is ON or OFF. This "sense" is sparated from the rest of the circuit through optocoupler - just in case (none of US wants to do any harm to their telly)

12V barrel socket:

- whole system is powered from 12V/3.5A adapter and 7805 linear voltage regulator is on the board to provide power for the MCU. The PC USB socket is not powering the system at all and is connected only to VUSB on the MCU. Small solder jumper is added to use power from USB for programming
- There is a small P-FET that is added as a reverse polarity protection

6 mini DIP switches:

These switches has following functions:

When the first switch is ON, device go into the TEST MODE.  Switches 2,3,4 are switching on Red, Green or Blue colour on all strips for easy installation and check of faulty LEDs, switch 5 will be cycling through each strip individually. I found it very handy during the Installation.
When the first switch is OFF, device is in normal operation mode and switches has following functions:
Switch 2 : TV sense Enabled / Disabled (when enabled - strips are lit only when the TV is ON)
Switch 3: Brightness 100% / 50%
Switch 4: Recalculate function (It will take data for each channel and recalculate the colours so one of them is always 100% bright and others calculated accordingly) this will make the same nice and bright effect on Raspberry Pi or boblight-X11 as you would get with boblight add-on in XBMC, without any hassle
Switch 5: TV backlight - turn on constant white light or true colour moodlight (set by switch 6) if the TV is ON, but no valid serial data are being received (just watching the telly)

LEDs for:

- 12V power
- PC connected (ON)
- TV connected (ON)
- Serial data (LED1)
- Function active(LED2 & 3)
- System running & Brightness selected (LED 4)


16 strips are made on one 16x10cm single sided PCB board.
6 LEDs on each strip are controlled by  WS2801 LED driver (12VDC, 2 rows by three LEDs)
that gives 2x20mA (40mA) / colour so the WS2801 is connected as constant voltage (up to 50mA/colour).

7 strips on top, 7 on bottom, 5 left & 5 right = 24strip x 6LED = 144RGB LEDs used 
which gives at full power (all white) power consumption slightly less than 3Amps (2.88A)

Power for the WS2801 which is 5V is through 2k resistor, 5.1V zener diode and 10uF/10V 1206 capacitor. Strips are connected in series with four cables.

Schematics & Layout:

Code, schematics and scripts can be downloaded at the bottom

Pictures and Video (running on Raspberry Pi)


How to:

Download: Schematics, board layout, Arduino sketch, scripts & other files

- Copy content of the UBUNTU compiling folder to your home folder and type in the terminal:
sudo chmod 755 install
sudo ./install

if everything goes well, it should download, compile, install boblight and copy boblight.conf to /etc/ and copy modified rc.local that will execute boblight suring startup.

All you will need now is the Boblight Addon

- Copy content of RASPBERRY COMPILING to home folder and you will have to use PuTTY to SSH to Raspberry Pi  and run:

sudo chmod 755 ./stage1
sudo chmod 755 ./stage2
sudo chmod 755 ./stage3

then type in (hope everything goes well for you)

sudo ./stage1 
(this will install all dependencies and updates needed for boblight)
sudo ./stage2
(this will compile boblight and copy boblight.conf and rc.local)
sudo ./stage3
(this will download modified RaspBMC with boblight support and copy it into correct folder)

DO NOT install the Boblight Addon as it is included in the modified build

Then open RaspBMC settings, select Nightly Builds and choose PiBoB, restart & done.


All i wrote are the installation scripts and tested it.

5 komentářů:

  1. Looks great! Can you give as an estimate of the costs for the parts?

    1. Approximately 20-40eur. I had some parts, some from eBay, some from local supplier + pcb. I don't really have any bill of materials.

  2. Just an update, with new raspbmc out, the scripts are no longer needed. Just copy boblightd and pibob

  3. Hi,

    Is it possible to get your card done by any shop as a service ? PCB + parts soldered ?
    I'm very interested as there is an automatic shutdown but not really good for soldering ...



    1. Hi cedric,
      I'm selling this as a kit. It's been modified. You'll get the control board, and addressable LED strips.
      If you'll give me your e-mail, I'll send you photos and prices.