Quick viewing(Text Mode)

The World Clock Design and Implementation

The World Clock Design and Implementation

The Design and Implementation

Jhavik Gaudemar Bfern KIGNOUMBA (金永) Advisor: Prof. Chia-Chun Tsai Department of Computer Science Information and Engineering [email protected]

Abstract In this project, we design and implement a world display clock. The clock is a device controlled by the user and the user will be able to find the on different locations with the respective . Just by choosing the location in need, the user can get the real Buttons to 8 bit time if the default time as been set correctly. By using choose Micro Functions a 8951 microcontroller, we have been able to create Controler the device that can help on people at home, or even everywhere, because the device here do not need any pushbutton Switches internet connection to function correctly. The 4x4 objectives of our project here includes: 1) time setting Keyboard and 2) location’s choice. Our world clock can set up to locality's of 16 countries.

Keywords: World clock, Time zone, Microcontroller, Fig. 1: The system diagram of a world clock. Location’s choice, Display. II. Design and Development

I. Introduction This project creates a clock which displays the time for different countries on a displayer made of six Living aboard and far away from your country is 7-segment displays and 4 red-light LEDs. Here, we not easy thing cause other time you would like to pass are presenting a settable time that will be set as calls but there is a big with a time zone, so it is default time. And can be change according to the time sometimes a hassle because you don't know if it is zone in need. To set of time and the choice of the already a night time or not; and you would have to do locality's time, we have provided two push buttons to some operations to know what time is it wherever you allow the user to choose which function he needs to want to call, but when you have an international clock, set. As our clock here doesn't use the real time chip with what you will just need to press on one button device, so we need to set first the time before any use. and you have the time you want to know, it will be If the first button is pressed , the user can now set the much comfortable and easier. That is the reason I time from to using the 4x4 keyboard, wanted to make an international clock for myself at the time counter restarts once the user is done with his home that would show the time of many countries. I six entries, if not yet done, the clock won't be have a preference for LED displays as they are bright activated. While the button is pressed, a LED and give a large display. light on the CPU is on, and that is to let the user The requirements are: choose the location's time that he would like to know,  Use 7-segment LED displays to make an open using the same 4x4 keyboard as the adjust time. displayer. Here in Table 1, showing some of the world’s  Display the time. different times took from the link [1], with Taipei as a default time; we can see that there is a big difference  4x4 buttons to set time and also for the choice of of time according to the locality. the locality. Before creating the program we have listed the  2 single buttons, one to choose the set time steps that the program requires: function and the other one to change the time zone. 1) Initialize the PIC and set all digits to zero.  8-bit microcontroller 8951. 2) Start the timer interrupts to count the seconds Here is the system diagram as shown in Fig 1 elapsed. presenting the entire project. 3) When seconds reach 60 increment and reset seconds.

1

4) When minutes reach 60 increment hours and II.B The flowcharts reset minutes. Based on these steps we created a flowchart 5) When hours reach 24, they are reset. diagrams as shown in Figs. 3, 4, 5, and 6 to help us to 6) When the first push button is pressed, stop create the program. updating the clock, can now enter digits from 0-9. The two pressed buttons on the keyboard are to start set the hours, the two others for the minutes, then for the seconds. Is time no Set time 7) After the all settings, the second increments the set? number on the digits. When the digit reaches its

intended maximum it returns back to its lowest yes value. For example, hours range from 00 to 23. When the digit increments to 24 it returns to 00. 8) When the second push button is pressed, it now allows you to choose the locality's time. When a button on the keyboard is pressed, it change the Send the time zone, it increase or decrease to ; default time depending on which button have you pressed. Table 1. Locality's times are for different time zones. Choose the locality Time zone Locality'sTime Taipei 22:42 Send the Is any key time of the yes pressed? chosen Washington DC 09:42 locality. Anchorage 05:42 no Pretoria 16:42

Dubai 18:42 Call the function to write on 7 Tokyo 23:42 segment display Sydney 01:42 (on the next ) End Kinshasa 15:42 Fig. 3: The system's flowchart. Darwin 00:22 (on the next day) start II.A The keyboard

A basic 16-button keypad for user input. These B=0 buttons are setup in a matrix format. This allows a microcontroller to scan all the output pins to see keyscan which of the 16 buttons is being pressed. Here Fig. 2 is the model of the keyboard controlling the time zone change and the settings; Is yes any key pressed? Call delay no

no Is the key still yes pressed?

yes

B>4?

B = key pressed no

Fig. 2: The keyboard's sample. Fig 4: Key flowchart.

2

start As known that the time is displayed on a displayer made by seven segment display, so we have two different circuit diagrams. The first circuit diagram displayed in Fig. 3 is for the displayer and yes Time set? the 2nd in Fig. 4 is for our world clock.

no III. Implementation Clr last look III.A Displayer Here is the image showing the displayer circuit Set sec as shown in Fig. 7. Eight outputs are used to turn the 7-segment on and off and one more output to turn on Set min and off the flashing four LED light disposed between hour- and minute-second; and that is controlled Set hour with a given clock of 1 Hz. The 7-segment displays here are common anode so a port set low turns the segment on and a port set high turns it off. Each of yes Time set? the digits is turned on sequentially. The segments for that digit are only on while that digit is on. The seven no segment display is connected with the 7447 IC for its functioning. The total number of the seven segment display is 6, where two to display hours, two minutes Set clock mode Mode =1 and the last two for seconds. And also, this displayer is not only for displaying the time, but can also

End display all what can be displayed on the 7-segment, according the controlling CPU. To build this, we Fig 5: Set time flowchart. referred to the link [2] shown bellow.

start

Clear flag

Set time value

Subtract position

yes Sec 1?

no Display the unit of sec

yes Sec 10?

no Display the tens of sec

yes Min 1?

no Display the unit of min

yes Min 10?

no Display the tens of min

yes hour 1?

Display the unit of hour no

Display the tens of hour

End Fig 6: Displayer flowchart. Fig 7: The displayer's circuit.

3

III.B The World Cock Sydney's zone time on Fig 10; the two localities has a A world clock here doesn't mean the entire time difference of 3 hours as shown on pictures below. globe's countries time, but some of them. Here we can count 16 different times, marked by the different time zone difference, (eg: when it's 22:27 in Taiwan, it is 16:27 in Cape Town). The designing of the timer is done with the P89V51RD2 chip, programmed with the assembly language. Combine with a 4x4 keyboard plus two additional single-pushed buttons as explained previously, also with a LED indicator light. To build this, we had to refer to some websites to see how to connect to control the microcontroller 8951; and here are some links [3,4,5] shown bellow.

Note: here our timer only show the time not the date, so even if by pressing the time zone it gives the time which seems to be in a different day, we should know that our timer cannot precise the day. Fig 9: The time in Taipei.

Here is the image showing our microcontrol circuit in Fig 8. Showing all the connections to the 8951 chip, such as the keypad to the chip and so on,

5v output clock

330 Ω

10K P2.0 P0.0 P2.1 P0.1 P2.2 P2.3 P0.2 5V P2.4 P0.3 P2.5 P2.6 P0.4 P2.7 P0.5 P0.6 P3.0 P3.1 P0.7 P3.2 P3.3 10k P3.4 P3.5 8051 5v P3.6 5V P3.7

40 VDD 10K P1.0 12MHZ 20P 31 EA/VP 5V P1.1 Fig 10: The time in Sydney. 9 RESET P1.2

10k 10K P1.3 References 10µF 19 X1 P1.4

20P P1.5 18 X2 [1] Example on the real time Zone P1.6 20 VSS P1.7 http://www.timeanddate.com/worldclock/ [2]The seven segment display building. https://sites.google.com/site/embeddedclub4u/trai First 2nd 3rd 4th country country country country ning/embedded-system-training-in-45-days-6- 5th 6th 7th 8th country country country country /7-segment-display-interfacing-and-

9th 10th 11th 12th country country country country programming

13th [3] On keyboard - country Default Reset Set http://www.circuitstoday.com/interfacing-hex- keypad-to-8051 Fig 8: The timer's circuit. [4] Code programming- IV. Results and Conclusion http://www.setupsolution.com/assembly-code-to- use-timers-of-8051-microcontroller-for- As said in previous words, our project here is to generating-delays/ provide the time zones on different localities. Here [5] code we have images took from our world clock, showing http://www.8052.com/set8051 Taipei's zone time as a default time on Fig 9. And

4