Arduino 7 segment countdown timer

 by baharini
SANY0025.JPG
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.


 
Remove these adsRemove these ads by Signing Up

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
NeoRecasata says: May 28, 2013. 11:55 PM
common anode or common cathode
kilofeenix says: Aug 24, 2012. 12:42 PM
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.
mastergabe says: Aug 7, 2012. 2:26 AM
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
Santos46289 says: Mar 19, 2012. 2:44 PM
""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) in reply to Santos46289Mar 20, 2012. 11:28 AM
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.
nickygiscool says: Feb 3, 2012. 11:42 PM
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:)
honskie says: Jul 26, 2010. 3:31 PM
where i can put this code???? on visual basic??
tlegasse in reply to honskieJul 22, 2011. 7:45 PM
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 Lover says: Jul 6, 2011. 11:46 AM
I'm sure with a little effort, the code could be shortened quite a bit. I'll give it a try!
rocket_man says: May 23, 2011. 8:48 PM
Anybody know how i would do this only with simple circuit/ ics
jaragon says: Apr 28, 2011. 11:25 PM
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!
FalconFour says: Oct 7, 2010. 2:35 AM
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*...
FalconFour in reply to FalconFourOct 7, 2010. 2:37 AM
Also, nowhere in here states what segment is A-B-C-D-E-F-G... biggest bit of guesswork yet :(
granitepenguin in reply to FalconFourApr 7, 2011. 8:45 PM
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.
I Build, Therefore I Am says: Dec 5, 2010. 11:09 AM
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.
djlewis725 says: Nov 10, 2010. 7:24 PM
Worked great for me. Nice instructable, wiring was a bit tricky though.
anonymouse197 says: Oct 21, 2010. 3:15 PM
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!!
jrigvd says: Oct 17, 2010. 3:57 AM
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);
jrigvd says: Sep 24, 2010. 10:02 AM
my arduino won't read the code normal
Mr Jaderman says: Oct 27, 2009. 5:13 AM
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) in reply to Mr JadermanNov 1, 2009. 6:59 AM
I've updated the program so when you click on the icon it takes you directly to the program.
Heeth in reply to bahariniJul 5, 2010. 3:24 AM
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 in reply to HeethAug 30, 2010. 12:06 AM
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 in reply to bahariniJul 5, 2010. 3:20 AM
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
Heeth says: Jul 5, 2010. 3:15 AM
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???
Dylan552 says: Apr 17, 2010. 10:55 AM
 how do i know what resistors i need?
Teslaling says: Feb 13, 2010. 11:57 AM
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 Mike says: Jan 20, 2010. 7:48 AM
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.
wopwop says: Nov 6, 2009. 4:40 AM
 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) in reply to wopwopNov 21, 2009. 8:32 AM
it's a common cathode display.
The model is a KINGBRIGHT KCDC04-101.
Sorry for the late response.
Mr Jaderman says: Oct 28, 2009. 5:33 AM
I tried it again. When I clicked it, I saved it as, let's say, Arduino.pde and then it would save it as Arduino.pde.tmp as a tmp file and i can't change the file type.
 
Mr Jaderman says: Oct 27, 2009. 4:59 AM
I can not open your script. I've tried everything I could think of. PLEASE help!
 
ReCreate in reply to Mr JadermanOct 27, 2009. 9:05 PM
How could you not open it?
Its simply a text file, Rename it to .pde.
M4industries says: Oct 8, 2009. 2:03 PM
I will rate this higher if you do one thing, EXPAND ON THIS!
ikestarm17 says: Oct 5, 2009. 2:18 PM
can you explain a little better about what multiplexing is and maybe include a circuit diagram?
baharini (author) in reply to ikestarm17Oct 6, 2009. 9:06 AM
Sure! I will add more information about it for you.
ikestarm17 in reply to bahariniOct 6, 2009. 4:15 PM
that helped a lot, thanks!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!