This is a board designed to convert i2c commands into neopixel 1-wire signals, to allow driving strings of neopixels from non-realtime devices (like say, a Raspberry Pi).
- Drive up to 167 Neopixels (using Attiny85. This number has not been tested)
- Individual addressability
- Global colour setting also supported
- Optional/removable i2c level shifter, for 5V LED drive and 3v3 i2c bus
- Tiny footprint
- 24x11 mm including level shifter
- 16x11 mm without level shifter
- Standard 6-pin AVR ISP connector
- Component cost: ~£1
Bill of Materials:
|R1, R2||2k ohm 0603 resistor (for level shifter)||http://www.ebay.co.uk/itm/0603-5-SMD-SMT-Chip-Resistor-Kit-0-10Mohm-40-Value-Assorted-Totoal-4000-Pcs-/111344307434?hash=item19eca34cea||< £0.01|
|Q1, Q2||2n7002 N-Channel MOSFET (for level shifter)||http://www.ebay.co.uk/itm/2N7002-SOT-23-N-Channel-SMD-MOS-Field-effect-Mosfet-Transistor-25-Pcs-/291533957420?hash=item43e0c7292c||£0.06|
|C1||0.1u 0603 capacitor||http://www.ebay.co.uk/itm/200-Pieces-White-5-Tolerance-25V-100NF-Thick-Film-SMD-SMT-Chip-Capacitors-0603-/291488645572?hash=item43de13c1c4||< £0.01|
|R3||10k ohm 0603 resistor||http://www.ebay.co.uk/itm/0603-5-SMD-SMT-Chip-Resistor-Kit-0-10Mohm-40-Value-Assorted-Totoal-4000-Pcs-/111344307434?hash=item19eca34cea||< £0.01|
|U1||Attiny25/Attiny45/Attiny85||http://www.ebay.co.uk/sch/i.html?_from=R40&_sacat=0&_nkw=attiny85-20SU&rt=nc&LH_PrefLoc=3&_trksid=p2045573.m1684||£0.70 - £2|
Neopixels/WS2812 individually addressable RGB LEDs are quite cool, but the timing requirements of their 1-wire protocol is hard to meet without a microcontroller. I had a project which required driving neopixels from a Raspberry-Pi, and while there is the handy rpi_ws2812 library, it uses the PWM perihperal of the Pi, which my project was already using for audio output.
So I designed the pixopixel - it's just a tiny Attinyx5 board, which accepts i2c commands on its input, and drives a string of neopixels on the output. What could be simpler than that?!
The i2c register map exposes the pixels as a big long array of G - R - B colour values, which you can write to from whatever i2c capable device you please. It also has a "global" register which can be used to set all of the LEDs to the same colour - saving a lot of i2c bandwidth if you only want to show a single colour.
For full details of the functionality, see the github for the firmware: https://github.com/usedbytes/neopixel_i2c
The actual neopixel driving is done by a slightly modified copy of [cpldcpu]'s light_ws2812 library: https://github.com/cpldcpu/light_ws2812
The firmware makes use of a general purpose AVR i2c slave library I wrote, code for that is available here: https://github.com/usedbytes/usi_i2c_slave
The boards are small enough that I panelled them up in groups of 8 to fit into 5x5 cm squares suitable for Dirty PCBs cheap PCB option. I got 12 panels for £9.29 delivered (to the UK), making each picopixel board just under 10p each! The components are ~£1 per board on top of that.
The board includes an i2c level shifter in case you want to drive LEDs at 5V but your i2c master is only 3v3. If you don't want/need this functionality, the level shifter can be bypassed via some solder bridges, or cut off entirely to leave a smaller board:
Like I mentioned, I mainly wanted these to drive neopixels from a R-Pi. It works great, here's some HSV shininess:
Or how about this possible contender for the smallest (cheapest?) programmable RGB LED throwie?
Add some flashing lights to an ambulance cake:
and actually it works OK as a generic Attiny breakout board. The only pin which isn't broken out is PB3/CLKI, and if you really need a crystal you can wire one in like I did for this hacked-together TV-B-Gone: