0% found this document useful (0 votes)
18 views

Digital Clock Using Aurdino

Uploaded by

Chinnu Cutiee28
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Digital Clock Using Aurdino

Uploaded by

Chinnu Cutiee28
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Chaitanya Institute of Science

and Technology

Chaintanya Institute of Science and Technology,Madhavapatnam Kakinada 533005


Summer online Internship Embedded
Systems
Batch Members
 Chinchinada Bala veera Venkata surya sai Praveena - 21S05A0401
 Eagala sai hemanth - 21S05A0402
 Penke Sravan kumar - 21S05A0403
 Sheik Abdul Ismail - 21S05A0404
 Yarram Janeswar durga prasadu swamy - 21S05A0405
Aurdino based Digital Clock

Under the Guidance of Mr.M.Uma maheswarrao,M.tech


content
 Objective
 Introduction
 Purpose of the project
 Components Used
 Process
 Circuit
 Program
Objective:
Design And Implementation Of Aurdino Based Digital
Clock Using Real Time Clock Display
Introduction
The development of the digital clock in arduino is to provide its own time
without rtc. Generally, electronic circuit designers use rtc to construct a clock.
Such a circuit requires an extra circuit and power. The cmos battery supplies
power to the rtc, once the cmos battery power is discharged,it automatically
erases the date and time and requires an update from an external device.
Considering these facts, rtc is avoided and code with nested looping is used to
maintain timing in Arduino.
It enables us to modify the time using a keypad and lcd without an external
device. continuous power is supplied to the arduino using a battery backup. such a
circuit is simple with reduced code.
Purpose of the project
A Digital Clock Is a great Invention in electronics science.Nowadays,digital Clocks are used
everywhere. The analog clocks are quite Old-fashioned. So The Digital Clock takes It place day By
day. The arduino digital clock is looking very modern. It has many additional features also like
temperature,alarm,timer,etc.
In this project ,we are going to build an Arduino based digital clock.
Components Used

 Arduino Uno R3

 LCD 16 x 2

 1 kΩ Resistor

 220 Ω Resistor

 Pushbutton

 Potentiometer
Arduino uno r3:
Arduino is one of the most popular electronics prototyping boards
based on the ATmega328P microcontroller. ATmega328P is an
AVR architecture based 8-bit microcontroller.Here I am using
Arduino Nano for this project to give it a compact look.
The microncontroller board is equipped with sets of digital and
analog input/ouput (I/O) pins that may be interfaced to
various expansion boards (shields) and other circuits.[1] The board
has 14 digital I/O pins (six capable of PWM(output), 6 analog I/O
pins, and is programmable with the Arduino IDE (Integrated
Development Environment), via a type B USB cable. It can be
powered by a USB cable or a barrel connector that accepts
voltages between 7 and 20 volts, such as a rectangular 9-volt
battery.
LCD Display(16 2)
A 16*2 LCD display is the most commonly used
display unit for microcontroller based applications.It
supports 16 characters in a row with two such rows. It
also supports special characters and even custom
characters. The term LCD stands for liquid crystal
display. It is one kind of electronic display module used
in an extensive range of applications like various circuits
& devices like mobile phones, calculators, computers,
TV sets, etc. These displays are mainly preferred for
multi-segment light-emitting diodes and seven segments.
The main benefits of using this module are inexpensive;
simply programmable, animations, and there are no
1 KΩ Resistor & 220 Ω Resistor
A resistor is a passive electrical component with the primary function to
limit the flow of electric current.
Resistors can also be used to provide a specific voltage for an active
device such as a transistor.
This ratio is represented by Ohm’s law. Resistors can be divided by
functional type as well as resistance material.
1. Fixed resistors
2. Variable resistors
Fixed resistor: A resistor having a fixed, defined electrical resistance
which is not adjustable. In an ideal world a perfect resistor would have a
constant ohmic resistance under all circumstances. This resistance would
be independent of for example frequency, voltage or temperature.
Variable resistor: A variable resistor is a resistor of which the electric
resistance value can be adjusted. A variable resistor is in essence an
electro-mechanical transducer and normally works by sliding a contact
(wiper) over a resistive element. When a variable resistor is used as a
potential divider by using 3 terminals it is called a potentiometer.
Push Button
• A push-button (also spelled pushbutton) or
simply button is a simple switch mechanism to control
some aspect of a machineor a process. Buttons are
typically made out of hard material, usually plastic
or metal.The surface is usually flat or shaped to
accommodate the human finger or hand, so as to be
easily depressed or pushed. Buttons are most
often biased switches, although many un-biased buttons
(due to their physical nature) still require a spring to
return to their un-pushed state.
Potentiometer
• A potentiometer is a manually adjustable variable resistor
with 3 terminals. Two of the terminals are connected to
the opposite ends of a resistive element, and the third
terminal connects to a sliding contact, called a wiper,
moving over the resistive element. The potentiometer
essentially functions as a variable resistance divider. The
resistive element can be seen as two resistors in series (the
total potentiometer resistance), where the wiper position
determines the resistance ratio of the first resistor to the
second resistor. If a reference voltage is applied across the
end terminals, the position of the wiper determines the
output voltage of the potentiometer.
PROCESS
At first we need to take components are arduino, lcd display(16*2), three push
button,resistors(1kΩ & 220Ω) and connect them as shown in circuit diagram.Connect all three
push buttons in any one terminal to the ground and other terminals of the three pushbuttons are
connected to arduino pins of D8,D9,D10.In Arduino there are 2 pins for I2C communication.Those
are A4 & A5 and acts as SDA(serial data) and SCL(serial clock)respectively.
Without a real-time clock module,the circuit is working as a manual controller.we can manually set
the time to our requirements.
The first button is the setting mode that can change the format of the time to the D8 pin.The second
button is for setting up the hour by sending a signal to the D9 pin.The third button is for setting up
the minutes by sending a signal to the D10 pin of the Arduino.
The whole circuit is working as a continuous sequence.When the power goes out,the circuit will
reset to its initial position.Then we need to again set the time via the push button.So this is a major
drawback for this circuit.
Circuit
void loop() case 1:
if(s>59){
}

{
s=0;
m++;

if(m>59){
if(digitalRead(8)&&state==1){ m=0;
h++;

cnt++; if(h>23){
h=0;

state=0; dt++;

if(dt>l[mo]){
cnt=cnt%5; dt=1;
mo++;

}else if(!digitalRead(8)&&state==0){ }
if(mo>12){
mo=1;
state=1} }
}

if (digitalRead(9)&&state1==1){ }
}
h=h;
dg=1; d=(h)%10;
printNumber(d, 3);

state1=0; d=(h)/10;
printNumber(d, 0);
d=m%10;

}else if(!digitalRead(9)&&state1==0){ printNumber(d, 10);


d=m/10;
printNumber(d, 7);
state1=1; lcd.setCursor(14, 0);
lcd.print(s/10);

} lcd.print(s%10);
lcd.setCursor(13, 1);
lcd.print(months[mo]);
lcd.print(dt/10);
lcd.print(dt%10);

if(digitalRead(10)&&state2==1){ if(cnt==0){
s++;
lcd.setCursor(6, 0);
dg=-1; lcd.print(" ");
lcd.setCursor(6, 1);

state2=0; lcd.print(" ");


lcd.setCursor(13,0);
lcd.print(" ");

}else if(!digitalRead(10)&state2==0){ delay(500);


lcd.setCursor(6, 0);
lcd.print(".");
state2=1; lcd.setCursor(6, 1);
lcd.print(".");

} lcd.setCursor(13,0);
lcd.print(":");
delay(500);
switch(cnt){ h=h+dg;
}}

case 2: dg=0;if(h>23){
h=h-24;}
if(h<0){
m=m+dg; h=23;}
break;

dg=0; if(m>59){ case 3:


dt=dt+dg;

m=0;} dg=0;if(dt>l[mo]){
dt=l[mo];}
if(dt<1){
if(m<0){ dt=1;}
break;

m=59;} case 4:
mo=mo+dg;
dg=0;if(mo>12){
break; mo=1;
}
if(mo<1){
mo=12;}
if(dt>l[mo]){
dt=1;
mo++;

You might also like