0
Offline
Full Member
Karma: 0
Posts: 120
Arduino rocks
|
 |
« on: May 17, 2011, 09:08:36 am » |
Are there any options for multiplexing leds and being able to control the brightness of each led, like pwm?
I need to control about 20 leds brightness individually from one arduino
thanks
|
|
|
|
|
Logged
|
|
|
|
|
Massachusetts, USA
Offline
Tesla Member
Karma: 96
Posts: 6372
|
 |
« Reply #1 on: May 17, 2011, 10:48:45 am » |
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 120
Arduino rocks
|
 |
« Reply #2 on: May 18, 2011, 08:24:10 am » |
Thanks.
Possibly bit heavy for me currently but I'll try to digest it.
What's the hardware used?
|
|
|
|
|
Logged
|
|
|
|
|
Porto, Portugal
Offline
Newbie
Karma: 1
Posts: 38
JoATMoN - Jack of All Trades, Master of None
|
 |
« Reply #3 on: May 18, 2011, 08:38:28 am » |
Check out this video from Collin's Lab: http://www.youtube.com/user/makemagazine#p/c/DE23FAC8A681FA46/1/GPokkuX_jjkIt talks about some of the hardware you can use, and also the basics of multiplexing. Now, I don't know if with this you can control LEDs with PWM signal or with just ON/OFF signals, but it's worth a try. The suggested hardware is kinda expensive, but, fortunately, the manufacturer (Maxim), gives away samples on their website. If after watching the video you want to try this out, you can order the hardware, free of charge, from Maxim's website. Good luck.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 120
Arduino rocks
|
 |
« Reply #4 on: May 18, 2011, 08:59:22 am » |
Thanks for the link
I was looking at those Maxim drivers but didn't think any of them supported PWM. Am I wrong?
Nice to know about the free samples!
|
|
|
|
|
Logged
|
|
|
|
|
Porto, Portugal
Offline
Newbie
Karma: 1
Posts: 38
JoATMoN - Jack of All Trades, Master of None
|
 |
« Reply #5 on: May 18, 2011, 09:04:16 am » |
Thanks for the link
I was looking at those Maxim drivers but didn't think any of them supported PWM. Am I wrong?
Nice to know about the free samples!
Like I said, I'm not sure if they can run PWM signal, I have a couple but haven't used them (too busy burning Macbook's logic boards :S ). But in case you try it, post back with the results. I'm planning on using them on a future project, and would be nice if I could get PWM control. Something else I remembered: you can try using an LED painter from Brillidea ( http://www.brilldea.com/product_LEDPainter.html). It might be overkill, or it might be what you're looking for 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 45
From birth to death, it is just like this.
|
 |
« Reply #6 on: May 18, 2011, 09:46:41 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Massachusetts, USA
Offline
Tesla Member
Karma: 96
Posts: 6372
|
 |
« Reply #7 on: May 18, 2011, 10:53:31 am » |
What's the hardware used?
He is using the SPI port to send data to four 8-bit shift registers: Rows, Red, Green, Blue. He sets the color bits LOW and the Row bit HIGH to turn on LEDs in a specific row. The SPI Slave Select line goes to the Latch input of the serial-in, parallel out shift registers. When the Slave Select line goes HIGH the bits that were shifted into the shift register appear on the outputs. The circuit diagram is shown here: http://francisshanahan.com/index.php/2009/how-to-build-a-8x8x3-led-matrix-with-pwm-using-an-arduino/
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 120
Arduino rocks
|
 |
« Reply #8 on: May 18, 2011, 11:51:57 am » |
And does this allow pwm for each led individually?
cheers
|
|
|
|
|
Logged
|
|
|
|
|
Massachusetts, USA
Offline
Tesla Member
Karma: 96
Posts: 6372
|
 |
« Reply #9 on: May 18, 2011, 12:17:06 pm » |
And does this allow pwm for each led individually?
Yes. You can set the brightness level for each of the 192 LEDs (8*8*(R,G,B)) #define __rows 8 #define __leds_per_row 8 byte brightness_red[__leds_per_row][__rows]; byte brightness_green[__leds_per_row][__rows]; byte brightness_blue[__leds_per_row][__rows];
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 120
Arduino rocks
|
 |
« Reply #10 on: May 18, 2011, 02:49:48 pm » |
Great thank you.
I will try to get my head round this.
Have you made anything similar?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 120
Arduino rocks
|
 |
« Reply #11 on: May 18, 2011, 03:00:48 pm » |
Ah, one quick question, is it possible to use something the ULN2003A on these pwm'd channels to drive high current leds?
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #12 on: May 18, 2011, 03:50:16 pm » |
The ULN2003 will only sink current it will not source it.
|
|
|
|
|
Logged
|
|
|
|
|
"The old Europe"
Offline
Edison Member
Karma: 0
Posts: 2003
Bootloaders suck!
|
 |
« Reply #13 on: May 18, 2011, 05:31:09 pm » |
Usable source driver arrays are: UDN2981A, TLC59213A (latched)
And if you're thinking about using that piece of code, please make sure you get the latest version. The one that was linked above is pretty old and a bit sub-optimal.
Also if you're interested in getting a decent level of brightness (good visibility in broad daylight), you'll definitely want a bit more than plain 595 chips, probably even dedicated constant current drivers. Saves you from using tons of resistors.
|
|
|
|
|
Logged
|
• Upload doesn't work? Do a loop-back test. • There's absolutely NO excuse for not having an ISP! • Your AVR needs a brain surgery? Use the online FUSE calculator. • My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets... • Microsoft is not the answer. It is the question, and the answer is NO!
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 120
Arduino rocks
|
 |
« Reply #14 on: May 19, 2011, 04:59:58 am » |
I don't really understand this - "The ULN2003 will only sink current it will not source it."
-
How are the UDN2981A and TLC59213A different from the ULN2003?
-
And given that I don't need a very large number of leds, and I dont need them arranged in a square array, would I be better off with something like the TLC5940?
And if so will this work with the UDN2981A or TLC59213A?
Thanks for being patient with my basic questions! Will
|
|
|
|
|
Logged
|
|
|
|
|
|