RGB LED Ring V2 — sequels don’t have to be bad

This is the successor to my old (and lame) RGB LED Ring project. Now you get 6-bit color depth (per color!) and a lot more bang.

Version ’2.0 alpha’ – an intermediate step to true enlightenment – uses one LED driver IC and 3 P-channel MOSFETs cycling through the primary colors. This requires special attention in the code to attempt color balancing (forced dot correction at all times).

As of ’2.0 beta’ (likely to become the final version) it comes with 3 dedicated constant current LED driver chips (MBI5168), which completely avoids multiplexing the LEDs and boosts brightness again. Color balancing is done entirely in hardware using 3 potentiometers. The hardware differences should be taken care of in the core part of the demo code, ‘User-land’ code is mostly the same.

If you’re planning to reproduce, better use the design with 3 LED drivers.

And if you should hold one of my boards in your hands and it is the one with P-channel MOSFETs, you probably got it from me (and I made sure you know the differences). If that’s not the case, you should have a word with the seller.


Assembly instructions:


0. Always remember this
1. Ingredients
2. Make it
3. Use it
    3.1 Safety note
    3.2 IR remote control
    3.3 Mood light coaster
    3.4 Use it with Boblight
    3.5 Use it with Amblone



0. Always remember this

This device is strictly ≤ 5V only! It runs down to 3.3V, but at reduced brightness. There is no reverse voltage protection and in general no over-voltage / over-current protection. Please handle with care. If you need to run this board with higher voltages, please use a suitable voltage regulator or even a DC/DC buck regulator. Expect the board to draw about 600mA peak at maximum brightness and set to white. If components get more than just warm or even go ‘pop’, something went terrible wrong.

If you have any trouble, please use the forum!

top


1. Ingredients

V2.0_alpha (design files / code):

It started to snow today... It started to snow today...

1x PCB
1x ATmega168 TQFP 32 7×7
8x RGB LED PLCC6 5050 (D1-D8)
1x MBI5168 SO-16 (narrow)
1x SMD potentiometer 2k (BOURNS TC33X-2-202)
1x 0805 resistor 560R (R3)
5x 0805 resistor 10k (R1, R2, R4, R6, R9)
3x 0805 resistor 180R (R5, R7, R10)
3x 0805 capacitor 100nF (C1, C3, C5)
1x 1206 capacitor 10µF (C2)
1x 1206 capacitor 10µF (C4 polarized!, red bar: +)
3x AO3401 P-channel MOSFET SOT23 (Q1-Q3)
1x 3×2-pin breakaway header
2x 4-pin breakaway header
1x 6-pin breakaway header

V2.0_beta (design files / code):

V2.0 beta V2.0 beta

1x PCB
1x ATmega168 TQFP 32 7×7
8x RGB LED PLCC6 5050 (D1-D8)
3x MBI5168 SO-16 (narrow)
3x SMD potentiometer 2k (BOURNS TC33X-2-202)
3x 0805 resistor 560R (R3, R4, R5)
2x 0805 resistor 10k (R1, R2)
5x 0805 capacitor 100nF (C1, C3, C4, C6, C8)
1x 1206 capacitor 10µF (C2)
3x 1206 capacitor 10µF (C5, C7, C9 – polarized! – red bar: +)
1x 3×2-pin breakaway header
2x 4-pin breakaway header
1x 6-pin breakaway header

V2.0.d (design files / code):

Added another 8x 0805 LEDs Added another 8x 0805 LEDs

Common parts:

1x PCB
1x ATmega168 TQFP 32 7×7
2x 0805 resistor 10k (R1, R2)
2x 0805 capacitor 100nF (C1, C3)
1x 1206 capacitor 10µF (C2)
1x 3×2-pin breakaway header
2x 4-pin breakaway header
1x 6-pin breakaway header

RGB LEDs:

8x RGB LED PLCC6 5050 (D1-D8)
3x MBI5168 SO-16 (narrow)
3x SMD potentiometer 2k (BOURNS TC33X-2-202)
3x 0805 resistor 560R (R3, R4, R5)
3x 1206 capacitor 10µF (C5, C7, C9, polarized! – red bar: +)
3x 0805 capacitor 100nF (C4, C6, C8)

_or_

Single color:

8x single color LED PLCC2 (D1-D8)
1x MBI5168 SO-16 (narrow), (IC2) see mark on PCB !
1x SMD potentiometer 2k (BOURNS TC33X-2-202), (right next to IC2)
1x 0805 resistor 560R (R3)
1x 1206 capacitor 10µF (C5, polarized! – red bar: +)
1x 0805 capacitor 100nF (C4)

completely optional:

8x 0603 resistor 1k (R6-R13)
8x 0805 SMD LED (D9-D16)

V2.0.e (design files / code):

This version is functionally identical to V2.0.d – except that it includes a header for connecting an IR receiver like the TSOP38238.

V2.1 (design files / code):

This version too has the header for the IR sensor (but flipped compared to 2.0.e).

In addition the LED driver enable pin (OE) may now optionally be controlled with a hardware PWM pin. This allows for smoother color changes when using the ShiftPWM library in the case when all LEDs are controlled in unison. When ShiftPWM is used with the HSV color-space, the modulation depth (available color values) naturally goes down significantly when setting V (brightenss) to small numbers. This creates a ‘choppy’ appearance when a mood-light is set to low brightness. Switching the V-setting to hardware PWM circumvents this issue, as the V-value used by the library is always 255.

TSOP38238 ready - IR control TSOP38238 ready - IR control

Common parts:

1x PCB
1x ATmega168 TQFP 32 7×7
2x 0805 resistor 10k (R1, R2)
2x 0805 capacitor 100nF (C1, C3)
1x 1206 capacitor 10µF (C2)
1x 3×2-pin breakaway header
2x 4-pin breakaway header
1x 6-pin breakaway header

RGB LEDs:

8x RGB LED PLCC6 5050 (D1-D8)
3x MBI5167 SO-16 (narrow)
3x SMD potentiometer 2k (BOURNS TC33X-2-202)
3x 0805 resistor 560R (R3, R4, R5)
3x 1206 capacitor 10µF (C5, C7, C9, polarized! – red bar: +)
3x 0805 capacitor 100nF (C4, C6, C8)

_or_

Single color:

8x single color LED PLCC2 (D1-D8)
1x MBI5168 SO-16 (narrow), (IC2) see mark on PCB !
1x SMD potentiometer 2k (BOURNS TC33X-2-202), (right next to IC2)
1x 0805 resistor 560R (R3)
1x 1206 capacitor 10µF (C5, polarized! – red bar: +)
1x 0805 capacitor 100nF (C4)

completely optional:

8x 0603 resistor 1k (R6-R13)
8x 0805 SMD LED (D9-D16)
1x TSOP38238 IR receiver

Please also have a look at the schematic for the board(s), which is part of the KiCad design files. You can find some datasheets on the ‘Tech/Datasheets’ page.

top


2. Make it

Please note that the RGB LEDs don’t like heat at all, so please turn down the heat and finish quickly. With standard SnPb 60/40 solder (0.5mm diameter, no-clean flux core, preferably water soluble), I recommend to stay below 250°C for soldering the LEDs. You can crank up the heat again for everything else.

Make sure to assemble all components that have a preferred orientation but could fit on the board in multiple ways exactly as shown in the slideshow. These parts are: ATmega168, RGB LEDs, MBI5168, polarized tantalum capacitors (orange body with a red bar indicating +).

The RGB LEDs will survive wrong orientation and just won’t turn on. The other 3 parts mentioned above will be destroyed and may even blow up and release the magic blue smoke.

If you want the 6-pin programming header on the board permanently, you must solder it before the AVR chip. To avoid interference, it must not protrude on the backside. This is shown at the very end of the slide-show.

And in case of doubt: use extra flux!

Docs_rgb-led-toy__assembly-steps

Now that you have finished assembly, it is time to again check for obvious problems: shorts, misaligned parts, blobs of solder… If your board has passed visual inspection, it is time to see if the board actually works. Please make sure all of the potentiometers are in the center position. This should keep the LEDs’ brightness to a tolerable level. You can re-adjust the potentiometers later. You cannot damage the LEDs by maladjustments. Please also note that these potentiometers are single-turn and that there are no end-stops to speak of. Handle them with care.

Now connect your ISP (you do have one, don’t you?) to the ISP header and adjust the FUSE bits and upload some demo code. The simplest way is to add the board definitions (see the code repository) to the Arduino IDE’s ‘boards.txt’ and use a supported ISP (USBtiny, USBasp…) for the hard work. Connect the ISP to your computer and the board. Start the 1.0 IDE.

There are two board definitions to choose from. The preferred one is “RGB LED RING – ATmega168 / 8MHz RC OSC / optiboot 19k2 (default)”, the emergency-fallback one is “RGB LED RING – ATmega168 / 8MHz RC OSC / ATmegaBOOT_168_pro_8MHz (alternative)”. Try the default one first. Now select your ISP and click on ‘Burn Bootloader’. Then open the ‘V2_demo.pde’ file, connect your FTDI-compatible USB/serial adapter and upload the code. Using the custom bootloader is more reliable and also unfortunately slower than using vanilla ‘optiboot’. This change to slower speeds was necessary as the internal RC oscillator may be unstable and drift in frequency, which upsets the serial port speeds as well.

Please make sure the pinout matches the silkscreen on the circuit board – and if needed, simply make an adapter with some stranded wire and male/female headers.

If everything works out, you will be greeted with a bright and colorful demo – with all LEDs lit.

If you should still have issues with uploading code using the serial port + bootloader, remember that this device runs with the internal RC-oscillator. It is not super accurate and drifts with temperature, which can be compensated at run-time with the OSCCAL register. If you’re at room-temperature (approx 21°C) and it acts up during upload, it usually helps to warm up the chip a bit by slowly blowing warm air onto it. Body temperature seems to be just the right thing ;-)

For support, please use the forum. You will be asked tricky questions to register.

A good introduction to how the brightness regulation using ‘BCM’ works can be found here. Here’s another one drilling down even deeper. It also introduces ‘MIBAM’, which is supposed to fix some of the issues of ‘BCM’. I’m still trying to use this information to improve the demo code.

Now it is a good time to adjust the white balance. With the alpha boards, you need to do it in software using the dot-correction feature, with the beta (and later boards) you use a small screwdriver and play with the 3 potentiometers. Ideally you should set all LEDs to white:

And finally a couple of videos:

There’s also a linux bash script to do the same job using avrdude.

Do not stare into the LEDs when at full brightness!

top


3. Use it

An ever growing collection of what I’ve used this little board for.


3.1 Safety note

Please note that the LEDs will get warm. If you crank them up to the max they will get warmer. More importantly: the driver chips on the back side will get warm or even hot (very unpleasant to touch) too! You will especially notice this when powering the board with 5V. The effect is less pronounced at lower voltages.

If that is the case in your application, please add a heat-sink to the driver chips. Also think about ventilation. Gluing a small piece of aluminium sheet metal to them with heat-conductive epoxy should suffice. Make sure the aluminium doesn’t touch any non-plastic parts of the circuit and you still have access to the potentiometers.


3.2 IR remote control

This topic has a blog post of its own. Take me there at once!

top


3.3 Mood light coaster

This topic has a blog post of its own. Take me there at once!

top


3.4 Use it with Boblight

Boblight is a collection of tools for driving lights connected to an external controller.”

Once you have created the configuration file (/etc/boblight.conf) you can start the server process (‘boblightd’) which talks to the board via a serial port (e.g. /dev/ttyUSB0). Then it is time to start a client (e.g. ‘boblight-X11′) which takes a video source, does some processing and talks to the board via the server process. With the default network settings client and server may be run as user processes and don’t require root privileges. Good!

The result of this is an ambilight. Play a video and it will change color(s) depending on what is shown on the screen. You can define the number of channels, the number of ‘lights’ (e.g. one light is made up of 3 channels of RGB), gamma correction, … , and the section of the screen that is evaluated. It works quite nicely.

You will find an adapted ‘boblight.conf’ in the ‘/setup-files/boblight’ folder and a little demo in the ‘/V2_demo/examples’ folder.

top


3.5 Use it with Amblone

Amblone is a windows ambilight software that can talk to devices over the serial port. You can find a simple 1-channel demo in the code repository.

top

This entry was posted in Electronics. and tagged , , , , , . Bookmark the permalink.

7 Responses to RGB LED Ring V2 — sequels don’t have to be bad

  1. Pingback: RGB LED Ring V2 — sequels don’t have to be bad « adafruit industries blog

  2. Pingback: LED ring kits - BuildLounge » BuildLounge

  3. Thank you for the information

  4. Pingback: Electronics-Lab.com Blog » Blog Archive » RGB LED Ring V2 – sequels don’t have to be bad

  5. Pingback: RGB LED Ring – Version 2 - Hacked Gadgets – DIY Tech Blog

  6. Pingback: RGB LED Ring – Version 2 | کیت برد اولین جامعه مجازی آموزشی خودت انجام بده فارسی |Kitboard DIY |

  7. Pingback: Mood light coaster | My 2µF

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">