loading
Picture of Arduino 7 segment countdown timer
This project is based on a Kingbright dual 7 segment display and an Arduino Diecimila.
it counts down from 20 and lights up pin 13 LED when the timer is complete.
It uses no extra hardware which is usefull for low-cost projects.
It also features multiplexing to get the job done with only 9 pins altogether for the displays.


Step 1: Parts needed

For this project you will need the following:

COMPONENTS:
1. An Arduino (any kind will do)
2. A dual-7 segmant display or 2 seperate 7 segment displays.
3. 2 Resistors (the values depend on your display)
4. About 50cm of non-stranded wire

TOOLS:
1. A soldering iron and solder. (My display was SMD so i had to solder wires to it for connection)
2. A fume extractor. (I really reccomend buying or making one as they are very helpful to you)
3. A wire stripper, or you could just use scissors
 
1-40 of 47Next »
Kevin E.A2 months ago

hi, it worked very well for me, but I also need that the countig only happens while I am punshing a button (for my halo assult rifle replica) I am new in arduino so I really dont know how to do it, do you think that you could help me with it?

(I am kinda desesperated, I have been looking for it for a long time and I dont understand to much how to do it, or I dont find it, please help :T )

Now how do I add buttons for auto and select fire mode a la colonial marines pulse rifle? ;)

Soo, I built it but mine are common anode (KINGBRIGHT SA52-11EWA). I pretty much reversed the entire code so that "(gnd1, B1);" activates that pin as a gnd-pin. The same for the pins; "(pin1, B0);" sets pin 1 HIGH.

Also, in each for-loop I put the "gnd code lines" at the top. They seemed to affect the code under it and not above it. Now it works just fine :)
Dont really know if this is a good or safe way of doing it but it works.

XplosivePi3 months ago

Improvement hint: It looks like you used something like two 170 ohm resistors. Assuming this, you receive a (constant) current of about 17mA for one digit (@5V source and 2V forward voltage per LED). This current will be divided into 1 to 7 segments, depending on how many of them are turned on. That's why the number 1 illuminates much brighter than a 8 in your video. That's a really bad design for a 7-segment. Use 680 ohm resistor per segment (!) instead to receive equal brightness. You will get less than 5mA per segment, one µC digital pin can sink 40mA max. More brightness can be achieved with external open-collector circuitry and smaller resistors.

iamakidilam3 months ago

didnt work for me, the downcounter. i'm using a kw2-502csb dual 7 segment, but the connections are more or less the same. just some random counter happens fast and after tht 00 is appearing with the fading effect. please do explain.

jaro16 months ago

sir is there a way to pause resume and reset the timer from running?

hi i have built this timer and loaded the programme into my arduino but it just lights up the 7 segment display and then jumbles through a load of numbers really quickly. then it stops and starts pulsing. does anybody know why. please be simple, im new to arduino:)

I know this is late but if anyone else has this issue hears what you need to do. When you open the code in the arduino program find anywhere in the code that says delay(0.5) ; and replace it with delay(1.0) ;

m4a1carbine9 months ago

Nicely done! May I ask, if I wanted to pause, or restart (both the use of two separate switches) how can I modify your code?

Any chance you could update the code to have 8 digits displaying hours, minutes, seconds, milliseconds and colons (:) in between each?
I have some coding experience with arduino and I'd be willing to help.

lol wouldn't that take like 5 minutes. As for the colons just use red LEDs.

Hello! Could you make library for this? I think it'l be very usefull.

NeoRecasata2 years ago
common anode or common cathode
kilofeenix3 years ago
Would you be able to put a 10 key keyboard on this project to start and stop the timer with a code? My friends and I have airsoft guns and we all played Counter Strike as a kids.
mastergabe3 years ago
hi i need to use to seven segment displays and this is great but is it possible that they could write a int or value of a sensor if so please tell me and email me the code or just post it on a comment thanks
Santos462893 years ago
""hi i have built this timer and loaded the programme into my arduino but it just lights up the 7 segment display and then jumbles through a load of numbers really quickly. then it stops and starts pulsing. does anybody know why. please be simple, im new to arduino:)""

I have the same Problem its to fast .... and its the same when i change it from delay(0,5) to delay(5) // int timer 100

Please help
baharini (author)  Santos462893 years ago
The delay() command uses milliseconds.
To make a delay of 1 second, you would use delay(1000);
So, using delay(5) would make 1/200 of a second which is VERY fast.
Make it delay(500) for half a second.
honskie5 years ago
where i can put this code???? on visual basic??
No, download the arduino ide. You will need an arduino too.

arduino ide: http://www.arduino.cc/en/Main/Software

arduino: http://www.amazon.com/Arduino-UNO-board/dp/B004CG4CN4/ref=sr_1_1?ie=UTF8&qid=1311389063&sr=8-1
Robot Lover4 years ago
I'm sure with a little effort, the code could be shortened quite a bit. I'll give it a try!
rocket_man4 years ago
Anybody know how i would do this only with simple circuit/ ics
jaragon4 years ago
Cool write-up! i used a dual common anode display. for using a c.a replace the B0 to B1 and viceversa. gonna try and add to this to count starting at 99!
FalconFour4 years ago
You've got to add more detail to this. I'm having to make a lot of wiring guesswork here. "via resistor"? What value? I assume we're plugging these into digital pins, since there is no such thing as just Arduino "pin 6", etc...? Ground doesn't need a transistor? *shrug*...
Also, nowhere in here states what segment is A-B-C-D-E-F-G... biggest bit of guesswork yet :(
Most displays start with A on the top and then go clockwise, with G in the middle, so:

A - top
B - top right
C - bottom right
D - bottom
E - bottom left
F - top left
G - middle

You will probably need to look at the datasheet for whatever 7-segment component you have to tell what pins correspond to what segment, though.
djlewis7254 years ago
Worked great for me. Nice instructable, wiring was a bit tricky though.
I would love to try this but do not have a two digit display - I only have a 4 digit one:

http://www.kingbrightusa.com/product.asp?catalog_name=LED&product_id=CA56-21GWA

Having only just really started electronics, I am not too sure how to wire up one of these displays, and even then it would take me some time to write the code. Can anyone give me a hand on how to wire it up?
Thanks for any help!!
jrigvd4 years ago
in your sketch for the countdown-timer you have made a few mistakes,

int timer = 500;
becomes
int timer = 100;

and

all the delay(0.5);

becomes

delay(5);
jrigvd4 years ago
my arduino won't read the code normal
Mr Jaderman5 years ago
You know what you could do is just copy it from the Arduino IDE and then just paste on to your page here. Would GREATLY appreciate it.
 
baharini (author)  Mr Jaderman5 years ago
I've updated the program so when you click on the icon it takes you directly to the program.
Heeth baharini5 years ago
Hi friend. This post on multiplexed Display was really very very useful but i have stuck in a problem. I want to display an temperature on the multiplexed display. I have used LM35 for temperature sensing and 7135 as ADC. Now when ADC is accessing the analog data and converting the data, my display is getting turned off. I have used timer for displaying, when the timer is overflown, its getting turned off for a while and getting turned on again. What to do friend?? Heeth
catprog Heeth5 years ago
The code for converting the data is probably taking so long that you can see the delay in the timer. (if your using the Arduino IDE) in setup() ----------- Serial.begin(9600); ------ in the main code ------------- Serial.println("CONVERT START"); //Convert Code Data Serial.println("CONVERT END"); --------- Then you can use the Ardunio IDE to monitor the serial port to see what happens in the code.
Heeth baharini5 years ago
Hi friend. This post on multiplexed Display was really very very useful but i have stuck in a problem. I want to display an temperature on the multiplexed display. I have used LM35 for temperature sensing and 7135 as ADC. Now when ADC is accessing the analog data and converting the data, my display is getting turned off. I have used timer for displaying, when the timer is overflown, its getting turned off for a while and getting turned on again. What to do friend?? Heeth
Heeth5 years ago
heyy, that was really useful for me. But i have a doubt. My multiplexed display is getting turned off for w while. I have used 7135 ADC and whenever 7135 gets data from from the source, my segments are getting turned off... What to do for that friends???
Dylan5525 years ago
 how do i know what resistors i need?
Teslaling5 years ago
You should try using PORTD instead of digitalWrite() because it will save code space and it will be faster.  Using PORTD would also fix the ghosting effect that is caused by the slower digitalWrite().
Grumpy Mike5 years ago
You have the current limiting resistor in the cathode. Doing this will alter the brightness of the number depending on how many segments are lit.

You can see this in your photograph the 1 is much brighter than the 9 and 8 would be dimmer still. You need to remove the cathode resistors and put a current limiting resistor in each segment's anode.
wopwop5 years ago
 Hi, 
Is this a Common Anode, or a Common Cathode display?
Would be great if you could post the displays model nr printed on the side.
Thanks!
baharini (author)  wopwop5 years ago
it's a common cathode display.
The model is a KINGBRIGHT KCDC04-101.
Sorry for the late response.
1-40 of 47Next »