Introduction: 4 Digit 7-Segment Timer With Reset Button
This Instructable will teach you how to create a countdown timer using a 4 Digit 7-Segment Display that can reset with a button.
Included in this Instructable is the required materials, the correct wiring, and a downloadable file of the code that was to program the function of the 4 Digit 7-Segment Display.
Step 1: Required Materials
To create the 4 Digit 7-Segment Display timer, you will need the following:
- 4 Digit 7-Segment Display
- The model used was 5641AS
- 14 Wires
- 11 wires are used to connect the 4 Digit 7-Segment Display to the Arduino
- 2 wires are used to connect the Push Button to the Arduino
- 1 wire was left as a spare for the option to include decimal points on your 4 Digit 7-Segment Display
Step 2: Identifying the LED's of the 4 Digit 7-Segement Display
To help wire the 4 Digit 7-Segment Display, I first identified the pins of the 4 Digit 7-Segment Display and what they control.
After identifying the pins of the 4 Digit 7-Segment Display, I created my own schematic to decide how I was going to Wire the Arduino to the 4 Digit 7-Segment Display. Adding onto that, I made a chart to help identify the 4 Digit 7-Segment Display pin, its function, and what that pin was connected to on the Arduino.
Step 3: Wiring the 4 Digit 7-Segment Display and Push Button to Arduino
After placing the 4 Digit 7-Segement and Push Button on your Breadboard, the first step is to wire the 4 different digit pins to the first four pins to the Arduino as the chart says.
After this, continue to wire the remaining 4 Digit 7-Segment Display pins to the Arduino as the chart suggests. To make it easier for myself, I started with wiring the Digit Pins then finished with the individual light segments as the addition of those wires becomes messy.
Next, the remaining pins of the Arduino (13 and 5), will be used to wire the Push Button. These wires will be on the same side of the button.
Step 4: Writing the Code
Attached to this step of the Instructable is the code I used to program the 4 Digit 7-Segment Display.
This code highlights the previous step with identifying the pins of the 4 Digit 7-Segment Display, their function, and where they are wired on the Arduino.
Also, parts of the code highlight the areas that can be modified to change the starting time being counted down, as well as the time that the button restarts to after the button is pressed.
Reminder: 1 second = 1000
Step 5: Watch It Work
With the correct wiring and downloaded code, the timer will work.
Attached is a video of the 4 Digit 7-Segment display working. Whenever the button is pressed, all four digits will display a '0'.
Question 9 months ago
Do we Reeealy need to put it into 1(TX)? it might not work?
Answer 9 months ago
Oh it did
4 years ago
Hi, I'm having trouble doing the countdown, everything lights up and it doesnt display 0000 but 8888.
I am unable to download your video too.
Reply 4 years ago
Reply 9 months ago
Reply 2 years ago
The instructable has the HIGH and LOW values reversed. The 4x7 display works as follows: Digit position is selected with HIGH, Digit SEGMENTS are illuminated with LOW.
Reply 3 years ago
Did you double check your wiring?
Reply 3 years ago
Yeah, same for me as well...
3 years ago
What if I only want minutes and seconds? I'm trying to make a timer that counts down from 3 minutes.
Question 4 years ago
Nice project. I am looking to use this as a counter (I changed the n-- to n++). My question: Is there a way to make the button stop the timer and post the time?
4 years ago
Nice intro to Arduino tutorial. Thanks for sharing.