Author Topic: WS2811 RGB light strip and digispark  (Read 16336 times)

Neon22

  • Newbie
  • *
  • Posts: 6
WS2811 RGB light strip and digispark
« on: May 27, 2013, 10:48:35 pm »
I see others have made progress with running the LED strips using the WS2811 chipset for individual RGB control.
Here's one:
Driving_the_WS2811_at_800_kHz_with_an_8_MHz_AVR

Note Arduino code in comments at end.
IWBNI this could be a library on the Digispark.



Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2811 RGB light strip and digispark
« Reply #1 on: May 30, 2013, 09:16:08 am »
I forked Adafruit's NeoPixel library and made it digispark/attiny85 compatible. It can do both 400khz and 800khz lights (the ones with built in chips work at 800khz) and it works using the 8mhz and 16mhz board settings in the digispark ide quite well.


I'll probably make a little library with an emphasis on compactness in the future. Also neat is that current development versions of the LittleWire software can output to 800khz ws2811 light strips, so you can use a digispark to bridge c and ruby programs to those strips. You can attach up to 64 lights to each of the four available digital pins for a total of 256 lights - pretty nice for prototyping, though you should use an external power supply for the lights if driving more than a dozen or so. I've already updated the littlewire rubygem with support for that and a bunch of nice examples. Great for prototyping colour values quickly ^_^

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: WS2811 RGB light strip and digispark
« Reply #2 on: June 11, 2013, 12:46:33 pm »
I bought some LED strips recently, only to realize too late that I had selected analog instead of digital -- no WS2811, and the R, G, B lights are separate. Oh well. I guess they'll make good Christmas lights. Or maybe I'll stick them in the grill of my car.


I've got some WS2811 lights coming, though. Looking forward to playing with them.


Zohan

  • Newbie
  • *
  • Posts: 1
Re: WS2811 RGB light strip and digispark
« Reply #3 on: June 13, 2013, 05:28:03 pm »
I got my Digisparks today and they work flawlessly with Adafruit's Neopixel code on Github, I just had to change from Port 6 to Port 5. I'm using one of her 60 m/led strips to do this.
Here's a pic of everything working. I have it for a wearable project so the entire thing is cut into strips of 10. The Digispark's plugged into a USB Battery. Windows complained about a 'USB Power Surge' when this was plugged into my computer, most likely due to the notable changes in power consumption when LEDs turn on and off.



Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2811 RGB light strip and digispark
« Reply #4 on: June 13, 2013, 06:27:39 pm »
Yep, each LED consumes 60ma max, so a usb port can drive a maximum of 8 of those LEDs to be within 500ma. Most USB ports will withstand 1 or 2 amps though, so a practical max of about 18 to 33 or so. It's better to use an external power supply for the lights - anything which can output several amps between 3.5 and 5.5 volts will work fine, just connect it to ground and 5v on the strip, and connect ground and din to the digispark.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2811 RGB light strip and digispark
« Reply #5 on: June 13, 2013, 06:31:42 pm »
Also if you just want to control a strip from a computer, a beta version of LittleWire is a great option. I posted a tutorial on here for installing LittleWire on a digispark - use this beta version: https://github.com/kehribar/Little-Wire/tree/danger/v1.2 and you'll be able to control up to 256 lights from a single digispark (four groups of 64) which could potentially be increased to maybe 400 or so. The project includes examples for controlling them in c, and my 'littlewire' ruby library also has support for the new ws2812/ws2811(800khz) support. It's a pretty fun way to prototype colours and things which can then be copy pasted in to arduino programs and such. I'd love to figure out a way to have a script which listens to the audio output of the host computer and does some visualisation to the lights.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2811 RGB light strip and digispark
« Reply #6 on: June 13, 2013, 06:32:26 pm »
LittleWire is notable because it can transfer data much quicker than current versions of DigiUSB - this means drastically higher framerates.

LazzaHH

  • Newbie
  • *
  • Posts: 5
  • Bouncing around the world.
Re: WS2811 RGB light strip and digispark
« Reply #7 on: June 16, 2013, 10:07:43 am »
Bluebie, great advice yet again.
I am on a very steep learning curve with this great little board but I am looking at something that involves these lights and bluetooth.
Would it be possible to run littlewire, controlling the lights while switching between communications with a bluetooth LE chipset? 

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2811 RGB light strip and digispark
« Reply #8 on: June 16, 2013, 08:13:19 pm »
@LazzaHH: No, littlewire only does usb, but it will be possible to use the Adafruit NeoPixel library which I modified to be digispark compatible, in a digispark sketch. Your sketch would need to read over serial some data from the bluetooth module, and enter it in to the neopixel library, and finally ask the library to output the data.


I'm very interested in this idea, because it could be made to implement the Adalight or Ardulight serial protocol, which would allow you to connect wireless lights to LightPack, BobLight, and similar software. With this, you could mirror the colours of pixels on your screen on to wearable stuff, allowing you to wear music visualizers! I'm interested in building this for electro musicians doing live gigs, so I am watching your efforts with keen interest.


I'm not sure what the point of Bluetooth LE chipsets are? Why not regular bluetooth? It is more compatible with older devices, and compared to the energy use of the LEDs the bluetooth module wouldn't be using much at all.

LazzaHH

  • Newbie
  • *
  • Posts: 5
  • Bouncing around the world.
Re: WS2811 RGB light strip and digispark
« Reply #9 on: June 17, 2013, 05:41:23 pm »
@Bluebie thanks for the hints and I will definitely take a look at using the NeoPixel library.
If I run into confusion I will be sure to return.

I will update on the progress. Essentially I am making a Bluetooth-connected unique array that will allow phone-based data to guide a user through a host of procedures in a harsh environment. I am hoping to package the bluetooth modem, battery, power management and LED's in a robust and waterproof unit that will have some appealing design features. Sorry to be a little vague!

I am building a very power critical application for a project and BLE has that ulta-low capability. Yes, the LED array will be taking most of my juice but I am hoping to keep the lights in a predominantly off state and only use them in strobing, POV-type display, furthermore the BLE permits more than 7 slave devices which is appealing for my use. The limited throughput is not an issue here. Here is a (very) brief comparison from Bluegiga.
Texas Instruments makes an awesome system on chip solution in the form of the CC2540 and I am currently running it on an over-qualified dev board by Redbear Labs. The BLE Mini, this board is preeety costly so I am hoping to find a cheaper BLE chip and use our little Digispark.

Please keep me updated on the music visualizers and lighting effects! Imagine a simple app that reads audio out on a smartphone and feeds it to some light strips for your home party   8)