> **Source:** Core Electronics is an Australian maker-electronics retailer and manufacturer based in Newcastle, NSW, run by a team of makers and educators. We design and manufacture our own product lines (PiicoDev, CE originals) and are official retailers for iconic maker and industrial brands including Raspberry Pi, Arduino, Adafruit, SparkFun and DFRobot. Orders ship Australia-wide from our Newcastle warehouse. Prices are in AUD and include GST. Pricing, stock and dispatch on this page are generated from the store's live catalog. Full machine-readable index: https://core-electronics.com.au/llms.txt

# ShiftBrite V2.0

**Type:** Product page · **SKU:** POLOLU-1222 · **Brand:** [Pololu](https://core-electronics.com.au/brands/pololu-australia)
**Page:** https://core-electronics.com.au/shiftbrite-v2-0.html ([markdown](https://core-electronics.com.au/shiftbrite-v2-0.html.md))

## Retired product

This product is retired and no longer available for purchase. Search the catalogue for an alternative.

## How to buy

- **Search the catalogue:** `https://core-electronics.com.au/search/{query}.md` (URL-encode the query; pages 2-3 at `search/{query}/{page}.md`; `search.md?q=` also works)
- **Payment methods, purchase orders, policies and contact details:** https://core-electronics.com.au/llms.txt
## Description

| [![](https://core-electronics.com.au/media/remote_images/0J1568.150_rHQbFt.gif%3Fbf56ec4aad6b970e44e2e00da4f79b8c)![](https://core-electronics.com.au/media/remote_images/zoom-d0cfc0fffa825c4654893ef42b77cee3_f3uyoV.png)](https://core-electronics.com.au/#) |
|---|
| A ShiftBrite RGB LED module can display over one billion different colors. |

 | [![](https://core-electronics.com.au/media/remote_images/0J3664.200_MzEFvO.jpg%3F23981718994b058f5833a4e1f7bc7e04)![](https://core-electronics.com.au/media/remote_images/zoom-d0cfc0fffa825c4654893ef42b77cee3_f3uyoV.png)](https://core-electronics.com.au/#) |
|---|

## Overview

ShiftBrites are modules by macetech that integrate the Allegro A6281 3-channel constant current LED driver with a large, high-brightness RGB LED. Using just three digital output pins and a simple protocol, your microcontroller can control a long chain of these modules. Each ShiftBrite in the chain can be independently changed to any of the 1,073,741,824 possible colors to create dynamic displays and decorations. Adjustable current for each color channel lets you correct for slight differences in brightness. In addition, the LED driver is protected from overheating by automatic over-temperature shutdown.

The ShiftBrite V2.0 is a redesigned version of the [original ShiftBrite](https://core-electronics.com.au/catalog/product/view/sku/POLOLU-1240) that offers the following key improvements:

- New mounting ears and large mounting holes for easier installation.
- Better indication of polarity and data direction on both top and bottom.
- Larger power traces for improved power handling and chaining.
- Additional power filtering capacitor.
 
The ShiftBrite V2.0 comes in two configurations: one [with male header pins](https://core-electronics.com.au/shiftbrite-v2-0.html) and one [without male header pins](https://core-electronics.com.au/headerless-shiftbrite-v2-0.html). The pin spacing is 0.1", making ShiftBrites compatible with [breadboards](https://core-electronics.com.au/#) and perfboards. Pololu's custom six-conductor cables, available in lengths of [6"](https://core-electronics.com.au/6x1-f-f-6-cable-for-shiftbrites-and-shiftbars.html) and [12"](https://core-electronics.com.au/6x1-f-f-12-cable-for-shiftbrites-and-shiftbars.html) and [24"](https://core-electronics.com.au/6x1-f-f-24-cable-for-shiftbrites-and-shiftbars.html), can also be used to easily chain together multiple modules.

The original ShiftBrite and new ShiftBrite V2.0 are pin-compatible and have the same basic functionality, so a mix of original and new ShiftBrites can be chained together on the same strand. Please note that several of the pictures, diagrams, and videos on this page show the original ShiftBrites (with green solder masks); the V2.0 model has a larger PCB with a black solder mask as shown in the main product picture.

## Example ShiftBrite applications

Several ShiftBrite applications are shown below, including an example setup using a [Micro Maestro](https://core-electronics.com.au/micro-maestro-6-channel-usb-servo-controller-assembled.html) as a ShiftBrite controller. In the Micro Maestro example, digital outputs 0, 1 and 2 are used to send the control signals to the clock, latch, and data lines, the enable line is connected directly to GND, and 6 V power to the Maestro is delivered from the ShiftBrite chain. Maestro source code to control a ShiftBrite is available in the Example Scripts section of the Maestro User’s Guide. Pololu's [Orangutan robot controllers](https://core-electronics.com.au/#) can also be used to control ShiftBrites, as can the [Arduino](https://core-electronics.com.au/catalog/product/view/sku/POLOLU-1630). Source code for the Orangutan is available at the bottom of this page.

 | \| [![](https://core-electronics.com.au/media/remote_images/0J2055.250_1cPy2O.jpg%3F04bb455836045b9ee5631f2d85d39a2b)![](https://core-electronics.com.au/media/remote_images/zoom-d0cfc0fffa825c4654893ef42b77cee3_f3uyoV.png)](https://core-electronics.com.au/#) \| \|---\| \| A ShiftBrite being controlled by a Micro Maestro 6-channel servo controller. \| | \| [![](https://core-electronics.com.au/media/remote_images/0J1564.250_YKCAiz.jpg%3Fec5357ece5d220079f349fec87f0ddd2)![](https://core-electronics.com.au/media/remote_images/zoom-d0cfc0fffa825c4654893ef42b77cee3_f3uyoV.png)](https://core-electronics.com.au/#) \| \|---\|---\| \| A display made of 32 ShiftBrite modules, used to display real-time data. \| |
|---|

## Using the ShiftBrite V2.0

Since ShiftBrites are controlled by Allegro’s A6281 LED driver, careful reading of the A6281’s datasheet (315k pdf) is recommended. Each ShiftBrite input is buffered and output on the corresponding output pin. This allows you to chain together ShiftBrites without increasing the number of IO pins dedicated to controlling the modules. The picture below shows three ShiftBrites chained together.

| ![](https://core-electronics.com.au/media/remote_images/0J1566.600_qGKeDi.jpg%3F742ceea7b39b7466454e6dd5ee29e7ba) |
|---|
| Three ShiftBrites chained together. |

Pololu's [6"](https://core-electronics.com.au/6x1-f-f-6-cable-for-shiftbrites-and-shiftbars.html), [12"](https://core-electronics.com.au/6x1-f-f-12-cable-for-shiftbrites-and-shiftbars.html), and [24" cables](https://core-electronics.com.au/6x1-f-f-24-cable-for-shiftbrites-and-shiftbars.html) for ShiftBrites make it easy to connect multiple modules, as shown below.

 | \| [![](https://core-electronics.com.au/media/remote_images/0J1809.300_0tUmgN.jpg%3F1274e672fae221ff0bced205f7027949)![](https://core-electronics.com.au/media/remote_images/zoom-d0cfc0fffa825c4654893ef42b77cee3_f3uyoV.png)](https://core-electronics.com.au/#) \| \|---\| | \| [![](https://core-electronics.com.au/media/remote_images/0J3665.300_ny8oJp.jpg%3F0f753abf9490e07d6ab2a110ffd61dba)![](https://core-electronics.com.au/media/remote_images/zoom-d0cfc0fffa825c4654893ef42b77cee3_f3uyoV.png)](https://core-electronics.com.au/#) \| \|---\|---\| |
|---|

You can make your own shorter cables with Pololu's [3" wires with pre-crimped terminals](https://core-electronics.com.au/wires-with-pre-crimped-terminals-50-piece-rainbow-assortment-f-f-3.html) and Pololu's [0.1" 6×1 crimp connector housings](https://core-electronics.com.au/0-1-2-54mm-crimp-connector-housing-1x6-pin-10-pack.html).

| [![](https://core-electronics.com.au/media/remote_images/0J1565.150_boq7xK.jpg%3Ff536d19fd46c4ce834bc1b234f14f0af)![](https://core-electronics.com.au/media/remote_images/zoom-d0cfc0fffa825c4654893ef42b77cee3_f3uyoV.png)](https://core-electronics.com.au/#) |
|---|
| Pinout diagram for the ShiftBrite module. |

Each ShiftBrite has a 32-bit shift register. When a rising edge is detected at the clock in pin (CI), the data in pin (DI) value is shifted onto the first bit of the shift register, and the last bit sets the value of the data out pin (DO). After you have loaded a 32-bit packet into the shift register of each ShiftBrite in the chain, bringing the latch in pin (LI) from low to high causes the data to take effect (changing the color or updating a configuration setting). LI must be brought low again before clocking in additional data.

The data packet format is shown in the picture below. For more details about the data packet format, as well as timing and other electrical parameters, see the A6281 datasheet (315k pdf). You can find further documentation and Arduino sample code at macetech’s ShiftBrite documentation page.

| ![](https://core-electronics.com.au/media/remote_images/0J1567.600_GwTkzU.jpg%3F94104f1531aafc70991b875f45d50e9e) |
|---|
| ShiftBrite packet diagram. The second row shows a color packet, while the third row shows a command packet. |

To send data to the ShiftBrite, you need to use at least three digital I/O pins (four if you want to use the EI pin). Pololu's [Orangutan robot controllers](https://core-electronics.com.au/#) work well for this. Here is some sample code for setting the colors of a chain of ShiftBrites using bit banging on the AVR. The chain can be arbitrarily long, but the changing color pattern will repeat on every sixth module.

 [?](https://core-electronics.com.au/#)| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | `// ShiftBrite communication for the AVR using bit banging.` `//` `// Pin Assignments (any four free digital I/O pins will do)` `//` `// Data   PC2` `// Latch  PC3` `// Enable PC4` `// Clock  PC5` `//` `// Feel free to modify and use this code for your AVR.` `#include <avr/io.h>`   `typedef` `union` `ShiftBritePacket` `{` `    ``unsigned ``long` `value;` `    ``struct` `    ``{` `        ``unsigned greenDotCorrect:7;` `        ``unsigned clockMode:2;` `        ``unsigned :1;` `        ``unsigned redDotCorrect:7;` `        ``unsigned :3;` `        ``unsigned blueDotCorrect:7;        ` `    ``};` `    ``struct` `    ``{` `        ``unsigned green:10;` `        ``unsigned red:10;` `        ``unsigned blue:10;` `        ``unsigned command:1;` `    ``};` `} ShiftBritePacket;`   `// colorPacket returns a ShiftBritePacket for setting color brightnesses` `//` `// red, green, and blue are brightness values from 0 to 1023. 0 is off, and ` `// 1023 is brightest.` `ShiftBritePacket colorPacket(unsigned ``int` `red, unsigned ``int` `green, unsigned ``int` `blue)` `{` `    ``//Make a packet and initialize all of the bits to zero.` `    ``ShiftBritePacket shiftbrite_packet = {value:0};`   `    ``shiftbrite_packet.red   = red;` `    ``shiftbrite_packet.green = green;` `    ``shiftbrite_packet.blue  = blue;`   `    ``return` `shiftbrite_packet;` `}`     `// commandPacket returns a ShiftBritePacket for sending commands to the A6281.` `//` `// redDotCorrect, greenDotCorrect, and blueDotCorrect lets you control what ` `//   percentage of current is flowing to each color diode. ` `//   Refer to page 8 of the datasheet for more information.` `// clockMode lets you set the PWM frequency for the diodes. ` `//   Refer to page 7 of the datasheet for more information.` `ShiftBritePacket commandPacket(unsigned ``int` `redDotCorrect, unsigned ``int` `greenDotCorrect, ` `                               ``unsigned ``int` `blueDotCorrect, unsigned ``char` `clockMode)` `{` `    ``//Make a packet and initialize all of the bits to zero.` `    ``ShiftBritePacket shiftbrite_packet = {value:0};`   `    ``shiftbrite_packet.redDotCorrect   = redDotCorrect;` `    ``shiftbrite_packet.greenDotCorrect = greenDotCorrect;` `    ``shiftbrite_packet.blueDotCorrect  = blueDotCorrect;` `    ``shiftbrite_packet.clockMode = clockMode;` `    ``shiftbrite_packet.command = 1;`   `    ``return` `shiftbrite_packet;` `}`   `void` `sendPacket(ShiftBritePacket shiftbrite_packet)` `{` `    ``for``(``int` `i = 1; i < 32 + 1; i++)` `    ``{` `        ``//Set the appropriate Data In value according to the packet.` `        ``if` `((shiftbrite_packet.value >> (32 - i)) & 1)` `            ``PORTC \|= (1 << PORTC2);` `        ``else` `            ``PORTC &= ~(1 << PORTC2);`   `        ``//Toggle the clock bit twice.` `        ``PORTC ^= (1 << PORTC5);` `        ``PORTC ^= (1 << PORTC5);` `    ``}` `}`   `void` `latch()` `{` `    ``// Set Latch high` `    ``PORTC \|= (1 << PORTC3);` `    ``// Set Latch low` `    ``PORTC &= ~(1 << PORTC3);` `}`     `void` `sendColorWheelPacket(unsigned ``int` `location_on_wheel)` `{` `    ``if` `(location_on_wheel < 400)` `        ``sendPacket(colorPacket(400,(location_on_wheel % 400),0));   ` `    ``else` `if` `(location_on_wheel < 800)` `        ``sendPacket(colorPacket(400-(location_on_wheel % 400),400,0));` `    ``else` `if` `(location_on_wheel < 1200)` `        ``sendPacket(colorPacket(0,400,(location_on_wheel % 400)));` `    ``else` `if` `(location_on_wheel < 1600)` `        ``sendPacket(colorPacket(0,400-(location_on_wheel % 400),400));` `    ``else` `if` `(location_on_wheel < 2000)` `        ``sendPacket(colorPacket((location_on_wheel % 400),0,400));` `    ``else` `if` `(location_on_wheel < 2400)` `        ``sendPacket(colorPacket(400,0,400-(location_on_wheel % 400)));` `}`   `int` `main() {` `    ``// Set all to outputs.` `    ``DDRC \|= (1 << PORTC2); ``// Data In` `    ``DDRC \|= (1 << PORTC3); ``// Latch` `    ``DDRC \|= (1 << PORTC4); ``// Enable` `    ``DDRC \|= (1 << PORTC5); ``// Clock`   `    ``// Set the Enable output low to enable the ShiftBrites.` `    ``PORTC &= ~(1 << PORTC4);`   `    ``//Have the ShiftBrites change from red to yellow to green to cyan to blue ` `    ``//to purple and back to red.` `    ``while``(1)` `    ``{` `        ``for` `(``int` `i = 0; i < 2400; i++)` `        ``{` `            ``sendColorWheelPacket(i);` `            ``sendColorWheelPacket((i+400) % 2400);` `            ``sendColorWheelPacket((i+800) % 2400);` `            ``sendColorWheelPacket((i+1200) % 2400);` `            ``sendColorWheelPacket((i+1600) % 2400);` `            ``sendColorWheelPacket((i+2000) % 2400);`   `            ``latch();` `        ``}` `    ``}` `    `  `    ``//Loop forever` `    ``while``(1);` `}` |
|---|---|

## Images

- [Product image 1](https://core-electronics.com.au/media/catalog/product/s/h/shiftbrite_v2.0__pololu_1222__00.jpg)
