Remote Token Display and Sound System

Transcription

1 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 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. Keywords PIC 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 Thave 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 Manuscript received November 2, 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: (Office,MTU), ( Fig. 1 Block diagram of remote token display and sound system 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

2 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

3 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

4 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

5 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, th, 1000 th 100 th, 10 th and 1 st 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 Fig. 7 Software flowchart for sound control process 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. 633

6 Fig. 9 Display circuit construction of receiver unit number 1,2,6,4,5 and SW11 for character A are pushed, 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 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 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 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 This system is made by using fifteen meters length RS232 cable between both units for display information of the transmitter. 634

7 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 (I 2 C) 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, [2] Microchip. PIC16F87XA Data Sheet Book, 28/40/44- Pin Enhanced Flash, Microchip Technology Inc., [3] Nashelsky, L. and Boylestad, R. L., Electronic Devices and Circuit Theory, 8 th ed., Prentice Hall, Inc., USA [4] Matic, N., PIC Microcontrollers, [5] Microchip PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers, Microchip Technology Inc., Leach and Malvino, Digital Principles and Applications, 5 th ed., McGraw-Hill Edition, [6] Stevens, A.L., Getting started with PIC microcontrollers, [7] Floyd, T.L., Electronic Devices I and II, 4 th ed., Prentice Hall International, Inc., (1996). [8] Nicholas, L.P., Digital Design, West Publishing Company, [9] Microchip PICStart Design Contest Application Brief Notebook, Microchip Technology Inc., [10] Wilkinson, B. and Makki, R., Digital System Design, Prentice Hall, International (UK) Ltd., [11] Bylander, E.G., Electronic Displays, McGraw-Hill Edition, Inc., [12] [13] hobby.com [14] [15] analog.com [16] datasheetcatalog.com [17] 635

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR INTRODUCTION This Project "Automatic Night Lamp with Morning Alarm" was developed using Microprocessor. It is the Heart of the system. The sensors

ETEC 421 - Digital Controls PIC Lab 10 Pulse Width Modulation Program Definition: Write a program to control the speed of a dc motor using pulse width modulation. Discussion: The speed of a dc motor is

Controlling a Dot Matrix LED Display with a Microcontroller By Matt Stabile and programming will be explained in general terms as well to allow for adaptation to any comparable microcontroller or LED matrix.

DESIGN AND IMPLEMENTATION OF A PIC MICROCONTROLLER BASED FIRING CONTROLLER FOR A TRIPHASE THYRISTOR RECTIFIER by Sohail Anwar sxa15@psu.edu Division of Business & Engineering Penn State University, Altoona

CHAPTER 11: Flip Flops In this chapter, you will be building the part of the circuit that controls the command sequencing. The required circuit must operate the counter and the memory chip. When the teach

April 2014 7 Serial Communications Objectives - To be familiar with the USART (RS-232) protocol. - To be able to transfer data from PIC-PC, PC-PIC and PIC-PIC. - To test serial communications with virtual

Matjaz Vidmar, S53MV A simple RF/Microwave frequency counter I decided to design a simple, easily reproducible counter around a PIC 16F876A. The basic counter range is extended to at least 180MHz using

K8048 PIC PROGRAMMER BOARD K8048 2003 Velleman Components Velleman Kits Welcome to the exciting world of Velleman Kits. Velleman Kit is known all over the world for our High Quality electronic kits. Our

VOR software receiver and decoder with dspic By Josef Stastny 9-15-2004-1 - 1. Introduction VOR (VHF Omni-directional Radio range) is a radio navigation system used for civil and military navigation of

PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional

Design And Implementation Of Bank Locker Security System Based On Sensing Circuit And RFID Reader Khaing Mar Htwe, Zaw Min Min Htun, Hla Myo Tun Abstract: The main goal of this system is to design a locker

Seven-Segment LED Displays Nicholas Neumann 11/19/2010 Abstract Seven-segment displays are electronic display devices used as an easy way to display decimal numerals and an alterative to the more complex

SPI Overview and Use of the PICmicro Serial Peripheral Interface In this presentation, we will look at what the Serial Peripheral Interface, otherwise known as the SPI, is, and how it is used to communicate

A PIC16F84 based CW Decoder The project in few words I propose a simple CW decoder wich makes use of a PIC16F84 microprocessor with a 16x2 chars LCD display. It is equipped with an audio frequency input

PIC MICROCONTROLLERS FOR DIGITAL FILTER IMPLEMENTATION There are many devices using which we can implement the digital filter hardware. Gone are the days where we still use discrete components to implement

Learning Objectives: Interfacing a Servo to the ATmega16 After successfully completing this lab, students will be able to: Desribe how a radio control (RC) servo works Interface a RC servo to a microcontroller

Design and Construction of Microcontroller- Based Telephone Exchange System Aye Sandar Win Abstract This paper demonstrates design and construction of microcontroller-based telephone exchange system and

Build This Garage Door Keypad By Reinhard Metz and David Wickliff No AC required - Self-powered from operator! More secure than commercial alternatives! Useful for other applications as well! In this article

Single-Phase Energy Meter Reference Platform Software High Level Design Specification Ver1.0 Note: This document may subject to change by Renesas Technology Singapore without prior notice. This is to record

MICROCONTROLLER BASED TEMPERATURE INDICATOR SUBMITTED BY: 1 INTRODUCTION The aim of this project is to design an ambient temperature measurement circuit. The motivation for doing this project is the fact

MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

CoE3DJ4 Digital Systems Design Chapter 4: Timer operation Timer There are two 16-bit timers each with four modes of operation Timers are used for (a) interval timing, (b) event counting or (c) baud rate

Design and Construction of Microcontroller- Based Telephone Exchange System Aye Sandar Win Abstract This paper demonstrates design and construction of microcontroller-based telephone exchange system and

Modification of an AOR AR-8600 receiver to tune it with a ACECO FC-3002 frequency finder Matthias DD1US updated June 2 nd 2011 Description of the ACECO FC-3002 unit: The ACECO FC-3002 is a handheld frequency

1 AC Watt Meter Project 2014-09-08 Danger (Only for the non mains isolated versions) Important Warning! Safety issue: All electrical parts of the meter are connected to the live mains supply. Do NOT touch

PICmicro tm Development Board Crownhill Associates smart electronic solutions Disclaimer In order to comply with EMC directive 89/336/EEC, this product should not be used outside of a classroom or laboratory

AVR415: RC5 IR Remote Control Transmitter Features Utilizes ATtiny28 Special HW Modulator and High Current Drive Pin Size Efficient Code, Leaves Room for Large User Code Low Power Consumption through Intensive

Microcontroller Code Example Explanation and Words of Wisdom For Senior Design For use with the following equipment: PIC16F877 QikStart Development Board ICD2 Debugger MPLAB Environment examplemain.c and

Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

Parallel IO Parallel IO data sent over a group of parallel wires. Typically, a clock is used for synchronization. D[15:0] clk Serial IO Serial IO data sent one bit at a time, over a single wire. A clock

Digital to Analog Conversion Using Pulse Width Modulation Samer El-Haj-Mahmoud Electronics Engineering Technology Program Texas A&M University Instructor s Portion Summary The purpose of this lab is to

Laser Merge Module Document # SU-256521-09 Rev A The information presented in this document is proprietary to Spectral Applied Research Inc. and cannot be used for any purpose other than that for which

EXERCISE 3: String Variables and ASCII Code EXERCISE OBJECTIVE When you have completed this exercise, you will be able to describe the use of string variable and ASCII code. You will use Flowcode and the

K8048 PIC PROGRAMMER BOARD Velleman Kits Welcome to the exciting world of Velleman Kits. Velleman Kit is known all over the world for our High Quality electronic kits. Our range goes from easy to build