Forum Discussion
Electronics Newbie question concerning LEDs
Hi all,
I am an electronics newbie, and I am trying to design an guitar that has a light up fretboard. To do this I need to control about 120 individual, single color LEDs, and I am having trouble finding a good method. I've been researching for a few days now, and can't find a board with that many I/O pins to control. I was wondering if the Cyclone II would be able to control the LEDs? and if so would I need any other equipment? Thanks so much in advance!!!! -Steve15 Replies
- Altera_Forum
Honored Contributor
i see i thought it may be limited by the number of fingers you could play with. sounds like a cool project.
you should take a look at PWM (pulse width modulation). this is a method of "strobing". you could also use external drivers as mentioned, or transistor buffers in between all of the LEDs. with PWM, if you used a 4 bit counter you could have 16 groups of LEDs which would be on 1/16th of the time (or off of course). staggering the phase of each LED group would mean you'd have a maximum of 200/16 LEDs on at a time. the programming is still pretty simple. - Altera_Forum
Honored Contributor
Just use 8 or 16 channel serial input LED drivers (or just serial latches). You can do it all with 4 pins and one string of drivers.
- Altera_Forum
Honored Contributor
Thanks for the quick responses guys! I originally was planning to turn on half of them at a time to learn scales but if that isn't feasible I might just do a max of 6 at a time (one for each string). I actually considered the strobing, but it seems to be difficult to program and I'm not sure what external buffers do. Would I need those for the cyclone too?
Thanks again for the advice! - Altera_Forum
Honored Contributor
120 LEDs wouldn't be on at a time, right? maybe a max of 5 or 10?
- Altera_Forum
Honored Contributor
I guess you could use a Cyclone part to drive 120 LEDs. The current consumption might be quite high. 120 * say 20mA.
A better way might be to somehow strobe the LEDs so they are not all on at the same time. For example, if your LED matrix is 6 rows by 20 you could light just 6 LEDS at a time then move on to the next 6 LEDs. If you strobe fast enough the LEDs should look like they are all on simultaneously! You would then only need 20 + 6 Output pins but would probably need to add external buffers to beef up the drive. Hope this is of some help