RGB LED Controller
Jason Gulbinas
Posts: 17
Hello,
I am new to STAMP and am using the BS2. I have successfully built some cool LED projects but want to now take it to the next level with some LED control.
I am looking to control a typical RGB LED so that I can change brightness/color. If I have independent control of each color then I will be able to get some cool oranges and yellos, etc. out of the RGB LED.
Apparently there are some "off-shelf" options available for doing this such as the ShiftBright (which looks like a board and LED controller combo all in one):
http://macetech.com/store/index.php?main_page=product_info&cPath=1&products_id=1
My question:
Is there a way to build an LED controller on the Parallax BOE by using basic components (perhaps a controller IC from TI or Allegro (like the A6281)) or would it be easier to just buy the ShiftBrite?
If the ShiftBrite is the answer does anyone have any example code and schematics of how to hook it up to the Stamp and control it?
Thanks so much!
Jason
I am new to STAMP and am using the BS2. I have successfully built some cool LED projects but want to now take it to the next level with some LED control.
I am looking to control a typical RGB LED so that I can change brightness/color. If I have independent control of each color then I will be able to get some cool oranges and yellos, etc. out of the RGB LED.
Apparently there are some "off-shelf" options available for doing this such as the ShiftBright (which looks like a board and LED controller combo all in one):
http://macetech.com/store/index.php?main_page=product_info&cPath=1&products_id=1
My question:
Is there a way to build an LED controller on the Parallax BOE by using basic components (perhaps a controller IC from TI or Allegro (like the A6281)) or would it be easier to just buy the ShiftBrite?
If the ShiftBrite is the answer does anyone have any example code and schematics of how to hook it up to the Stamp and control it?
Thanks so much!
Jason
Comments
The TLC5940 I am sure would be a great solution but I am a beginner and know enough to get me to the level where this component and the RGB LED is placed onto the breadboard. I would be clueless of the interconnect between the Stamp and the IC and the IC to the LED. Then there is the challenge of figuring out what code to use to control the circuit!!
I could try to figure this out though and am willing to do the work. I am sure there may be some example code somewhere of Basic code that is used to control the TLC5940, and connecting it to the LED (configuration/wiring) cant be too hard.
Thanks!
This question may be naive but hey...that's how we learn!! Thanks for the support.
If you don't need alot of different colors you can use several pins with different value resistors to control each element of the RGB LED.
For example if you used 4 pins for each element is would take 12 pins and allow for 4096 (16*16*16) different colors.
Here is the breakdown of pins vs colors:
1 pin per element = 8 (2*2*2) colors
2 pins per element = 64 (4*4*4) colors
3 pins per element = 512 (8*8*8) colors
4 pins per element = 4096 (16*16*16) colors
I use the term "color" loosely here. There are shades of white, etc...
For the resistors you basically double the resistor value for each new resistor. Making sure that when all pins are high, the current through the LED will not burn it up.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
I do only need a few colors here. A red, an orange, a yellow, a green and a blue. But I want them to fade nicely into each other...which is why I am not using discrete color LEDS.
Your solution may provide the cheapest way to accomplish this...and doesnt look too challenging.
I do wonder how easy it would be just to buy and implement the ShiftBrite module or TI LED PWM controller. Do you think it would be easier to buy and learn about the TI5940?
I will post more on the solution once I figure it out!!
Thanks,
Jason
The guys on the EFX-TEK forums got the ShiftBrite working with a BS2 exactly one year ago: www.efx-tek.com/php/smf/index.php?topic=620.0
What I would do, simply because it doesn't require any additional components and well, I'm cheap, is fake PWM:
If you don't need your BS2 to do anything but control the LED... you can send a series of highs and lows (or better yet, assign the pins 0s and 1s once they are set as output) in a
loop to fade the different colors together in any way you want at any pace you want.
Unfortunately, the BS2 isn't very fast. This may show up as a slightly dimmer than normal light coming from the LED.
Experiment with different mixes of 1s and 0s to get the various colors you want. (this will take a long time most likely)
-Jason
Normally, I'd play my cards a little closer to the vest. But your post demands a revelation that I just couldn't hold back. So, with Ken Gracey's blessing, I can reveal a forthcoming product from Parallax that I had a hand in developing: the ColorPAL. The ColorPAL is actually two products in one:
····1. A color sensor that complements, for the hobbyist market, the capabilities of the TCS230-DB, and
····2. A scriptable color generator that uses the onboard RGB LED to generate and blend a full gamut of user-programmable colors.
The ColorPAL interfaces to the BASIC Stamp (and other controllers) through a standard three-pin servo header and uses serial I/O to communicate commands and data. It includes the aforementioned RGB LED, an onboard microcontroller, and a TAOS light-to-voltage detector, along with a collimating shroud for the color detection function.
I've attached the users' manual for this product below, along with a zip of a movie highlighting some of the color blending capabilities.
I'm not going to comment on when the ColorPAL will be available or for how much. I've seen Ken's projections, and ... well ... if he wants to weigh in here, he can.
-Phil
I looked at the manual for the BlinkM and found it to be VERY helpful....not only does it comprehensively describe how to hook the BlinkM up to the Stamp Board but it also give example code. The ShiftBrite is all I need for my application but it lacks the documentation that the BlinkM has....it is also much more economical. The BlinkM seems to have an onboard memory that don't really need since I will always be hooked up to my Board of Education.
Thanks all for the help. I thought that it must be easy and normal to try and control an RGB LED...especially now that we see a ton of off-shelf LEB bulbs that change colors and brightness by remote control.