Sie sind auf Seite 1von 7

World Academy of Science, Engineering and Technology 26 2009

Remote Token Display and Sound System


Ms. Seint Seint Htwe

Abstract This paper describes Peripheral Interface Controller


(PIC) based remote token display and sound system. This system consists of two portions: transmitter unit and receiver unit. The software and hardware designs in both units will be accomplished using two PIC16F877A microcontrollers and one PIC16F84 microcontroller. The transmitter unit predicts to display the input digit number using five small-sized seven-segment LEDs and three LEDs which display only a selected group character at the same time. In order to connect a PIC16F877A microcontroller with serial port to another PIC16F877A microcontroller, it is needed to adjust the level of the signals so that the serial asynchronous communication can take place. The information which is set with the transmitter unit is displayed on the large-sized display installed in the about fifteen meters place using the RS232 cable. The receiver unit also predicts to display the output digit numbers using five large-sized seven-segment LEDs and three group characters using only one LED matrix. Music sound appeared within the token displaying by controlling PIC16F84 microcontroller at the receiver unit. This system is used to display the numbers such as 0 to 99999 which corresponding a group character such as A to C that is being known the people and the pleasant sound is creating at that time. The process programming for both units are developed and written in PIC assembly language. This system informs the people about the number of something and makes simple composition by considering that it is easy to see display letters from the distant place.

used. This research consists of three parts: one for the designing of hardware and software for the system, two for construction of hardware circuit including interfacing circuit and other for testing how to control the process by using microcontrollers. This research attempts to get the knowledge of the system. II. DESIGN IMPLEMENTATION OF REMOTE TOKEN DISPLAY AND SOUND SYSTEM As shown in Fig. 1, the remote token display and sound system consists of two parts: the transmitter and receiver unit containing two parts: displaying and creating music sound.

KeywordsPIC assembly language, Receiver unit, Serial transmission, Transmitter unit. I. INTRODUCTION

ECHNOLOGIES are main facts of a powerful strong and developed country. Today, the fields of microcontrollers have their beginnings in the development of technology of integrated circuits. People have always looked for ways to add convenience and comfort to their lives. Displaying is one way that this has been achieved. It adds comfort by seeing and listening from distant place people the creating information displays and is convenient because of being its long distance serial communication. This research begins with an introduction to the concept of the remote token display and sound system with serial interface and how it may be implemented keypad, LED displays, seven-segment LEDs, buzzer and PIC microcontrollers. To express the numbers, this system can be

Fig. 1 Block diagram of remote token display and sound system

Manuscript received November 2, 2008. This work was supported in part by the Ministry of Science and Technology, Union of Myanmar. Miss Seint Seint Htwe is with the Mandalay Technological University, Mandalay, Myanmar. Contact Phone: Fax: 095-2-88702 (Office,MTU), (email: seintseinthtwe@gmail.com).

This system is used to display the digit numbers which corresponding a character. The incoming display data converts to sound function. People can know the token number with listening pleasant sound from displace place. Each unit consists of: the hardware and software implementations. In this section, it is described how to implement clearly the hardware and software designs of each unit of the system.

629

World Academy of Science, Engineering and Technology 26 2009

A. Circuit Operation of Transmitter Unit In Fig. 2, transmitter unit is composed by add the LED control circuit, switch scan circuit and RS232 control circuit. It confirms to input number by the small-sized seven-segment LED and lights the LED which corresponds to the group character.

becomes a low level, the transistor becomes ON and the corresponding LED becomes lighting-up possible condition. A lit segment is decided by the condition of RB6 from RB0. The LED segment lights up when the corresponding port becomes a low level. In switch scan operation, ten switches are used for the group selecting, the number input, the sending, and the clearing. PIC16F877A scans a switch in the order and detects a pushed switch. Four-to-sixteen decoder is used to specify the switch to scan. This decoder is four to sixteen decoder and makes a corresponding signal port in sixteen kinds of signals a low level. The detection of the switch operation is done in RC4. When neither switch is pushed, RC4 is high level. The oscillation frequency is 4 MHz. A transmission speed is calculated by 4 MHz. B. PIC16F877A Program for Transmitter Unit Fig. 3 shows the programming process for the transmitter unit. The following process is done as the initialization process after the turning on. Port A is the port which specifies an LED control position. Port B is for the segment control of the LED. Port C is for the switch position control. The lighting-up control of the LED and the detection control of the switch condition are done at the same period.

Fig. 2 Circuit diagram of transmitter unit

In RS232 control circuit operation, MAX232 IC is used because of being long distance transmission in this research. It has the DC to DC converter making from +5V to 10. The RS232 interface is used as the connector between the transmitter unit and receiver unit. RS232 cable is designed for serial transmission of data to 9600 bps for a distance of approximately fifteen meters. In LED control circuit operation, it confirms to input number by five number of small-sized seven-segment display and lights the LED which corresponds to the group character. These LEDs are controlled one by one in the order by PIC16F877A. The power unit is also small. Because of being high speed control, it seems to light up at the same time to the look. The seven-segment LED is an anode common type. When the control port RA5 from RA0 of PIC16F877A

Fig. 3 Software programming flowchart of transmitter unit

630

World Academy of Science, Engineering and Technology 26 2009

Timer0 is used for a periodic control and the designation of the period in 2 ms. The designation of the asynchronous communication with 9600 bps transmission speed is done. Interrupting of doing transmission complete is made possible. Two kinds of interruption are used. They are interruption by the time-out of TMR0 and the interruption when the transmit data setting buffer (TXREG) becomes empty. The interruption of TMR0 is identified by the T0IF bit of the INTCON register and transmission buffer interruption is identified by the TXIF bit of the PIR1 register. The RETFIE instruction is executed at the end of the interruption processing. With this, it becomes the interruption possible condition. For LED control process, the interruption is occurred every 2 ms. Key scan processing is continuously done by the LED control. SW10 from SW1 are the key for the number input. When a number key is pushed, the displaying of a sevensegment LED is shifted on the one-digit left. SW13 from SW11 are the key for the character. Only the LED which corresponds to the pushed group is lit up. SW14 is a key for data sending. SW15 is a key for display clear. All LEDs are turned off when it is pushed. A data transmission to the receiver unit is done by this process. This process is started by the transmission buffer interruption by the TXIF bit of the PIR1 register. The TXIF bit indicates the empty condition of the TXREG register which sets a transmit data. Each data is composed of eight bits. A start and a stop bit are added to each of the data. So, one piece of data is composed of ten bits. C. Circuit Operation of Receiver Unit In the receiver unit as shown in Fig. 4 and Fig. 5, it consists of two parts: the display circuit and sound circuit. Each design contains two portions: the hardware and software implementation. The incoming data from the transmitter unit is received and then displayed in this display circuit by using PIC16F877A and created the display data to change into pleasant sound at the sound circuit by using PIC16F84. The serial cable of the D-9 pin is used for the connection between the transmitter unit and the receiver unit. It designs the display portion of the system. In the display circuit, it constructs seven segment LED latch register control circuit, character group display control circuit and RS232 control circuit. It designs the information to display by using large-sized seven-segment LED and light LED matrix for the group display. In seven-segment LED latch register control circuit operation, 74LS273IC is D-type flip-flop as the latch register to hold the display of the LED is used. One 74LS273 is used to control one seven-segment LED. In group display control circuit operation, a character such as A, B and C is displayed with the diode matrix. It consists of the row selecting circuit and the LED selecting circuit. An LED matrix is composed of ten lines for the row and is composed of fourteen lines for the column. Lighting-up control is done every row. Because the direct control by PIC microcontroller is difficult, 74LS154 decoder is used. A control signal is developed from the four-bit signal of PIC to seven signals of decoder.

Fig. 4 Circuit diagram for display of receiver unit

When row one of decoder make one condition, the base electric current flows through TR74 and TR74 becomes ON. When TR74 becomes ON, the electric current flows through the base of TR85 and TR85 becomes ON condition. By this, the LED becomes the possible condition to light up. The LED selecting circuit drives a lit LED in the selected row. Three kind of the character is controlled by RB5, RB6 and RB7 of PIC16F877A. The LED which is lit up every character is different. When TR1 is ON, it lights an LED up connecting with the collector of TR85. It decides a displaying character pattern in the LED matrix. RS232 interface is used for the information transfer between both units. For RS232 operation, MAX232 IC is used. The oscillation frequency is 4 MHz. A transmission speed is calculated by 4 MHz.

631

World Academy of Science, Engineering and Technology 26 2009

receiving operation is immediately done. After the initialization processing is ended, it waits for the interruption only. As the main processing, it repeats the execution of the same address. In the interruption process, two kinds of interruptions are used. They are interruption by the time-out of TMR0 and the interruption when the data is received. The interruption of TMR0 is identified by the TOIF bit of the INTCON register and the data receive interruption is identified by the RCIF bit of the PIR1 register. It becomes the interruption possible condition.

Fig. 5 Circuit diagram for sound portion of receiver unit

In sound circuit as shown in Fig. 5, its operation is depending on the frequency of the waveform. This circuit creates a sequence of tones. The low level signal from TR81 and TR82 transistors outputted to bases of TR92 and TR93 transistors. When the electric current flows to the base of TR92, TR92 transistor becomes ON condition and then the high level of TR92 transistor outputs to RA0 of PIC16F84. Similarly, when the low level of TR82 comes to the TR93, TR93 becomes ON condition and then the high level outputs to RA0 of PIC16F84. These data become the input signal of PIC16F84. Each input data can income one by one to the RA0 of PIC16F84 at the same time. RB7 of PIC16F84 outputs the square wave to create music sound. In order for them to work, a cycle is the change from High to Low or Low to High. The waveform can be a smooth change from one value to the other producing a square wave. The wave delivery produces a slightly output. To produce a higher output, the waveform is increased and this requires a driver transistor. This action produces a square wave and the PIC microcontroller activates a driver transistor that drives an amplifier to produce a sound. D. Program Structure of the PIC16F877A for Display Fig. 6 shows software flowchart of display programming process. The initialization processing is done after turning on. PORTB is used for the group specification and the display digit specification for the segment LED. All ports of the PORTB are set output mode. And all ports of PORTD are also set to output mode and are used for the segment control of the seven-segment LED. RC0, RC1, RC2, RC3 are set to output mode for the scan of the group display. RC7 pin of PIC16F877A is the only input mode and to receive the transferred data form the transmitter unit. Timer0 is used for the lighting-up scan of the LED. The period is two milliseconds. The designation of the asynchronous serial communication with 9600 bps transmission speed is done. This receiving interrupting occurs when the data is received in the receiving buffer. When the initialization of the USART ends, the

Fig. 6 Software flowchart of display programming process

In the LED control process, the interruption occurs every two milliseconds with TMR0. As for the control of the group display, one row is done every time it interrupts in the two milliseconds. Because of seven rows, the display of a group character is done in the seventy-seven milliseconds. The specification of the row is done by the PORTC. In number information control and latch timing control, seven segment display control is described. This counter is increased every two milliseconds. By this, number information control and latch timing control is executed first only once.

632

World Academy of Science, Engineering and Technology 26 2009

The data receive process making the data receiving from the transmitter unit is started by the data receive interruption by the Receive Interrupt Flag (RCIF) bit of the PIR1 register. The data is decided in order to receive. The transmitter unit sends start data first and transmits group, 10000th, 1000th 100th, 10th and 1st data continuously in the order. In the receiving process, it waits for the start data first. If the start data bit is received it is read and the received position is set. Then, the received position is incremented and the interrupt is ended. E. Program Structure of PIC16F84 for Sound Fig. 7 shows software flowchart of sound programming process. The initialization processing is done after turning on. In port mode initializing, the PORTA is used for the incoming data for sound specification. RA0 port of PORTA are set input mode. And RB7 port of PORTB is also set to output mode and is used for the sound control of tune. In initializing of the time duration, Different kinds of DELAY subroutine are used for the creating sound. The period is ten microseconds, three milliseconds and 250 milliseconds.

The program creates a sequence of tones. A tone is simply the action of turning on an output, executing a delay, turning off the output, executing a delay, then repeating the sequence. Sequence of tones is produced by making a table containing a pair of values for each note. The first value produces the time-delay between the high and low of the output and thus creates the frequency of the tone. The second value creates the length of time for the note. III. CIRCUIT CONSTRUCTION, TESTING AND RESULT In this section, it is described how to construct and test the transmitter circuit and the receiver circuit of the overall system. After the program is written, the microcontroller would be installed into a device and run it. A. Circuit Construction of Transmitter Unit When assembling an electronic circuit, a board is needed on which the components can be mounted and wired together. Mainly, PCBs (Printed Circuit Boards) are used for assembling the circuits. The transmitter unit for the system is made up of several components. It contains a PIC16F877A to handle input or output ports and the out coming information from the transmitter unit. Fig. 8 shows its construction which controls the transmitter unit of the system. The step-down transformer is used to change from AC 220 V to 12 V. Ten digit keys, three group keys, one send key and one clear key are mounted in the order. In this circuit, the first row is for SW1 to SW5 and the second row is for SW6 to SW10 and the third row is for SW11 to SW15.

Fig. 8 Construction of transmitter circuit

B. Circuit Construction of Receiver Unit As the transmitter circuit, the receiver circuit is made step by step. Because the receiver unit is large, it is composed of more than one sheet of printed boards. There is much wiring in this circuit. PIC16F877A is used for display part and PIC16F84 are used for sound part of the receiver unit.
Fig. 7 Software flowchart for sound control process circuit

633

World Academy of Science, Engineering and Technology 26 2009

Fig. 9 Display circuit construction of receiver unit

number 1,2,6,4,5 and SW11 for character A are pushed, 123645 number and character A display at the transmitter unit. After that this data is sent from the transmitter unit to the receiver unit by using SW14 for send data. This information displays and the music sound produces at the receiver unit. The LEDs which are arranged like a matrix is used for the character display such as A to C. The digit numbers such as zero to 99999 is displayed by using five numbers of large-sized seven-segment LEDs. All displays are red color. After displaying these character and digit numbers and listening the pleasant sound, SW15 of the transmitter unit is pushed. So the transmitter displaying is clear. But display and sound of the receiver unit continues. When the clear data from transmitter unit is sent by using SW14, the receiver displaying is clear, too. Then, the user is ready to use this device for next choice. By the way, this is testing of the PIC based remote token display and sound system successfully as shown in Fig. 11.

The left side of the number display is the part which displays the character. Switching diodes are used for the lighting-up control of the character display LEDs. The displayed character is three characters and lighting-up LED is controlled by the diode matrix. The part which displays the character is composed of 140 LEDs. This is in the condition that display of the receiver unit is complete. Fig. 9 shows the construction of display circuit for the receiver portion.

Fig. 10 Construction of sound circuit for receiver unit

After constructing of the display part, the sound circuit is constructed without drawing PCB layout because of being small and simple circuit. This circuit is constructed easily by using universal card. Fig. 10 shows the construction of sound circuit for the receiver portion. In the next section, it is described how to test this remote token display and sound device successfully. C. Testing and Experiment Result In this section, it is described how to test this remote token display and sound device successfully. The red number can be displayed by these seven-segment LEDs at the same time. A selected group character is displayed only one LED. The A, B and C characters are represented by using red LED, white LED and green LED. The input number zero to 99999 is counted with one of characters such as A, B and C. In this testing, it is described to display the A character and the number 12645. When SW1, SW2, SW6, SW4, SW8 for

Fig. 11 Testing of overall system

IV. DISCUSSIONS AND CONCLUSION In this research, the instrument performs the display functions of operation counting of one group and music sound function at the same time. This research is not only applied for the teaching aid, for the beginner to learn the design, programming and development of the applications which use the PIC but also applied for displaying the number in many fields that need to give information to users or partners. In this research, its main limitations are its use of only three alphabets such as A, B, and C and five digit numbers from 0 to 99999. This system is made by using fifteen meters length RS232 cable between both units for display information of the transmitter.

634

World Academy of Science, Engineering and Technology 26 2009

To extend the new transmitter unit, not only five digits but also other more digits can be designed. To extend another transmitter unit, the four-to-sixteen decoder 74LS154 can be also used with cascade by controlling enable pin eighteen and pin nineteen. After the output pins PIC16F877A increase only one, thirty-two switches can be used. To extend the next transmitter unit, the PIC16F877A can be also used Inter Integrated Communication (I2C) with serial EEPROM counting application bits. In large receiver unit, it can be used not only five digits of large-sized seven-segment LED but also more digits of seven-segment LED. To extend LED matrix for group displays, not only A, B, C but also other characters can be created. To extend sound function, not only this music sound but also other sound can be created. For further extension, the other cables as RS422 and RS485 cables better than RS232 cable can be used for more distance between two units. The overall system can be extended by using wireless communication system between two units. ACKNOWLEDGMENT Firstly the author wishes to express her deep gratitude to His Excellency Minister U Thaung, Ministry of Science and Technology, for his special guidance to pay chances. The author would like to thank their parents for their best wishes to join the research. The author would like to express the heart-felt gratitude to Dr. Maung Maung Latt for his leadership and advice, U Clement Saldanha, Dr. Yin Mon Myint and Dr. Nay Win Zaw for their encouragement, support and suggestions. The author wishes to express her deep gratitude to all persons who helped her directly or indirectly towards the successful completion of this paper. REFERENCES
[1] [2] [3] [4] [5] Ram, B., Fundamentals of Microprocessors and Microcomputers, 2004. Microchip. PIC16F87XA Data Sheet Book, 28/40/44- Pin Enhanced Flash, Microchip Technology Inc., 2003. Nashelsky,th L. and Boylestad, R. L., Electronic Devices and Circuit Theory, 8 ed., Prentice Hall, Inc., USA. 2002.

Matic, N., PIC Microcontrollers, 2000.


Microchip PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers, Microchip Technology Inc., th1998. Leach and Malvino, Digital Principles and Applications, 5 ed., McGraw-Hill Edition, 1998. Stevens, A.L., Getting started with PIC microcontrollers, 1997. th Floyd, T.L., Electronic Devices I and II, 4 ed., Prentice Hall International, Inc., (1996). Nicholas, L.P., Digital Design, West Publishing Company, 1994. Microchip PICStart Design Contest Application Brief Notebook, Microchip Technology Inc., 1993. Wilkinson, B. and Makki, R., Digital System Design, Prentice Hall, International (UK) Ltd., 1992. Bylander, E.G., Electronic Displays, McGraw-Hill Edition, Inc., 1979. http://www.datasheetarchive.com http://www. hobby.com http://www.senet.com/au http://www. analog.com http://www. datasheetcatalog.com http://www.microchip.com

[6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

635

Das könnte Ihnen auch gefallen