You are on page 1of 7

World Academy of Science, Engineering and Technology 50 2009

Remote Token Display and Sound System


Ms. Seint Seint Htwe

 used. This research consists of three parts: one for the


Abstract— This paper describes Peripheral Interface Controller designing of hardware and software for the system, two for
(PIC) based remote token display and sound system. This system construction of hardware circuit including interfacing circuit
consists of two portions: transmitter unit and receiver unit. The and other for testing how to control the process by using
software and hardware designs in both units will be accomplished microcontrollers. This research attempts to get the knowledge
using two PIC16F877A microcontrollers and one PIC16F84
of the system.
microcontroller.
The transmitter unit predicts to display the input digit number
using five small-sized seven-segment LEDs and three LEDs which II. DESIGN IMPLEMENTATION OF REMOTE TOKEN
display only a selected group character at the same time. In order to DISPLAY AND SOUND SYSTEM
connect a PIC16F877A microcontroller with serial port to another As shown in Fig. 1, the remote token display and sound
PIC16F877A microcontroller, it is needed to adjust the level of the
system consists of two parts: the transmitter and receiver unit
signals so that the serial asynchronous communication can take
place. The information which is set with the transmitter unit is
containing two parts: displaying and creating music sound.
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.

Keywords—PIC assembly language, Receiver unit, Serial


transmission, Transmitter unit.

I. INTRODUCTION
ECHNOLOGIES are main facts of a powerful strong and
T 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. Fig. 1 Block diagram of remote token display and sound system
This research begins with an introduction to the concept of
the remote token display and sound system with serial This system is used to display the digit numbers which
interface and how it may be implemented keypad, LED corresponding a character. The incoming display data
displays, seven-segment LEDs, buzzer and PIC converts to sound function. People can know the token
microcontrollers. To express the numbers, this system can be 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
Manuscript received November 2, 2008. This work was supported in part implement clearly the hardware and software designs of each
by the Ministry of Science and Technology, Union of Myanmar.
unit of the system.
Miss Seint Seint Htwe is with the Mandalay Technological University,
Mandalay, Myanmar. Contact Phone: Fax: 095-2-88702 (Office,MTU), (e-
mail: seintseinthtwe@gmail.com).

629
World Academy of Science, Engineering and Technology 50 2009

A. Circuit Operation of Transmitter Unit becomes a low level, the transistor becomes ON and the
In Fig. 2, transmitter unit is composed by add the LED corresponding LED becomes lighting-up possible condition.
control circuit, switch scan circuit and RS232 control circuit. A lit segment is decided by the condition of RB6 from RB0.
It confirms to input number by the small-sized seven-segment The LED segment lights up when the corresponding port
LED and lights the LED which corresponds to the group becomes a low level.
character. 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.
Fig. 3 Software programming flowchart of transmitter unit
When the control port RA5 from RA0 of PIC16F877A

630
World Academy of Science, Engineering and Technology 50 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 seven-
segment 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 Fig. 4 Circuit diagram for display of receiver unit
latch register control circuit, character group display control
circuit and RS232 control circuit. It designs the information to When row one of decoder make one condition, the base
display by using large-sized seven-segment LED and light electric current flows through TR74 and TR74 becomes ON.
LED matrix for the group display. In seven-segment LED When TR74 becomes ON, the electric current flows through
latch register control circuit operation, 74LS273IC is D-type the base of TR85 and TR85 becomes ON condition. By this,
flip-flop as the latch register to hold the display of the LED is the LED becomes the possible condition to light up. The LED
used. One 74LS273 is used to control one seven-segment selecting circuit drives a lit LED in the selected row. Three
LED. In group display control circuit operation, a character kind of the character is controlled by RB5, RB6 and RB7 of
such as A, B and C is displayed with the diode matrix. It PIC16F877A. The LED which is lit up every character is
consists of the row selecting circuit and the LED selecting different. When TR1 is ON, it lights an LED up connecting
circuit. An LED matrix is composed of ten lines for the row with the collector of TR85. It decides a displaying character
and is composed of fourteen lines for the column. Lighting-up pattern in the LED matrix. RS232 interface is used for the
control is done every row. Because the direct control by PIC information transfer between both units. For RS232
microcontroller is difficult, 74LS154 decoder is used. A operation, MAX232 IC is used. The oscillation frequency is 4
control signal is developed from the four-bit signal of PIC to MHz. A transmission speed is calculated by 4 MHz.
seven signals of decoder.

631
World Academy of Science, Engineering and Technology 50 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
Fig. 6 Software flowchart of display programming process
PORTB are set output mode. And all ports of PORTD are
also set to output mode and are used for the segment control In the LED control process, the interruption occurs every
of the seven-segment LED. RC0, RC1, RC2, RC3 are set to two milliseconds with TMR0. As for the control of the group
output mode for the scan of the group display. RC7 pin of display, one row is done every time it interrupts in the two
PIC16F877A is the only input mode and to receive the milliseconds. Because of seven rows, the display of a group
transferred data form the transmitter unit. Timer0 is used for character is done in the seventy-seven milliseconds. The
the lighting-up scan of the LED. The period is two specification of the row is done by the PORTC. In number
milliseconds. information control and latch timing control, seven segment
The designation of the asynchronous serial communication display control is described. This counter is increased every
with 9600 bps transmission speed is done. This receiving two milliseconds. By this, number information control and
interrupting occurs when the data is received in the receiving latch timing control is executed first only once.
buffer. When the initialization of the USART ends, the

632
World Academy of Science, Engineering and Technology 50 2009

The data receive process making the data receiving from The program creates a sequence of tones. A tone is simply
the transmitter unit is started by the data receive interruption the action of turning on an output, executing a delay, turning
by the Receive Interrupt Flag (RCIF) bit of the PIR1 register. off the output, executing a delay, then repeating the sequence.
The data is decided in order to receive. The transmitter unit Sequence of tones is produced by making a table containing a
sends start data first and transmits group, 10000th, 1000th pair of values for each note. The first value produces the
100th, 10th and 1st data continuously in the order. In the time-delay between the high and low of the output and thus
receiving process, it waits for the start data first. If the start creates the frequency of the tone. The second value creates
data bit is received it is read and the received position is set. the length of time for the note.
Then, the received position is incremented and the interrupt is
ended. III. CIRCUIT CONSTRUCTION, TESTING AND RESULT
E. Program Structure of PIC16F84 for Sound In this section, it is described how to construct and test the
Fig. 7 shows software flowchart of sound programming transmitter circuit and the receiver circuit of the overall
process. The initialization processing is done after turning on. system. After the program is written, the microcontroller
In port mode initializing, the PORTA is used for the incoming would be installed into a device and run it.
data for sound specification. RA0 port of PORTA are set A. Circuit Construction of Transmitter Unit
input mode. And RB7 port of PORTB is also set to output When assembling an electronic circuit, a board is needed
mode and is used for the sound control of tune. In initializing on which the components can be mounted and wired together.
of the time duration, Different kinds of DELAY subroutine Mainly, PCBs (Printed Circuit Boards) are used for
are used for the creating sound. The period is ten assembling the circuits. The transmitter unit for the system is
microseconds, three milliseconds and 250 milliseconds. 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 50 2009

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.
Fig. 9 Display circuit construction of receiver unit

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 Fig. 11 Testing of overall system
using universal card. Fig. 10 shows the construction of sound
circuit for the receiver portion. In the next section, it is IV. DISCUSSIONS AND CONCLUSION
described how to test this remote token display and sound In this research, the instrument performs the display
device successfully. functions of operation counting of one group and music
sound function at the same time. This research is not only
C. Testing and Experiment Result applied for the teaching aid, for the beginner to learn the
design, programming and development of the applications
In this section, it is described how to test this remote token
which use the PIC but also applied for displaying the number
display and sound device successfully. The red number can be
in many fields that need to give information to users or
displayed by these seven-segment LEDs at the same time. A
partners.
selected group character is displayed only one LED. The A, B
In this research, its main limitations are its use of only three
and C characters are represented by using red LED, white
alphabets such as A, B, and C and five digit numbers from 0
LED and green LED. The input number zero to 99999 is
to 99999. This system is made by using fifteen meters length
counted with one of characters such as A, B and C.
RS232 cable between both units for display information of
In this testing, it is described to display the A character and
the transmitter.
the number 12645. When SW1, SW2, SW6, SW4, SW8 for

634
World Academy of Science, Engineering and Technology 50 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] Ram, B., “Fundamentals of Microprocessors and Microcomputers,”
2004.
[2] “Microchip. PIC16F87XA Data Sheet Book, 28/40/44- Pin Enhanced
Flash,” Microchip Technology Inc., 2003.
[3] Nashelsky,th L. and Boylestad, R. L., “Electronic Devices and Circuit
Theory,” 8 ed., Prentice Hall, Inc., USA. 2002.
[4] Matic, N., “PIC Microcontrollers,” 2000.
[5] “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.
[6] Stevens, A.L., “Getting started with PIC microcontrollers,”
th
1997.
[7] Floyd, T.L., “Electronic Devices I and II,” 4 ed., Prentice Hall
International, Inc., (1996).
[8] Nicholas, L.P., “Digital Design,” West Publishing Company, 1994.
[9] “Microchip PICStart Design Contest Application Brief Notebook,”
Microchip Technology Inc., 1993.
[10] Wilkinson, B. and Makki, R., “Digital System Design,” Prentice Hall,
International (UK) Ltd., 1992.
[11] Bylander, E.G., “Electronic Displays,” McGraw-Hill Edition, Inc.,
1979.
[12] http://www.datasheetarchive.com
[13] http://www. hobby.com
[14] http://www.senet.com/au
[15] http://www. analog.com
[16] http://www. datasheetcatalog.com
[17] http://www.microchip.com

635

You might also like