Main > Main Forum

Any electronics (or LED) wizards out there?

<< < (3/3)

Neverending Project:
Wow. Thanks for all the great suggestions.

@MonMotha: I like the idea of using a transistor array. I have some parts on order, so I should be able to start experimenting next week. My problem (already!) is that I have run out of pins on the Arduino. The 4x4 button pad I will be using has a matrix of 4x4 buttons, and a matrix of 4x4 RGB LEDs. I will be using 2 AD5206 digital pots to control them all via PWM, but I am afraid I have used up all my pins.

So I will either use a second µM for the rest of my control panel interface doohickeys, or perhaps I will switch to some serial controlled shift registers to be able to control a whole mess of leds/switches. The problem with that approach will be that I won't be able to dim each RGB led independently.

But first I need to play a bit and get something working, before I go declaring the design inadequate.

MonMotha:
You can easily matrix the LEDs and pushbuttons.  This makes your software a wee bit more complicated, but reduces the number of IOs drastically (8 for a 4x4 array instead of 16).  Modern micros are even fast enough that you can do individual PWM (dimming) control of LEDs even in a matrix configuration, albeit perhaps with only 5-7 bits of intensity control and somewhat reduced full brightness compared to individually driving them.  Since you have RGB LEDs, you could even make a bigger matrix, perhaps 12x4, controlling each color as though it is another row of the matrix.  This means you need 16 IOs rather than 48.  If you clock your micro's timers fast enough (there are some AVRs with high-speed PWM output you could look into that can clock their timers up to something like 64MHz), you could still get plenty of dimming precision, though the peak current would be high enough that you'd probably need external switches (transistors).

The AD5206 isn't overly suitable for this in any way.  You'd have to buffer the outputs to drive enough current into the LED (which comes free with a V-I converter for current mode control).  PWMing is easy - just turn it on and off really quick (use a timer if you have one) and use a transistor in saturation to switch the higher current if your uC IO can't handle it.  No need to deal with any analog electronics, and you waste less power since device losses are substantially lower outside linear operating regions needed for analog methods.

Dak-ak:
I wouldn't be surprised if you've seen this before, but sparkfun electronics had this in their news section a few weeks ago:

http://www.hackaday.com/2008/06/12/how-to-make-an-rgb-combination-door-lock-part-1/

Uses RGB buttons to unlock a door - not exactly what you want, but provides some interesting ideas on controlling a button matrix and LEDs via an Ardiono.

Navigation

[0] Message Index

[*] Previous page

Go to full version