Académique Documents
Professionnel Documents
Culture Documents
Now-a-days people prefer digital clocks more than an analog clock because of their
elegant outlook, inexpensiveness, small size and accuracy. As a result many smart
digital clocks are manufactured by different popular companies. Because of its low
price and tiny size, it is often incorporated into all kinds of devices such as cars,
radios, televisions, microwave ovens, standard ovens, computers and cell phones to
enhance the quality of that device. In this particular project, design of a smart
multipurpose clock is provided. This clock is designed with two PIC microcontrollers
and a Real Time Clock (RTC) IC. The display section is designed with Seven
Segment display and LED. A temperature sensor is also integrated with the system to
show the current temperature in Seven Segment. A seven segment display is the
most basic electronic display device that can display digits from 0-9. They find wide
application in devices that display numeric information like digital clocks, radio,
microwave ovens, electronic meters etc. The most common configuration has an array
of eight LEDs arranged in a special pattern to display these digits. They are laid out as
a squared-off figure 8. Every LED is assigned a name from 'a' to 'h' and is identified
by its name. Seven LEDs 'a' to 'g' are used to display the numerals while eighth LED
'h' is used to display the dot/decimal.
A seven segment is generally available in ten pin package. While eight pins
correspond to the eight LEDs, the remaining two pins (at middle) are common and
internally shorted. These segments come in two configurations, namely, Common
cathode (CC) and Common anode (CA). In CC configuration, the negative terminals
of all LEDs are connected to the common pins. The common is connected to ground
and a particular LED glows when its corresponding pin is given high. In CA
arrangement, the common pin is given a high logic and the LED pins are given low to
display a number. Find out more information about a seven segment display and its
working
INTRODUCTION
A digital clock is no different than an analog clock. It simply handles the timing
functions electronically rather than mechanically [1]. A digital clock is a type of clock
that displays the time digitally , i.e. in the LCD, LED or Seven Segment display, as
opposed to an analog clock, where the time is displayed by hands [2]. Electronic
clocks have predominately replaced the mechanical clocks as they are much reliable,
accurate, maintenance free, portable and cost effective [3]. In this project work a
multipurpose digital clock is developed which not only shows the time operations but
also indicates the room temperature. The whole controlling operation is maintained
by a PIC microcontroller 16F877A which not only communicates with a Real Time
Clock IC but also calculates the whole time functions and displays it with Seven
Segment and LED displays. Another PIC microcontroller 16F72 is used to enhance
the number of ports and synchronizes with main controller IC to display the days in
the LED. A real-time clock (RTC) is used to keep track of the current time. Although
the term often refers to the devices in personal computers, servers and
embedded
systems, RTCs are present in almost any electronic device which needs to keep
accurate time [4] for precise work to be maintained.
OVERALL SYSTEM
In this manner an eight digit display with seven segments and a decimal point
would require only 8 cathode drivers and 8 anode drivers, instead of sixty-four
drivers and IC pins.[7]Often in pocket calculators the digit drive lines would be used
to scan the keyboard as well, providing further savings; however, pressing multiple
keys at once would produce odd results on the multiplexed display.
HARDWARE DESIGN
FEATURES
Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month, day
PIN ASSIGNMENT
PIN DESCRIPTION
GND - Ground
The DS1307 operates as a slave device on the serial bus. Access is obtained by
implementing a START condition and providing a device identification code
followed by a register address. Subsequent registers can be accessed
sequentially until a STOP condition is executed. When VCC falls below 1.25 x
VBAT the device terminates an access in progress and resets the device address
counter. Inputs to the device will not be recognized at this time to prevent
erroneous data from being written to the device from an out of tolerance
system. When VCC falls below VBAT the device switches into a low-current
battery backup mode. Upon power-up, the device switches from battery to VCC
when VCC is greater than VBAT + 0.2V and recognizes inputs when VCC is
greater than 1.25 x VBAT. The block diagram in Figure 1 shows the main
elements of the serial RTC.
SIGNAL DESCRIPTIONS
VCC, GND DC power is provided to the device on these pins. VCC is the
+5V input. When 5V is applied within normal limits, the device is fully
accessible and data can be written and read. When a 3V battery is connected to
the device and VCC is below 1.25 x VBAT, reads and writes are inhibited.
However, the timekeeping function continues unaffected by the lower input
voltage. As VCC falls below VBAT the RAM and timekeeper are switched over
to the external power supply (nominal 3.0V DC) at VBAT.
VBAT Battery input for any standard 3V lithium cell or other energy source.
Battery voltage must be held between 2.0V and 3.5V for proper operation. The
nominal write protect trip point voltage at which access to the RTC and user
RAM is denied is set by the internal circuitry as 1.25 x VBAT nominal. A
lithium battery with 48mAhr or greater will back up the DS1307 for more than
10 years in the absence of power at 25C. UL recognized to ensure against
reverse charging current when used in conjunction with a lithium battery.
SCL (Serial Clock Input) SCL is used to synchronize data movement on the
serial interface.
SDA (Serial Data Input/Output) SDA is the input/output pin for the 2-wire
serial interface. The SDA pin is open drain which requires an external pullup
resistor.
X1, X2 Connections for a standard 32.768 kHz quartz crystal. The internal
oscillator circuitry is designed for operation with a crystal having a specified
load capacitance (CL) of 12.5pF. For more information on crystal selection and
crystal layout considerations, please consult Application
Crystal Considerations with Dallas Real-Time Clocks. The DS1307 can also
be driven by an
CLOCK ACCURACY
The accuracy of the clock is dependent upon the accuracy of the crystal and the
accuracy of the match between the capacitive load of the oscillator circuit and
the capacitive load for which the crystal was trimmed. Additional error will be
added by crystal frequency drift caused by temperature shifts. External circuit
noise coupled into the oscillator circuit may result in the clock running fast.
The address map for the RTC and RAM registers of the DS1307 is shown in
Figure 2. The RTC registers are located in address locations 00h to 07h. The
RAM registers are located in address locations 08h to 3Fh. During a multi-byte
access, when the address pointer reaches 3Fh, the end of RAM space, it wraps
around to location 00h, the beginning of the clock space.
register bytes. The RTC registers are illustrated in Figure 3. The time and
calendar are set or initialized by writing the appropriate register bytes. The
contents of the time and calendar registers are in the BCD format. Bit 7 of
register 0 is the clock halt (CH) bit. When this bit is set to a 1, the oscillator is
disabled. When cleared to a 0, the oscillator is enabled.
Please note that the initial power-on state of all registers is not defined.
The DS1307 can be run in either 12-hour or 24-hour mode. Bit 6 of the hours
register is defined as the 12- or 24-hour mode select bit. When high, the 12hour mode is selected. In the 12-hour mode, bit 5 is the AM/PM bit with logic
high being PM. In the 24-hour mode, bit 5 is the second 10 hour bit (20- 23
hours).
CONTROL REGISTER
The DS1307 control register is used to control the operation of the SQW/OUT
pin.
OUT (Output control): This bit controls the output level of the SQW/OUT pin
when the square wave output is disabled. If SQWE = 0, the logic level on the
SQW/OUT pin is 1 if OUT = 1 and is 0 if OUT = 0.
SQWE (Square Wave Enable): This bit, when set to a logic 1, will enable the
oscillator output. The frequency of the square wave output depends upon the
value of the RS0 and RS1 bits. With the square wave output set to 1Hz, the
clock registers update on the falling edge of the square wave.
RS (Rate Select): These bits control the frequency of the square wave output
when the square wave output has been enabled. Table 1 lists the square wave
frequencies that can be selected with the RS bits.
Data transfer may be initiated only when the bus is not busy.
During data transfer, the data line must remain stable whenever the clock line
is HIGH. Changes in the data line while the clock line is high will be
interpreted as control signals.
Bus not busy: Both data and clock lines remain HIGH.
I2C PROTOCOL
I2C is a serial data bus protocol that allows multiple devices to connect to
each other with fairly slow data transfer rates for better collaboration [10]. Many
microcontrollers have libraries to support I2C. The I2C bus use only 2 bidirectional
data lines for communicating with the microcontroller. The I2C protocol use
master and slave method, the master which is usually the microcontroller while the
slave can be any I2C device such as Real Time Clock DS1307. I2C communication
requires two ports, one for the serial data called SDA (serial data) to communicate
with SCK pin of PIC IC and the other for synchronize clock called SCL (serial
clock) to communicate with SDI pin of PIC IC[11].
WORKING PRINCIPLE
FLOW CHART
ADVANTAGES
DISADVANTAGES
1. When power of total system is off so always keep battery .
APPLICATIONS
1. RTCs are present in almost any electronic device which needs to keep accurate
time.
2. It is used in devices like personal computers, servers and embedded systems.
CONCLUSION
In these days different pattern of digital clocks are available in market. Most
of them are of very high price and low quality. Many of those cannot provide the
time accurately for longer period as those are designed with timer ICs like 555
timer.
Again some digital clocks loss their data whenever the power supply shuts
down. But our designed multipurpose digital clock is accurate because of its Real
Time Clock module that keeps track of the system time and update.
The DS1307 has a built-in power sense circuit that detects power failures and
automatically switches to the 3V Li Cell battery supply which is incorporated with
the RTC. Most of the digital clock in the market does not cover all the time functions
whether our designed digital clock covers all the time options and we will also
incorporate the alarm option in next version.
However, the Temperature displaying is an additional feature of our smart
digital clock. It is possible to develop this system with only USD 7. So this version
of digital clock is really a cheap, precise and well featured device for the present
market.
REFERENCES