LEDs and Multiplexing
Topic: Analog/Digital Clock
(Read 2005 times)
Sep 02, 2012, 04:36 pm
: Sep 02, 2012, 04:39 pm by Archez
Hello Arduino world! This is my first time here and I came because a local friend told me that this forum is very active and engaging, so I thought I'd come by and ask for help. I do not have much hardware knowledge, but I do have skill in wiring and designing.
I am attempting to do my first arduino project, which is a mixture of a digital clock and analog clock in a sort (I know, original right?). Anyways I would like to get it done right so I am here for help.
Now on to my question: I am gonna have a 12 hour 4 digit display of 46 LEDs, but ALSO I would like to have a circular of 60 LEDs around the digital clock representing the seconds (one lighting up past the other every second, till it reaches 60 were they all turn off and repeat). This brings my project to 106 LEDs total.
As of now my idea is to have 2 arduino unos one dedicated to each part (Yes I know this is wrong, but I do not have much knowledge of arduinos which is why I am here). My schematic (which will be roughly posted below) is to have a 5x10 multiplex for the digital clock (15pins used) and then on the other uno have a 6x10 multiplex for the seconds timer (16 pins). Obviously I know I should find a better way than two separate unos.
(This may be wrong and crude so correct me please)
And here is the final design goal
I will reiterate by saying my knowledge of hardware does not go far, so please fellow peers will you steer me in the right direction to be able to drive 106 LEDs on one arduino, preferably in 2 different multiplexes to match my schematic, it'll be so much easier to wire that way. I've heard of 16 channel chips but I have no clue how to use such chips and which would be good. Also if you guys want to give me any information that I am overlooking, that'd be great too!
Thanks again guys, this will mean a lot to me. When I am done I will definitely post pictures, you will be amazed!
Re: Analog/Digital Clock
Sep 02, 2012, 05:08 pm
If you use an Arduino Mega instead of two UNOs you will have plenty of pins for both displays.
One problem with your design is that you can't draw enough power from an Arduino pin to light a whole row of LEDs (up to 10). You will need anode drivers. You may want to switch to a design where the current limit resistors are on the anodes and the cathodes are scanned. That way simple NPN transistors can be used for the cathode drivers.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e
Re: Analog/Digital Clock
Sep 02, 2012, 05:24 pm
For the inside digital time readout. Have you built the display on a breadboard yet to see how it looks? As you have it with 3x5 LEDs, it will be extremely hard to read. To do it that way, you'd want more LEDs in each bar.
You can't wire the LEDs as you show in the schematic. First when you're multiplexing, the resistors have to be on the side that can have multiple LEDs on at a time, so as you show it, you're scanning the 5 cathodes and outputting the correct pattern of anodes each time. With 100 ohm resistors you're using 20-30mA per LED (depending on colour), which means the cathodes will have to sink 160-240mA and the Arduino is limited to 40mA per IO pin. You'll need driver transistors on the cathodes to do it that way.
Why are you having it so you can control each LED at all? For example, won't the 5 LEDs that make up your 10's hour digit always all be on or always all be off?
A MAX7219 LED driver chip will allow you to control 64 LEDs or 8 7-Segment LEDs from 3 arduino pins, and the code to use it will be a lot easier than what you're trying to do.
There's also pre-assembled 4-digit modules you can use available from sure electronics, adafruit, and lot of other places with the driver built in so you just need 3 IO pins to control them.
You can also consider a bar graph LED driver IC such as the LM3914 for your seconds circle.
Your idea of using 2 UNO's is horrible. If you were short on IO there are far better solutions; you can use an Arduino Mega which gives you 70 IO pins. A port expander IC such as the MAX7313 will give you 16 IO pins and you can connect up to 64 of them to your Arduino using only the 2 I2C pins.
In this case though you're not short on IO, just use the correct driver chips and you shouldn't need more than 6 IO for all the LEDs you've described.
Re: Analog/Digital Clock
Sep 02, 2012, 11:05 pm
: Sep 02, 2012, 11:07 pm by Archez
I expected a response like this, sorry. I understand my method was horrible, I only suggested it because I had nowhere to start off of. The schematic I provided was one that someone else used for a clock. But you are correct, the 3x5 digits would be to small and hard to read. Below is a revised version. I'll do a 7 segment display with each segment being 3 LEDs long.
This brings my LED total to 131
So just from a feasible point of view, can I drive all those LEDs on a uno using the part you mentioned?