"Countdown Timer With Reset Button and Potentiometer": Divine Word College of Laoag

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

DIVINE WORD COLLEGE OF LAOAG

SCHOOL OF ENGINEERING AND ARCHITECHTURE


General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

“COUNTDOWN TIMER WITH RESET BUTTON


AND POTENTIOMETER”

In Partial Fulfillment of the Requirement for the Degree of Bachelor of Science in


Electrical Engineering

Under

Microproccesor System

Submitted by:

Carl Joe Ignacio

Raymund Layugan

Jay Holish Ramos

Submitted to:

Engr, Lloyd Mitchell S. Macadangdang

INTRODUCTION

1
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

A countdown timer is a device which is designed to count down to a particular event.


They range in design from simple mechanical devices like those used in the kitchen to electronic
versions designed to be downloaded and installed on a desktop. Numerous websites also use a
countdown timer to mark the days, hours, minutes, and seconds until a major event, and some
websites also generate countdown timer codes for installation on personal websites.

A basic mechanical countdown timer is usually very easy to use. The user manually sets
the countdown timer to indicate the amount of time that needs to be counted down and turns it
on. These types of timers are very useful for baking, when some dishes require timing so that
you can keep track of them. Simple electronic countdown timers are designed to be used again
and again in the same way: the user opens the program that runs the countdown timer, enters the
necessary information, and starts it running. 

BACKGROUND OF THE PROJECT

Timers were originally designed to fulfill a need in industry for a means of keeping time
on certain devices. Originally, these timers were mechanical devices and used clockwork
mechanisms as a means of keeping a regular time (Timer, 2006). The invention of two
electromechanical timer designs allowed for more precise time measurement. The first uses the
principle of heat expansion to increase the temperature of a metal finger made of two different
metals with differing rates of thermal expansion (Timer, 2006). As electric current flows through
the metal, it begins to heat and one side expands more quickly than the other which, in turn,
moves the electrical contact away from an electrical switch contact. The second uses a small AC
motor which turns at a predetermined rate due to the application of an alternating current (Timer,
2006). Finally, digital timers were invented. Digital logic circuits are now so cheap that it has
become a better investment to buy a digital timer than a mechanical or electromechanical timer.
Individual timers are implemented with single chip circuits, similar to a watch (Timer, 2006).

MATERIALS

 ARDUINO UNO
 2 DIGITS 7 SEGMENT DISPLAY LED
 POTENTIOMETER
 PUSHBUTTON

2
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

PROCEDURE

1. Find and write code


2. Circuit testing using breadboard
3. Assemble the circuit in the pcv board

DIAGRAM

7 Segment Display Pinout Configuration

Pin Pin Name Description


Number

3
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

1 e Controls the left bottom LED of the 7-segment display

2 d Controls the bottom most LED of the 7-segment display

3 Com Connected to Ground/Vcc based on type of display

4 c Controls the right bottom LED of the 7-segment display

5 DP Controls the decimal point LED of the 7-segment display

6 b Controls the top right LED of the 7-segment display

7 a Controls the top most LED of the 7-segment display

8 Com Connected to Ground/Vcc based on type of display

9 f Controls the top left LED of the 7-segment display

10 g Controls the middle LED of the 7-segment display

FLOWCHART

START

SET TIME

4
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

BEGIN COUNTDOWN

DID THE
COUNTDOW
N REACHED
ZERO?

YES
YES

RESET
TIME?

PLUG OUT
SUPPLY?

YES

END

MECHANISM

Connect to the power supply and it will automatically run the timer. The potentiometer is used as
a time setter for the time duration. If the push button is tapped, the time automatically resets to
the declared time by the potentiometer.

CODE

5
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

char a= 2, b=3, c=4, d=5, e=6, f=7, g=8;

int hit=0, start=11, count=0, pot=A0;

char digit1=9, digit2=10;

char no[10]={

0b0111111, //number 0

0b0000110, //number 1

0b1011011, //number 2

0b1001111, //number 3

0b1100110, //number 4

0b1101101, //number 5

0b1111101, //number 6

0b0000111, //number 7

0b1111111, //number 8

0b1101111, //number 9

};

void number(int num){

digitalWrite(a, num & 0b0000001);

digitalWrite(b, num & 0b0000010);

digitalWrite(c, num & 0b0000100);

digitalWrite(d, num & 0b0001000);

digitalWrite(e, num & 0b0010000);

digitalWrite(f, num & 0b0100000);

digitalWrite(g, num & 0b1000000);

6
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

void puluhan(int w){

digitalWrite(digit1, HIGH);

digitalWrite(digit2, HIGH);

number(no[w]);

digitalWrite(digit1, LOW);

digitalWrite(digit2, HIGH);

delay(3);

void unit(int x){

digitalWrite(digit1, HIGH);

digitalWrite(digit2, HIGH);

number(no[x]);

digitalWrite(digit1, HIGH);

digitalWrite(digit2, LOW);

delay(3);

void setup(){

pinMode(a, OUTPUT);

pinMode(b, OUTPUT);

pinMode(c, OUTPUT);

pinMode(d, OUTPUT);

pinMode(e, OUTPUT);

pinMode(f, OUTPUT);

pinMode(g, OUTPUT);

7
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

pinMode(digit1, OUTPUT);

pinMode(digit2, OUTPUT);

pinMode(pot, INPUT);

pinMode(number, INPUT);

void loop(){

hit=analogRead(pot);

hit=map(hit, 1023, 0, 99, 0);

//hit=constrain(hit, 99,0);

int s1=hit/10;

int s2=hit%10;

puluhan(s1);

unit(s2);

int start=digitalRead(start);

if

(start==HIGH){ //start countdown

for (count=hit; count >= 0; count--) {

unsigned long startTime = millis();

for (unsigned long elapsed=0; elapsed < 800; elapsed = millis() - startTime) {

int d1=count/10;

int d2=count%10;

8
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

puluhan(d1);

unit(d2);

DOCUMENTARY

9
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

TABULATION OF EXPENSESPOTENTIOMETER

MATERIALS COST

4 PCS 1 DIGIT 7 SEGMENT DISPLAY 150

2 PCS 2 DIGIT 7 SEGMENT DISPLAY 216

7 PCS PUSHBUTTON 70

POTENTIOMETER 78

6 PCS PCB BOARD 70x90cm 300

PLASTIC ENCLOSURE 120

ARDUINO BOARD 560

15m SOLID WIRE 90

10
DIVINE WORD COLLEGE OF LAOAG
SCHOOL OF ENGINEERING AND ARCHITECHTURE
General Segundo Avenue, Laoag City, 2900 Philippines
_________________________________________________________________________________________________________________________________________

REFERENCES

- https://www.tinkercad.com/things/dvHLs4lWDQA-copy-of-copy-of-countdown-timer/
editel?tenant=circuits
- https://www.tinkercad.com/things/ezPkE3y7O0L-copy-of-timer-dengan-button-
stopwatch/editel?tenant=circuits

11

You might also like