NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » More RBG Led FUN!

February 11, 2015
by Noter
Noter's Avatar

Actually this is about the most fun I can think of with RGB leds. My goal is to build a string of individually addressable RGB lights to use on the Christmas Tree or what ever else needs some decoration. Last year I started working with the Tiny10 but stalled and got stuck so I switched to the Tiny85 for a while but always felt it was overkill to drive a single led. Well, last week I had an idea how to get the Tiny10 going and tonight I have a working prototype!

Each packet of data sent by the Arduino has 32 bits, 8 for led address, and 8 each for the RGB colors. The Tiny10 receives the pack and if it's address matches it will set the packet colors on to it's led. The serial com routine uses different pulse periods to differentiate between 0's and 1's with a long pulse at the start of the stream. Average length of the 32 bits is around 3.3ms which yields about 9600 bps or 300 packets a second. So for a string of 25 lights I can change each one individually 12 times a second. Not bad for a for a little chip that is smaller than the led.

Had to re-purpose the green and blue pins for testing so I could see some output on the logic analyze. Channel 1 is the signal from the arduino, channel 2 is the Tiny10 echo of the input, and channel 3 shows a blip for each '1' bit as well as a blip at the end indicating 32 bits received.

analyzer

Notice the 10k resistor on the reset pin of the Tiny10. It's not a pull up but a current limiter to protect the port on the Arduino (and logic analyzer) when 12v is applied by the MKII to put the Tiny10 into programming mode.

setup

Maybe I'll have my custom lights by Christmas 2015!

February 12, 2015
by Rick_S
Rick_S's Avatar

How much will you have in hardware per LED?? Wouldn't it be around the same cost to purchase programmable RGB strips? Less fun, I admit, but a lot easier. It's good to see someone posting their experiments and projects though. So trust me, I'm not trying to discourage in any way. There are protocols established for the LED strips though that you might want to look at. I think some of them are a form of SPI and some adafruit sells (Neopixels) have their own time based protocol I believe.

Food for thought,

Rick

February 12, 2015
by Noter
Noter's Avatar

Haven't figured out the cost of each but the Tiny10's are about 50 cents ea @ 250 qty. The 5050 leds are 5 cents via China and probably the little pcbs will be about 10-15 cents also via China. I think that is more per led than Neopixels but like you say, it's not as much fun to just buy a solution.

Post a Reply

Please log in to post a reply.

Did you know that signed numbers need to be sign-extended when chaging variable sizes? Learn more...