WS2812 Addressable LEDs - Project Showcase - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

WS2812 Addressable LEDs

LED WS2812

  • Please log in to reply
5 replies to this topic

#1 marcoe

marcoe

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationBrazil

Posted 29 July 2014 - 12:33 PM

Hi guys, this is not a "project" but it should be interesting to all the LED's fans.

 

I recently bought this set of addressable LEDs from Sparkfun:

https://www.sparkfun.../products/12877

They are very inexpensive RGB LEDs with a WS2812 inside, same idea behind Adafruit's NeoPixels ( https://learn.adafru...pixel-uberguide ) but in a regular 8mm or 5mm LED enclosure.

 

Apparently netduino's GPIO ports don't have enough speed to drive this directly as it needs 800Khz clock and data, so there is a tutorial  (https://learn.adafru...tduino/overview) on how to re-write netduino's firmware to make it happen. I'm not a big fan of messing with firmwares, so I searched some more and found jCoder's blog ( http://jcoder.me/blo...ws2812-rgb-led/ ) with a pretty great solution for this, which is to use SPI port to send data to the LEDs.

 

I made some changes on jCoder's code:

   - Changed the order of RGB data. Originally it was GRB because in WS2812 docs it describes this way, but these LEDs were behaving differently, so I changed to RGB and it worked.

   - Created some crazy color changing code.

 

 

Attached Files



#2 Dr Who

Dr Who

    Advanced Member

  • Members
  • PipPipPip
  • 261 posts
  • LocationNYC

Posted 30 July 2014 - 05:24 AM

Hi guys, this is not a "project" but it should be interesting to all the LED's fans.

 

I recently bought this set of addressable LEDs from Sparkfun:

https://www.sparkfun.../products/12877

They are very inexpensive RGB LEDs with a WS2812 inside, same idea behind Adafruit's NeoPixels ( https://learn.adafru...pixel-uberguide ) but in a regular 8mm or 5mm LED enclosure.

 

Apparently netduino's GPIO ports don't have enough speed to drive this directly as it needs 800Khz clock and data, so there is a tutorial  (https://learn.adafru...tduino/overview) on how to re-write netduino's firmware to make it happen. I'm not a big fan of messing with firmwares, so I searched some more and found jCoder's blog ( http://jcoder.me/blo...ws2812-rgb-led/ ) with a pretty great solution for this, which is to use SPI port to send data to the LEDs.

 

I made some changes on jCoder's code:

   - Changed the order of RGB data. Originally it was GRB because in WS2812 docs it describes this way, but these LEDs were behaving differently, so I changed to RGB and it worked.

   - Created some crazy color changing code.

 

Hello!

I noticed you showed us a NP2 device, which is what was shown in the Adafruit guide. According to both Chris and Adafruit the N_2 devices contains features which enable the applications of the pixels, and the intelligent LED devices themselves.

In fact I recall going over this same issue with him when it first surfaced both here and on the Adafruit site.

However they require the deployment of advanced firmware to the boards to do the expected activities which is what Chris confirmed.

 

It bothers me as well as I'm not completely ready to snag a N_2 device but you never know. 



Doctor Who
"This signature does not exist!"

#3 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 30 July 2014 - 06:09 AM

The pixels don't need anything special to run.
A user on the GHI forum wrote a managed driver a year ago using a 72mhz Panda 2

#4 Dr Who

Dr Who

    Advanced Member

  • Members
  • PipPipPip
  • 261 posts
  • LocationNYC

Posted 30 July 2014 - 06:23 AM

The pixels don't need anything special to run.
A user on the GHI forum wrote a managed driver a year ago using a 72mhz Panda 2

 

Hello!

Can you provide a pointer? Please use a PM for it.



Doctor Who
"This signature does not exist!"

#5 marcoe

marcoe

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationBrazil

Posted 30 July 2014 - 01:15 PM

Hello !

 

Quoting jCoder's blog:

"How does it work?

I thought that there must be a faster way to get signals off a Netduino Plus 2 because it has an Ethernet port and SD card slot, and I suppose they need to be adressed faster than 17?s (I haven’t evaluated this, so maybe I’m wrong with that, but it led me in the right direction). Looking at the ports that the Netduino provides my attention was drawn towards the SPI interface.

SPI (Serial Peripheral Interface) is a four-wire master-slave interface for full-duplex communication between chipsets. It has a clock wire (SCLK), output (MOSI) and input (MISO). Normally it can be used at a frequency up to some MHz, so the ports must be really fast.

My assumtion was, that I could only use the output (MOSI) pin, configure the frequency accordingly and send the needed control bytes on that wire to the LEDs. I tried some settings and data packets, but first without any success, but luckily I wasn’t the first one to try this, so I found some code snippets for different microcontrollers, that pointed me into the right direction, e.g. that a timing of 6.666MHz is recommended."

 

 

I bought 20 LEDs and tried with only 5 because of power restrictions on netduino but I will try with some more soon. 

Another thing I noticed on my trials is that powering the LEDs from 3.3v works better than on 5v.



#6 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 30 July 2014 - 02:20 PM

i have run 240 without issue







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.