Driving 100 LED's
IRobot2
Posts: 164
Hello Everyone,
I have a tricky little project that I am not so sure is possible. It sounds easy, and I thought I have solved it several times but I am getting really discouraged so I am finally asking for some help.
Here is the basic idea. I have 100 LEDs in a 10x10 grid and two pushbuttons. One button is used to increment count up the LEDS and button is used to decrement count down. I would like the LEDs to light up one by one till the number 100 is reached.
Here is my restrictions:
1.) I am looking for multiple LEDs to be lit at the same time (not a decade counter) Ex. 48 is represented by 48 LEDs being lit, not just the 48th LED.
2.) I am using a Prop, but do to other things within this project, I only have about 20 free I/O pins.
3.) I would like to keep cost somewhat reasonable. (So using a decade counter with some kind of latch or flip/flop for each one of the 100 LEDs gets very expensive!) (this may be my only option)
Here are some things I have thought of that have not worked out.
1.) Using a 74LS193 (up/down counter BCD out) to a 74HC42 (4-10 decoder) for groups of ten LEDs but the problem is the output will still only light 1 LED at a time. I might as well have just used a decade counter.
2.) Using some kind of shift register, but decrementing becomes an issue?
3.) Multiplexing or Charlieplexing do not light the correct number of LEDs at one time, and would also still require more I/O pins than I have available.
Anyone have any insight? I have given this quite a few days of thought and countless hours of Googleing. I am just going in circles now. -Alex
I have a tricky little project that I am not so sure is possible. It sounds easy, and I thought I have solved it several times but I am getting really discouraged so I am finally asking for some help.
Here is the basic idea. I have 100 LEDs in a 10x10 grid and two pushbuttons. One button is used to increment count up the LEDS and button is used to decrement count down. I would like the LEDs to light up one by one till the number 100 is reached.
Here is my restrictions:
1.) I am looking for multiple LEDs to be lit at the same time (not a decade counter) Ex. 48 is represented by 48 LEDs being lit, not just the 48th LED.
2.) I am using a Prop, but do to other things within this project, I only have about 20 free I/O pins.
3.) I would like to keep cost somewhat reasonable. (So using a decade counter with some kind of latch or flip/flop for each one of the 100 LEDs gets very expensive!) (this may be my only option)
Here are some things I have thought of that have not worked out.
1.) Using a 74LS193 (up/down counter BCD out) to a 74HC42 (4-10 decoder) for groups of ten LEDs but the problem is the output will still only light 1 LED at a time. I might as well have just used a decade counter.
2.) Using some kind of shift register, but decrementing becomes an issue?
3.) Multiplexing or Charlieplexing do not light the correct number of LEDs at one time, and would also still require more I/O pins than I have available.
Anyone have any insight? I have given this quite a few days of thought and countless hours of Googleing. I am just going in circles now. -Alex
Comments
You could make a 10row by 10 columns multiplexing.
I would use 10 transistors/small signal mosfets to sink collums to gnd.
The 10 rows I would drive direct from prop pins at 10mA
You would get a duty of 10%, not good if you want it to be really bright.
and you would need to dedicate a cog just to multiplex as to get even brightness.
Though there would be some dead time that you can insert other short code routines.
And make sure your software never drive more than one column at a time as if you turned all on
you could use more current than the prop can handle.
Using 3 prop pins for a 3outof8 non-inverted Logic IC for collums and 13 prop pin for rows would take care of that will never happens.
If you can only find inverted (74HC138), go for a high side column driver with p channel transistor/mosfets.
Or use one TPIC6595 and no need for transistors and just make sure only 1 bit is on in the data.
If you only want to use one prop pin to control 102 leds, you can use three 595 and a three dual-mosfets like I do here.
http://forums.parallax.com/showthread.php?134106-Updated-17seg-LED-driver-for-PPDB-now-available.
If you make your circuit 17 rows by 6 columns, the above board could just be dropped in.
Others have given you good advice here.
I've done something similar to what you want to do.
I have a 12 x 10 LED array in this project.
Each LED has 8-bits of brightness control.
Here's a picture.
This picture shows the array displaying a low res image of a video camera capture. (The "HI" written on the whiteboard is being displayed on the array.)
I didn't want to multiplex the display so I used 16 shift registers. It could have been done with 15 shift registers but I wanted to break the array up into four equal parts. I used four data lines instead of just one. I didn't want it to take too long to shift all the bits out on 15 shift registers. This way the bits just need to be shifted 30 times (in each section) instead of 120 times.
You can see the stack of 16 595 shift registers in this next picture.
I'm attaching the object I wrote that controls the shift register. (LedCoolness)
It reads in the 120 bytes from hub RAM and uses each byte value to control the brightness of a LED.
I'm also attaching MecanumVision which uses LedCoolness to display the video image and scroll text.
The method NewBrightness in LedCoolness doesn't work (yet). The method NewBuffer will change the location of memory the object will use to control the brightness of the LEDs. I use this to switch back and forth between displaying video and displaying text.
As I mentioned, the program MecanumVision vision will scroll text. The fonts are entered in the DAT section of the program with a single bit representing each LED. The program converts these bits to bytes and loads the font as byte values into upper EEPROM. So if you use the font feature, you'll need to have a 64K EEPROM on your board.
It should be relatively easy to have any pattern you wish on your LED array by placing the appropriate values into the array of bytes representing the array of LEDs.
You'll need to modify the code to only use 100 LEDs instead of 120. (I can help with the PASM part if you want.)
I was surprised how much I enjoyed having this LED array. I had started to doubt my sanity as I was soldering the many wires needed to build the array. Once it was done, it looked so cool I didn't feel bad about how much time it took.
I looked around for a schematic but I didn't find one. If you need one I can create a schematic of this pretty easily. (It's a simple circuit; it is very repetitive.) Each LED anode is soldered to a 100 ohm resistor. The other side of the resistor is connected to the shift register output. All the LEDs' cathodes are connected to a common ground. The clock and latch pins are all shared. The reset and enable pins are connected with Vdd and ground (I think that's how they are).
As I said, it's a simple setup. It just takes a lot of soldering.
Let me know if I can help anymore.
Duane
In case anyone was curious, I am making a “Counting Box” for my daughter. I got the idea off a Wired article where someone made a box using several 7-segment displays and two pushbuttons that simply added and subtracted 1 to the display. My daughter is in the phase where she likes counting everything and I noticed she liked counting the LED’s on a work project that I brought home. So I made a little LCD display that shows the number in word and numerical form. I also made it where I can switch between English and Spanish spelling of the word. The next step is to get the actual LED’s for her to “count”. I thought that would be the easy part… till I sat down and thought about it…
Thanks again for the help. I didn’t realize I was going to be the one learning with this project! -Alex