Easy Countdown With Buzzer

Made by Mirco Marcazzan

About the project

How to make an easy and adaptable countdown.

Project info

Difficulty:

Categories:

Estimated time:

2 hours

Published:

4th July 2018

Items used in this project


Hardware components

7 segment Display (common cathode ) x 1
Resistor 10k ohm x 5
Resistor 221 ohm x 7
SparkFun Pushbutton switch 12mm x 3
Buzzer x 1
General Purpose Transistor NPN x 2
Arduino UNO & Genuino UNO x 1
Breadboard (generic) x 1

Story


Countdown Timer.

This project consists in an easy countdown with three buttons and a buzzer. I wanted to do this because often I need a countdown for different things, so I ask myself: "Why don't I build one?"

In this project there are three buttons:

  • The first button sets the time. 
  • The second button starts up the countdown.
  • The third button reset the time.

Technique of the Multiplexer.

I use the technique of the Multiplexer to display the numbers. The two displays are connected by connecting together the segments identified by the same letter. The correct view of the digit is available by activating one at a time the display. The command on each display saturates the transistor so turns on the display.

The user doesn't see one display at time but the whole digit. This is possible because the human eye fix what he sees for 25 ms, but all the cycle lasts less than 25 ms, so the two images are fix in the retina.

Unsigned long

I have used an unsigned long variable for not having 'overflowing' problems. This variable doesn't contains negative numbers and goes from 0 to 4,294,967,295.

With an 'int' variable, I would had only 32 seconds before overflowing. But with an unsigned long the problem is solved.

int

 -32,768 to 32,767
32,767 * 1ms → 32 seconds

unsigned long

4,294,967,295 * 1ms→ 4,294,967 seconds →71,582 minutes → 1,193 hours → 49 days.

Then, 49 days must pass before overflowing.

caption (optional)

Schematics


layout.jpg

connection diagram

CAD


Countdown

Go to download

Code


Countdown

Leave your feedback...