LED Rainbow

The LED Rainbow is a dedicated Pulse Width Modulation (PWM) controller which generates color changing effects with RGB LED lighting products. The circuit controls three outputs, each which has the ability to run an LED segment, and with three segments, is a natural for the control of RGB LED arrays.

See: LED Rainbow Related Products


LED Rainbow Sequences are fully customizable and are contained in the microcontroller, which has the ability to strobe, cycle and fade the lighting, creating a massive palette of over 16 million colors using Pulse Width Modulation (PWM) technology. Each output has a resolution of 8-bits, which gives each color a range of 256 intensities and when the three colors are mixed together, a full rainbow of color combinations is possible.

With a minimal parts count, the LED Rainbow is very economical for the hobbyist to build, using industry standard components and running off of a standard 12v-15v power supply. The 2" (51mm) square board is a double sided construction with a detailed silk-screen which aids in the placement of the components.
 

Want to see the LED Rainbow in action? Posted on YouTube is a video of the controller running one of our LED MR16 RGB display board, holding four RGB LEDs, and housed in a standard household frosted lamp globe. Assembly time of this project was about one hour and the results are amazing to see and produce a bright, shadow-free show. We have seen our LED Rainbow incorporated into other lighting products also, including acrylic displays for edge lighting.

We have an Instructable, which is a very detailed construction guide of the LED Rainbow. The Instructable walkthrough of the complete assembly process of one of the systems and can be completed by even a beginner at electronics in about 30 minutes.

We provide additional code for the LED Rainbow, and we encourage you to visit our site often to view the different coding sequences we may come up with. All are fully downloadable for free and can be programmed into your own PIC processor (providing you have a PIC programmer). Additional detailed support including coding information is also on our support web site to assist you in creating your own effects.

LED Rainbow Options and User Guides

The LED Rainbow is available as a fully assembled and tested product, as a kit of components you can build at home, or just the bare board which you can supply your own components for. Average assembly time of the kit can be accomplished by the novice builder in less than one hour.

You can download the complete instruction manual with construction guide, schematics and detailed assembly instructions. Looking for the user guide for a previous version of the LED Rainbow? The user guide for the version 2 and version 1 model is available here for download.

Display Sequences

The LED Rainbow contains a pre-built set of routines in it. The initial public release of the firmware was version 2.0 which contained over 30 various fades, flashes and color combinations. On March 20, 2009, version 3 of the firmware was released and now contains over 50 different sequences.

New in version 3 in addition to the extra sequences, is the placement of “markers”. Markers allow you to quickly determine where in the list of sequences you are located. Positioned every ten sequences, there is a special sequence which blinks out the current location. For example, if you were at sequence 30, the LEDs would blink three times; and the same for position 10, 20, 40 and 50, with one blink for every ten positions. The exception to this is the sequence located at position 60, this is actually the last usable sequence and is not a position marker. The sequence located at position 61 (the last sequence on the chip) is use to identify the version of firmware which will blink just the green channel three times (for version 3 of the firmware).

Each effect is selected by pressing of the Mode (S1) button. The LED Rainbow will remember the last sequence you were using after 10 seconds of viewing it, which when powered on at a later date will automatically start with your last viewed sequence.

We have attempted to describe the various effects below, but the descriptions cannot describe just how good the LED Rainbow displays the combinations. We encourage you to use the chart as a reference. The version 3 firmware is available for immediate download from the Programming page.

Sequences Included in the version 3 Firmware

  1. Slow fade all colors to 25% intensity and fade back down
  2. Slow fade all colors to 50% intensity and fade back down slower
  3. Slow fade of all colors up to 50% intensity with slow fade down low intensity
  4. Very slow fade of all colors to 50% intensity with slow fade back down very low intensity
  5. Very slow fade of all colors to 50% intensity with even slower fade back down very low intensity
  6. Slow fade of all colors to 50% intensity with faster fade back down to fully off
  7. Slower fade of all colors to 50% intensity with faster fade back down to fully off
  8. Red full intensity, slow fade to off; Green full intensity, slow fade to off; Blue full intensity, slow fade to off
  9. Slow fade of Red to full intensity, slow fade to off; Slow fade of Green to full intensity, slow fade to off; Slow fade of Blue to full intensity, slow fade to off
  10. Position Marker: Position 10 (1 blink of all LEDs)
  11. Slow fade of Red on, slow fade of Green on, slow fade of Red off, slow fade of Blue on, slow fade of Green off, slow fade of Red on, slow fade of Green off
  12. Slow cycle of fade between rainbow of color, various combinations of Red, Green and Blue on/off at various intensities
  13. Full Red, 100% intensity
  14. Full Green, 100% intensity
  15. Full Blue, 100% intensity
  16. Purple: Red and Blue combination
  17. Orange: Red and Green combination
  18. Bright White: Red, Green and Blue combination
  19. Half White: Red, Green and Blue combination
  20. Position Marker: Position 20 (2 blinks of all LEDs)
  21. Low White: Red, Green and Blue combination
  22. Full color spectrum fade
  23. Slower full color spectrum fade
  24. Slow warm color spectrum fade
  25. Cool color spectrum fade
  26. Purple color fades
  27. Red, Green, Blue cycle at 50mS rate
  28. Red, Green, Blue cycle at 100mS rate
  29. Red, Green, Blue cycle at 200mS rate
  30. Position Marker: Position 30 (3 blink of all LEDs)
  31. Red, Green, Blue cycle at 300mS rate
  32. Red, Green, Blue cycle at 400mS rate
  33. Red, Green, Blue cycle at 500mS rate
  34. Red, Green, Blue cycle at 1000mS rate
  35. Slow flashing Red
  36. Slow flashing Green
  37. Slow flashing Blue
  38. Red to green wig-wag 100ms each color on
  39. Red to green wig-wag 150ms each color on
  40. Position Marker: Position 40 (4 blinks of all LEDs)
  41. Red to green wig-wag 200ms each color on
  42. Double flash red, pause, double flash green, pause and repeat (100ms on, 150ms off)
  43. Double flash red, pause, double flash green, pause and repeat (150ms on, 200ms off)
  44. Triple flash red, pause, triple flash green, pause and repeat (100ms on, 150ms off)
  45. Triple flash red, pause, triple flash green, pause and repeat (150ms on, 200ms off)
  46. Dark blue to purple throb
  47. Light blue to purple, slow throb
  48. Pastel colors morphing
  49. Full spectrum fade over 1.27 seconds per color, hold color for 50mS
  50. Position Marker: Position 50 (5 blinks of all LEDs)
  51. Full spectrum fade over 2.50 seconds per color, hold color for 50mS
  52. Full spectrum fade over 5.10 seconds per color, hold color for 50mS
  53. Full spectrum fade over 10.2 seconds per color, hold color for 50mS
  54. Full spectrum fade over 1.27 seconds per color, hold color for 100mS
  55. Full spectrum fade over 2.50 seconds per color, hold color for 100mS
  56. Full spectrum fade over 5.10 seconds per color, hold color for 100mS
  57. Full spectrum fade over 10.2 seconds per color, hold color for 100mS
  58. Purple pulsing
  59. Lime-green pulsing
  60. Orangey pulsing
  61. Firmware Version Marker: 3 Flashed of Green

Programming

Routines used on the LED Rainbow are fully customizable, although programming skills are required along with a PIC programmer to write your code to the PIC microcontroller.

We have customized the sequence files, and have both the source and HEX files available for free download.

If you would prefer not to customize the code yourself, you can choose to download the HEX files, which can be programmed into your PIC microcontroller. We have standardized on the Microchip PIC 12F683, which features 2Kx14 of programming space, along with 128x8 bytes of RAM, all in a single, 8-pin package. This should have more than enought space to hold almost any customized sequences you can dream of creating.

When you download the source files, the ZIP file will contain a number of individual files. Each of these files is necessary when compiling the application, which is done with the Microchip MPLAB IDE. For our programming and testing, we used v8.00.
 

The Microchip MPLAB IDE is available from their site for free. When visiting the Microchip site, look for a link to the MPLAB IDE from their home page.

Contained in the ZIP file, there is a single file called SequenceData.inc which contains the code to control the lighting sequences. This file can be edited, adding additional code to customize your own sequences, or you can amend the code to bring new or different features, or delete sections if you do not want specific sequences.

Shown below is a sample of the SequenceData.inc file. Pay close attention to the format of the data as each sequence is terminated with an 'end of sequence' terminator line (shown in BLUE), while an 'end of all data' tag is used to terminate all activities (shown in RED). Each line of data, other than terminator lines, must contain five separate values, which indicate Fade Rate, Hold Time, along with the Red, Green and Blue intensity levels.


When designing sequences, there can be a maximum of 256 individual sequences although you will likely run out of program space on the processor prior to reaching that level.

Some simple guidelines to follow when creating your sequences:

  1. Data lines must start with the 'dt' (data table) assembler directive.
     
  2. All data is specified using decimal values.
     
  3. Each data value must be separated by a comma.
     
  4. The sequence data on each line has five separate comma-separated fields:
    1. Fade Rate: The speed at which the colors fade from the current value to the new value. Each step occurs at an interval of 5ms x Fade Rate. Legal values range from 0 to 254.
      • A Fade Rate value of 0 indicates the RGB values will be updated immediately without fading.
      • The Fade Rate value must not be set to 255 except to indicate an end of sequence. (see e. below)
         
    2. Hold Time: After fade completes, delay before moving to next data line. Interval is 50mS x Hold Time. Legal values range from 0 to 254.
      • A Hold Time value of 255 following a Fade Rate of 255 indicates an 'end_of_all_sequencea data.
         
    3. Red, Green and Blue PWM values. 0 = 0% (LED off) through to  255 = 100% (LED fully on)
      Typically changes in LED brightness are more noticeable between 0 and 128 than from 128 to 255.
       
  5. End of the current sequence data is indicated by the Fade Rate value of '255'.  When the routine encounters this, it restarts the sequence from the beginning.
     
  6. At the end of all available sequence data, both the Fade Rate and Hold Time fields must be set to '255'

After editing sequenceData.inc the file should be saved and the rgbsa-inet.asm reassembled. The resulting rgbsa-inet.hex file can them be programmed into the PIC.

 

LED Rainbow Downloads
File Name Description
led_rainbow_all_files_v3.zip Version 3: Contains all files necessary to edit or compile your own sequences for the LED Rainbow. All files are included and represent the version 3.0 code as supplied by us. Also included in the ZIP file is the HEX file which can be used to program your own 12F683 microchip processor.
led_rainbow_v3_for_12F683.zip Version 3: Contains version 3.0 of our LED Rainbow code in HEX format which can be used to program your own 12F683 microchip processor.
led_rainbow_all_files_v2.zip Contains all files necessary to edit or compile your own sequences for the LED Rainbow. All files are included and represent the version 2.0 code as supplied by us. Also included in the ZIP file is the HEX file which can be used to program your own 12F683 microchip processor.
led_rainbow_v2_for_12f683.zip Contains version 2.0 of our LED Rainbow code in HEX format which can be used to program your own 12F683 microchip processor.
 

Custom Animation Sequences

During the development process, we sometimes receive special requests for customized sequences for the LED Rainbow, and other times we receive sequences that others have developed and desire to share with others. The sequences below are all customized, some simple, some very complex, but are all available for you to take and use in your displays. All you need to do is to download the files that you wish and program them into your processors.

Each of the sequences below are ZIP files containting a simple text file that can be renamed to the sequencedata.inc format which you compile and program into your processor.
pade.zip: This is the sequence used by Manfred Pade for his outdoor garden lights project. See his dedicated page for more information including a tutorial on building up the garden lights.
fades.zip: Two very simple, yet visually stunning displays which cycle through either a blue-red sequence or a red-orange sequence. Each of these are offered is six display speeds of approximately 3.6, 6.1, 8.7, 11.2, 13.8 and 16.3 seconds.