Go Down

Topic: multiplexing with pwm? (Read 6246 times) previous topic - next topic

mrboni

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

johnwasser

Here's an example of doing PWM on an 8x8 RGB LED matrix:

http://blog.spitzenpfeil.org/wordpress/wp-content/uploads/2008/10/matrix_code.pde
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

mrboni

Thanks.

Possibly bit heavy for me currently but I'll try to digest it.


What's the hardware used?

DPontes11

Check out this video from Collin's Lab: http://www.youtube.com/user/makemagazine#p/c/DE23FAC8A681FA46/1/GPokkuX_jjk

It 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.

mrboni

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!

DPontes11


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 :)

mrmm314


johnwasser


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/
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

mrboni

And does this allow pwm for each led individually?

cheers

johnwasser


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))
Code: [Select]

#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];
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

mrboni

Great thank you.

I will try to get my head round this.


Have you made anything similar? 

mrboni

Ah, one quick question, is it possible to use something the ULN2003A on these pwm'd channels to drive high current leds?

Thanks

Grumpy_Mike

The ULN2003 will only sink current it will not source it.

madworm

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.
• 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!

mrboni

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

Go Up