You are on page 1of 7

World Academy of Science, Engineering and Technology 39 2008

Remote Token Display System using


Microcontroller
Seint Seint Htwe, May Thwe Oo, and Hnin Lelt Win

 component selections for these designs.


Abstract—This paper describes microcontroller based remote One PIC16F877A microcontroller is used by consideration
token display system. This system consists of two portions: of the communication functions to send data to the receiver
transmitter unit and receiver unit. The software and hardware designs unit from the transmitter unit and the number of the input-
in both units will be accomplished using two PIC16F877A
output ports. Another PIC16F877A microcontroller is to
microcontrollers. The information which is set with the control unit is
displayed on the large-sized display installed in the about 15m place receive the data from the transmitter unit and display control
using the RS232 cable. The process programming for both units are of them. The asynchronous communication function of
developed and written in PIC (Peripheral Interface Controller) PIC16F877A microcontroller is used for this research work.
assembly language. This system informs the people about the token In order to connect a microcontroller with serial port to
number of something. This system is designed to construct using another microcontroller, it is needed to adjust the level of the
with the components which can buy easily in the market, easy to use
signals so that the serial asynchronous communication can
and familiar with a person who interested in the electronic field. It is
easy to see display letters from the distant place. This paper describes take place.
the design, construction, testing and result of a remote token display Typically, the PIC microcontroller serial port is used with
device. an RS232 transmitter/receiver to provide a serial
communication link to another unit. This communication
Keywords—PIC assembly language, Receiver unit, Serial provides serial asynchronous data transfer over two lines such
transmission, Transmitter unit. as Tx for transmitting and Rx for receiving within 15m range.
Besides voltage level of the RS232 line interface, MAX232
I. INTRODUCTION has a role to adjust signal levels in the microcontroller side,
format and transfer rate. The way to transfer data between the
P EOPLE 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 from distant
microcontroller and other microcontroller is via RS232
communication port. There are multiplexing group LED and
place people the creating information displays and is five numbers of seven-segment LED displays, scanning a
convenient because of being its long distance serial fifteen-keypad. Communications interface modules are often
communication. The remote token display system can be integrated into the controller and can therefore be seen as
divided into two main portions: the transmitter unit and the controller components.
receiver unit. Each unit consists of two main parts; hardware The small-sized transmitter unit predicts to display the input
and software implementations. digit number using five small-sized seven-segment LEDs and
The PIC microcontrollers can be used as the brain to control three LEDs which display a selected group character. The
a large variety of products. The software and hardware information which is set with the control unit is displayed on
designs in both units will be accomplished using the two the large-sized display installed in the about 15m using the
PIC16F877A microcontrollers. This chip was chosen for RS232 cable. About ±9V from the transmitter unit is used for
reasons of speed, digital ports ability, memory storage, and signal voltage on the connection cable with the receiver unit
number of I/O (input or output) ports. This system has been and the long distance transmission is possible comparatively.
developed which allows for keypad design, display design and Actually, it is possible to use for any more distance. It
serial communication design based on two PIC chips and depends on the condition of the cable.
The large-sized receiver unit also predicts to display the
Manuscript received March 24, 2008. This work was supported in part by
output digit numbers using five large-sized seven-segment
the Ministry of Science and Technology, Union of Myanmar. LEDs and three group characters using only one LED matrix.
Miss Seint Seint Htwe is with the Mandalay Technological University, The token number is displayed by the large-sized seven-
Mandalay, Myanmar. Contact Phone: Fax: 095-2-88702 (Office,MTU), (e- segment Light Emitting Diodes (LEDs). The group display
mail: seintseinthtwe@gmail.com).
Miss May Thwe Oo is with the Mandalay Technological University, LED matrix can be expressed the three characters. A group is
Mandalay, Myanmar. Contact Phone: Fax: 095-2-88702 (Office,MTU), (e- displayed as the letter by the combination of the LEDs. The
mail: maythweoomtu@gmail.com). LEDs which corresponds to the character in the transmitter
Miss Hnin Lelt Win is with Mandalay Technological University,
Mandalay, Myanmar. Contact Phone: Fax: 095-2-88702 (Office,MTU), (e- unit is lit up. This system is used to display the numbers such
mail: hninleltwin@gmail.com). as 0 to 99999 which corresponding a group character such as

134
World Academy of Science, Engineering and Technology 39 2008

A to C that is being known the people.


In this research, the hardware controlling programs which
are the key scan process, displays process, transmitting and
receiving process programming for both units are developed
and written in PIC assembly language. Program writing is a
special field of work with microcontrollers and is called
“programming”. After the program is written, install the
microcontroller into a device and run it. In order to does this
measurement circuit need to add a few more external
components necessary for its work. Based on its clocks
microcontroller executes instruction of a program.
This research consists of three parts: one for the designing
of hardware and software for this system, two for construction
of hardware circuit including interfacing circuit and other for
testing how to control the process by using microcontrollers.
This research is based on two PIC16F877A microcontrollers
for keypad, displays and serial interface.

II. REMOTE TOKEN DISPLAY CIRCUIT DESIGN Fig. 1 Block diagram of the remote display system
The remote token display system with serial interface is
designed into two main parts: the transmitter unit and the A. Transmitter Circuit Design
receiver unit. This system is electronically controlled by the
In the transmitter unit, it consists of two parts: hardware
two units, which consist of hardware and software
and software implementations. The hardware implementation
implementations. This system can be used for displaying at the
is designed with one PIC16F877A microcontroller, one
transmitter unit, sending data from the transmitter unit to the
MAX232, one 74LS154 decoder, one 7805 regulator, five
receiver unit and displaying at the receiver unit as shown in
small-sized seven-segment LEDs, three LEDs, fifteen
Fig. 1. Many choices had to be made during the design to
switches, fifteen switching diodes, five 2SA1015 transistors,
insure that all parts would interact correctly and efficiently.
4MHz crystal, resistors and capacitors.

Fig. 2 Circuit diagram of the transmitter unit

135
World Academy of Science, Engineering and Technology 39 2008

Fig. 2 describes circuit diagram of the transmitter unit. The Instruction is executed from zero addresses of the program
seven-segment LEDs which use in this circuit are common memory when the power ON of the PIC is made. When there
anode type. The serial cable of the D9 connector is used for is interruption processing, processing is begun from the
the connection between the transmitter unit and the receiver address four. It makes each processing jump with the GOTO
unit. The female connector is used for the side of the instruction.
transmitter unit. In the software, two kinds of interruption are used. They are
An LED for group display and five seven-segment LEDs interruption by the time-out of TMR0 and the interruption
are used for the input numbers. These LEDs are controlled when the transmit data setting buffer (TXREG) becomes
one by one in the order by PIC16F877A microcontroller. The empty. The interruption of TMR0 is identified by the T0IF bit
control port RA5 from RA0 of PIC microcontroller is decided of the INTCON register and transmission buffer interruption
lighting-up possible condition for LEDs. The condition of is identified by the TXIF bit of the PIR1 register. The user
RB6 from RB0 decides a lit segment. made display the letter of "E" in the first digit of the LED
PIC microcontroller scans a switch in the order and detects when the interruption which does not correspond to two kinds
a pushed switch. Four-to-sixteen decoder is used to specify of above-mentioned interruption occurred. This processing is
the switch to scan. This decoder develops the binary signal of hardly executed.
four bits and makes a corresponding signal port in sixteen As for the LED control, one digit is processed every time it
kinds of signals a low level. The detection of the switch does 2ms interruption. Because there are six kinds of LEDs, it
operation is done in RC4. A transmission speed is calculated takes 12ms to control all LEDs. So, each digit does the
by 4MHz. Because of being the long distance serial operation which lights up only in the 2ms every 12ms. When
transmission, MAX232 IC is used. controlling at this speed, at the eyes of the human being, it
In software implementation, the transmitter circuit is seems to light up continuously with the afterimage. The
controlled by using PIC16F877A microcontroller. In this control of the LED is done in order of each LED.
circuit, the program is written to display in the transmitter unit The key scan processing is continuously done by the LED
and then transmit the serial data to the receiver unit via RS232 control. The condition of one key is checked every time it
cable. Fig. 3 presents software flowchart of programming interrupts. The order of the checking is from SW1. Because
process for the transmitter unit. there are fifteen-keys in all, they need in the 30ms to check all
keys. A data transmission to the receiver unit is done by data
send process. This process is started by the transmission
buffer interruption by the TXIF bit of the PIR1 register. By
this way, the transmitter unit is designed.
B. Receiver Circuit Design
In the receiver circuit, it consists of two parts: hardware and
software implementation. The hardware implementation is
designed with one PIC16F877A microcontroller, one
MAX232, one 74LS154 decoder, one 7805 regulator, five
74LS273 latch registers, five large-sized seven-segment
LEDs, LED matrix, 2SA1015 transistors, 2SC1815
transistors, LEDs, 4MHz crystal, resistors and capacitors. The
seven-segment LEDs which use in this circuit are common
cathode type. The power of the receiver unit is supplied from
the transmitter unit. The male connector is used for the
receiver unit. Fig. 4 presents the circuit diagram of the
receiver unit of the remote token display system.
The display data is hold by latch register, 74LS273. One
74LS273 is used to control one seven-segment LED. A group
character is one character but is displayed by the LED matrix.
Because the direct control by PIC microcontroller is difficult,
a control signal is developed from the four-bit signal of PIC
microcontroller to the decoder IC. The character to display is
three kinds. The character is controlled by RB5, RB6 and RB7
of PIC. It decides a displaying character pattern in the LED
matrix and it decides the combination of these diodes every
LED. Because of being the long distance transmission,
Fig. 3 Software flowchart of programming process for MAX232 IC is used in this circuit. A transmission speed is
the transmitter unit calculated by 4MHz.

136
World Academy of Science, Engineering and Technology 39 2008

Fig. 4 Circuit diagram of the receiver unit

137
World Academy of Science, Engineering and Technology 39 2008

Software implementation is designed by using PIC16F877A unit. This process is started by the data receive interruption by
microcontroller. The receiving data from the transmitter unit the Receive Interrupt Flag (RCIF) bit of the PIR1 register. In
and displaying control of them are done by microcontroller. number information control and latch timing control, seven
Fig. 5 describes software flowchart of programming process segment display control is described. The counter is to decide
for the receiver unit. control contents. This counter is increased every two
milliseconds. By this way, the receiver unit is designed.
C. RS232 Interface
The RS232 interface is used as the connector between the
transmitter unit and receiver unit. RS232 cable for this circuit
is designed for serial transmission of data to 9600bps for a
distance of approximately 15m. The voltage of the RS232
cable (about ±9V) can be made only with +5V power. RS232
is the most known serial port used in transmitting the data in
communication and interface. RS232 is the communication
line which enables the data transmission by only using
through wire links. The data is transmitted serially. Serial
transmission is used for long distance communication.

Fig. 6 TTL/CMOS serial logic waveform

Fig. 6 shows TTL/CMOS serial logic waveform. The serial


data format is NRZ format, one start bit, eight data bit and one
stop bit. It was decided to use asynchronous serial
transmission from the PIC of the transmitter unit to the
receiver unit. When doing a data communication, the
condition of "0" and "1" to have let out from the side of the
sending it must be able to be recognized in the receiving side.
The RX port is used for receiving and the TX port is used for
the transmission.

III. CONSTRUCTION
The remote token display device consists of two parts: the
transmitter circuit and the receiver circuit. Two PIC16F877A
Fig. 5 Software flowchart of programming process for microcontrollers for overall remote token display system are
the receiver unit used by asynchronous communication functions to send data
to the receiver unit from the transmitter unit and the number of
When making the power ON of the PIC, the instruction is the I/O ports. MPLAB software is used for the PIC assembly
executed from zero address of the program memory. When programming. The PIC software is loaded onto the PIC before
there is interruption processing, processing is began for the any of the following tests are performed.
address four. The initialization processing is done after Firstly, PCB (Printed Circuit Board) layout is drawn for the
turning on. In Port mode initializing, the PORTB is used for transmitter circuit and then is constructed it. The transmitter
the group specification and the display digit specification for unit for the system is made up of several components. It
the seven-segment LED. In the interruption process, two kinds contains a PIC16F877A to handle input or output ports and
of interruptions are used. They are interruption by the time-out the out coming information from the transmitter unit. Fig. 7
of TMR0 and the interruption when the data is received. The shows its construction which controls a transmitter unit.
interruption of TMR0 is identified by the TOIF bit of the In this circuit, the IC sockets for the pin side of ICs are
INTCON register and the data receive interruption is mounted. There are wires which pass under the components.
identified by the RCIF bit. In this case, the wiring is done before mounting components.
As for the control of the group display, one row is done The step-down transformer is used to change from the AC
every time it interrupts in the two milliseconds. The data 220V to the 12V. Ten digit keys, three group keys, one send
receive process makes the data receiving from the transmitter key and one clear key are mounted in the order. In this circuit,

138
World Academy of Science, Engineering and Technology 39 2008

the first row is for SW1 to SW5 and the second row is for part which displays the character of the group. This is in the
SW6 to SW10 and the third row is for SW11 to SW15. So condition that the receiver unit is complete. After the
when connecting with the display receiver, confirmation by transmitter circuit and the receiver circuit have been
the circuit tester is needed. constructed completely, the RS232 cable with 15m length is
connected between them. In the next section, it is described
how to test this device successfully.

IV. TESTING AND RESULT


The following tests will allow an individual to determine if
the constraints of the design have been met. The tests consist
of a procedure for performing the test and the expected results
of the test. If the expected and measured values agree then the
design has met the constraints.
For transmitter unit section, the transmitter circuit is a small
sized simple circuit. The A, B and C characters are
represented by using red LED, white LED and green LED. A
selected group character is displayed only one LED. The input
red number 0 to 99999 using small-sized seven-segment LEDs
are counted with one of characters A, B and C.
When the user want to display the A character and the
number 73678, he must push SW7, SW3, SW6, SW7, SW8
and SW11 and then display at transmitter circuit. After that
this data is sent from the transmitter circuit to the receiver
circuit by using SW14.

Fig. 7 Transmitter circuit construction

Fig. 9 Measuring of transmit signal level by using oscilloscope

Fig. 9 shows the data transmitting signal waveform by


using an oscilloscope. This signal waveform is measured from
MAX232 output pin of the transmitter circuit. This voltage
level is -9V for the data that is sent to the receiver circuit.
RS232 cable is the communication line which enables the data
transmission by only using through wire links for a distance of
Fig. 8 Receiver circuit construction 15m.
For receiver unit test, the large sized receiver circuit can be
The Fig. 8 shows the receiver portion of the remote token used to inform the people from distance place. The supply
display system. As the transmitter circuit, PCB layout for the voltage of the receiver circuit is supplied from the transmitter
receiver circuit is drawn. Because the receiver circuit is large, circuit. Before the power supply is on, the data is not being
it is composed of more than one sheet of printed boards. In sent from the transmitter circuit to the receiver circuit. This
this circuit, there is much wiring. PIC16F877A is used for the signal level is measured from MAX232 IC input pin of the
receiver controller. The left side of the receiver display is the receiver unit. This voltage level is -9V for the data that is sent

139
World Academy of Science, Engineering and Technology 39 2008

from the transmitter unit. This information displays at the with 15m length is used in this system.
receiver circuit. The LEDs which are arranged like a matrix is In the future work, the other cables better than RS232 cable
used for the character display such as A to C. The digit can be used for more distance between two units. To extend
numbers such as 0 to 99999 is displayed by using five seven-segment LED for number displays, not only five digits
numbers of large-sized seven-segment LEDs using only red but also other more digits can be designed. To extend LED
color. matrix for group displays, not only A, B, C but also other
Transmitter displaying is clear when SW15 is pushed. But characters can be created.
displaying of receiver circuit continues. When the clear data
from transmitter circuit is sent by using SW14, the receiver ACKNOWLEDGMENT
displaying is clear, too. The user is ready to use this device for Firstly the authors would like to thank their parents for their
next choice. This is testing of the PIC based remote token best wishes to join the Ph.D research. The authors would like
display system successfully as shown in Fig. 10. to express the heart-felt gratitude to Dr. Maung Maung Latt
for his leadership and advice, U Clement Saldanha for
guidance in their research and Dr. Yin Mon Myint and Dr.
Nay Win Zaw for suggestions on how to design the remote
token display system. The authors greatly express their thanks
to all persons who will concern to support in preparing this
paper.

REFERENCES
[1] R.Boylestand, “Electronic Devices and Circuit Theory,” 5th ed.
[2] Leach and Malvino, “Digital Principles and Applications,” 5th ed.
McGraw-Hill Edition.
[3] E.G. Bylander, “Electronic Displays,” McGraw-Hill Edition, Inc., 1979.
[4] N.F.Tomasi, “Advanced Electronic Communications Systems,” 2nd ed,
Prentic Hall International, Inc., 1987.
[5] N.Matic, “PIC Microcontrollers,” 2000.
[6] “Microchip PIC16/17 Microcontroller Data Book,” Microchip
Technology Inc., 1996.
[7] http://www.piclist.com, 2004
[8] http://www.interq.jp.au, 2004
[9] http://www.maxim-ic.com, 2004
[10] http://www.datasheetarchive.com, 2004
[11] http://www.senet.com/au, 2005
[12] National Semiconductor, U.S.A. 1995

Fig.10 Testing of the remote token display device

V. CONCLUSION
At the conclusion of this research, the remote token display
system successfully works. This instrument performs the
display functions and operation counting of one group. This
system is designed for English language capital letters and
numbers. This research is not only applied for the educational
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 such as
clinic, bank, financial institutions, interviewing committees to
call the candidates and so on. This system can be widely used
in many fields that need to give information to partners. This
instrument is more account, easy and seen visual information
with digit system.
Its main limitations are its use of three alphabets such as A,
B, and C and five digit numbers from 0 to 99999. The cable

140

You might also like