PROPELLER LED DISPLAY AJMAL BlN MUHAMAD SAZALI This Report Is Submitted In Partial Fulfillment of Requirements for the Bachelor of Electronic Engineering (Industrial Electronic) with honours. Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer Universiti Teknikal Malaysia Melaka April 2007 vii ABSTRACT Conventional methods of displaying images to public are using LCD display and dot-matrix LED board. Propeller LED display is a device that project an image or time as if the images are floating in the air. The floating image is received because of human eye limitation. Actually the floating images emerge by synchronizing LED'S blink to form an image at particular time and rate. The programming of PIC is using Assembly Language. This project consist two main circuit; motor controller circuit and LED circuit. 9VDC will be used to supply the power for motor controller circuit. Then the motor controller circuit will provides power to LED circuit and DC motor. When DC motor is rotating, the floating image will appear. The synchronization of DC motor speed and LED blink cause the image visible to human eyes. So the desired image such as clock, date or symbol can be programmed and displayed. ABSTRAK Antara kaedah konvensional untuk memaparkan imej adalah menggunakan papan LCD dan papan LED dot-matrik. Paparan Berputar LED adalah alat untuk menayangkan imej atau masa seolah-olah imej tersebut terapung di udara. Imej yang terbentuk ini dapat diterima kerana batasan mata manusia. Sebenarnya, imej ini timbul kerana keselarian kerlipan LED untuk membentuk imej pada masa dan kadar yang khusus. Bahasa pengaturcara Assembly digunakan untuk diprogramkan kedalam PIC. Projek ini terbahagi kepada dua litar utama, iaitu litar pengawal litar motor dan litar LED. 9VDC digunakan untuk membekalkan voltan kepada litar pengawal motor. Apabila motor DC berpusing, imej yang terapung akan terhasil. Keselarian di antara kelajuan motor DC dan kelipan LED akan mengakibatkan imej yang nyata untuk dilihat oleh mata manusia. Oleh itu, imej seperti jam, tarikh dan simbol boleh diprogramkan dan dipaparkan. CHAPTER I INTRODUCTION 1.1 PROJECT SYNOPSIS Nowadays, there are so many way to displaying a message such as using 7 segment, Frosted Light Bar (RGB 16.7 millions true colows), digital clock and etc. These kind of device are used to advertise or displaying some sort of message in order to attract people. It is different than a conventional method such as poster, banner and etc. These projects are cheaper, easier and even carry out the same purpose as any display apparatus. 1.2 PROBLEM STATEMENTS From other article and project, there are some problems which are effected the outcome of the image displayed. The main problem is concerning the motor. A VCR motor has to be used as a motor in order to prevent noise. The circuit also have to use photo transistor to generate precise index pulse. In order to display the date and clock, the circuit must have memory capacitor to keep the clock ticking even when the power is not supplied to the circuit. The memory capacitor is expensive plus, it bigger and heavy. To replace the memory capacitor, a small, cheap and light 3V lithium battery is used as a replacement. A voltage regulator also has to be used in order to allow rotation speed change without effecting the circuit and displayed images. 1.3 OBJECTIVES The objectives of this project are: i. To design a display system using LEDs which rotate on a motor. ii. To design a program using Assembly language. iii. To display clock, date and symbol using LEDs. iv. To develop software that can generate LEDs display with accurate synchronization and timing. 1.4 SCOPES OF PROJECT The scopes of this project are: i. The circuit is mounted on DC motor. ii. LED'S are used to display clock, date and symbol. ... 111. PICF84A is used to control and transmit the signal and utilizing the Assembly language. 1.5 CHAPTER SUMMARY CHAPTER I will describe the definition of this project will be explained in this chapter. Also in this chapter there will be summary the project progress. CHAPTER I1 will discuss about research and information which are related to this project. Every fact and information are gained from different references will be discussed so that the best technique and method can be implemented on this project. CHAPTER I11 will be describing how this project is separated to small partition. The elements which are used to build each circuit are described by concept and theory. Plus, figures are provided to ensure the understanding. CHAPTER IV is describing about the project result and outcome discovery. The project outcome discovery will be presented from the many data analysis results. The final chapter, CHAPTER V will be explaining about the conclusion of the whole project which includes project finding, achievement analysis and conclusion about the research implementation which have been used. The project suggestion for enhancement also discussed. CHAPTER I1 LITERATURE REVIEW 2.1 INTRODUCTION This chapter is all about discussing the theory and concept from the past projects. The objective is to explain the perspective and method which has been used in the past projects and to observe how this project can be related with existing research and theory. This shows how the theory and concept have been implemented in order to solve project problem. The theory understanding is crucial as a guidance to start any project. The result of a project cannot be assessed if it's not compared to the theory. 2.2 HENK'S PROPELLER CLOCK ON A MIRROR PROJECT Figure 2.1 : Displaying Clock And Date. The LEDs turn on and turn off, one after another, very rapidly. Due to the slow response of the human eye, the impression that the lights are on all together is obtained and the display can be read. Scanning in this clock is mechanically. A limited number of LEDs are placed in a row and attached to a rotating arm. The arm spins at 1500rpm (or more) and the LEDs are turned on and off at very precise times and places. This gives the impression that there are several hundred LEDs making up a complete display. The fact that the arm is spinning at 1500rpm the LEDs, the electronics and the arm itself are hardly visible. The visible things are the lighted dots from the LEDs making a readable display that seems to float. Depending on the form of the arm, the display is either a cylinder or a disc. The cylinder shaped display can only show digits. With the disc shaped display it is also possible to simulate analog hands. The electronics is used to drive the LEDs and to keep time are located on the rotating arm. Early versions used buttons on this arm. Other designs use a reed-switch that can be actuated by holding a magnet near the rotating arm. Chester Lowrey's Propeller Clock using one visible light, one infrared, to create a two-button system. This made settings the time a lot easier. But Henk wanted to display time and date. To set time and date with just two buttons would not be very efficient. So an infrared sensor is connected to the CPU and programmed it to decode signals from a remote control. This opened up a lot more possibilities. The remote can be used to set time and date. It can also be used to set different display modes. The successful project is shown in Figure 2.1. 2.3 BOB BLICK'S PROPELLER CLOCK PROJECT Figure 2.2: Seven Light Emitting Diodes Spin. Bob Blick made the clock spinning on a piece of perfboard. The power is provided from the spinning armature of a plain DC motor. In order to run the wires out of the motor, the bearing is removed from one end of the motor, leaving a big hole. There are three terminals inside most small DC motors, and it acts a lot like three-phase alternating current, so it must be rectified back to DC. A nice side effect of this is that the position of the motor can be detected by taking one of the phases straight into the microprocessor. Bob Blick used perfboard (Vectorboard) and handwired the circuit together. Use an 18-pin socket for the 16C84 is used because it needs to be programmed before putting it in the circuit. For the 7 current-limit resistors a DIP resistor array is used, because it made it easy to experiment with LED brightness. He settled on 120 ohms. Seven regular resistors also can be used, because 120 ohms works fine, though it puts the peak current right at the limit for the 16C84. To keep the clock running after turning it off a 47000uf is used, so the time can be set. The LED'S gets power separate from this circuit. The result is shown in Figure 2.2. CHAPTER I11 PROJECT METHODOLOGY 3.1 INTRODUCTION This project consist two different circuits. There are motor controller circuit and LED circuit. At early stage, circuit designs are being done. After that, using a software called 'Proteus-ISIS', both circuit simulation are implemented. After the simulation process is proceeded, both circuit will be designed to be printed in PCB board using 'Proteus-ARES'. Next, circuit construction and testing are using multimeter. If the circuit malfunction, designing and modifying circuit process has to be done to ensure both circuits working properly. The programming language design process is using MPLAB-IDE. Finally after the programming is finished, the program is burned into PICF84A using WinPic800. 3.2 BLOCK DIAGRAM LED Circuit PIC LED A 9v A A 4 Motor + Controller Circuit DC Motor - Motor Shaft - Figure 3.2: Block Diagram of Propeller LED Display From the Figure 3.2, the 9V DC is supplied to Motor Controller Circuit. Motor Controller circuit is controlling the DC motor speed and the speed is adjustable. In order to rotate the circuit, DC motor is used. PIC microcontroller purposed is to execute the program and transmit the signal to LED. As output, a line of LED is used to transmit the desired signal. In order to display the images, DC motor will rotate the circuit board. If the displayed image is not clear, the DC motor speed is adjusted until the displayed image is visible. 3.3 ACTIVITY FLOW CHART With the aim of completing this project on time, all activities have been planned as shown in the activity flow chart with the intention that everything is completed step by step. Discussing the scope Literature research Circuit Design Simulation 1 Construct Circuit PIC Programming No Finalized PCB Figure 3.3: Project Activities Flow Chart 3.4 COMPONENT AND SOFTWARE EXPLANATION The PIC16F84A is a high-performance, low-cost, CMOS, fully-static 8-bit microcontroller with 1K x 14 EEPROM program memory and 64 bytes of EEPROM data memory. It is the second member of an enhanced family of PICl6CXX microcontrollers. Its high performance is due to instructions that are all single word (14-bit wide), which execute in single cycle (400 ns at lOMHz clock) except for programbranches which take tow cycles (800ns). The PIC16C84 has four interrupt sources and an eight level hardware stack. The peripherals include an 8-bit timerlcounter with an 8- bit prescaler (effectively a 16 bit timer) and 13 bi- directional I10 pins. The high current drive (25 mA max. sink, 20 mA max source) of the I10 pins help reduce external drivers and therefore, system cost. The PIC16C84 product is supported by an assembler, an in-circuit emulator and a production quality programmer. These tools are supported on the IBM PC and compatible machines. 3.4.1.1 Peripheral Features 13 110 pins with individual direction control High current sinklsource for direct LED drive 25 mA sink max. per pin 20 mA source max. per pin 8-bit real time clock/counter (RTCC) with 8-bit programmable prescaler Special Microcontroller Features - Power-on reset - Power up timer - Oscillator start-up timer - Watchdog timer (WDT) with its own on-chip RC oscillator for reliable operation - Security EPROM fuse for code-protection - Power saving SLEEP mode - User selectable oscillator options: RC oscillator: RC Crystallresonator: XT High speed crystallresonator: HS Power saving low frequency crystal: LP - Serial, In-System Programming (ISP) of EPROM program memory using only two pins 3.4.1.2 Pin Diagram of PIC16F84A - POIF, SOIC RAZ R83 WPaMCICKI MCLR vs flmm ma R52 WB3 - The PIC16F84A belongs to the mid-range family of the PICmicroB microcontroller devices. A block diagram of the device is shown in Figure 3.4. Figure 3.4: PIC 16F84A Block Diagram. 3.4.2 MOTOR Motors come in many sizes and types, but their basic function is the same. Motors of all types serve to convert electrical energy into mechanical energy. They can be found in VCR's, elevators, CD players, toys, robots, watches, automobiles, subway trains, fans, space ships, air conditioners, refrigerators, and many other places. The performance of the motor is very important in circuit design. This is because the electrics motors directly affect its speed and pushing capability. Motor performance information is needed to select the required speed. The current requirements from the motor will dictate what type and size batteries will need and they are also a factor in determining the minimum current requirements for motor speed controllers. 3.4.2.1 DC Motor DC motors seem quite simple. Apply a voltage to both terminals, and it will spins. DC motors are non-polarized which means that it can reverse voltage so the motor will rotate in two directions, forward and backward. Typical DC motors are rated from about 6V-12V. The larger ones are often 24V or more but for the purpose of this project, it is necessary to use 6V-12V range motor. Voltage is directly related to motor torque. The more voltage supplied, the higher the torque will be produce. Specifications of most DC motors show high revolutions per minute (rpm) and low torque. The DC motor is popular in a number of drive applications due to its simple operation and control. By referring Figure 3.5, it has 2 main parts which is rotor and stator. Stator is the part where the permanent magnet situated and used to generate the magnetic field and it is static. Rotor is the rotary part in the motor and contains block of core and wire loops. It also called the armature. Figure 3.5: DC Motor The rotor is placed inside the magnetic field caused by two permanent magnets. By referring to the situation that shown in Figure 3.6, both sides of the wire loop will have a force on them. trying to make the wire loop rotate. The current is applied to the loop through the commutator, which is shown as two pieces of metal formed into a ring in the figure. Current is applied to the commutator by stationary graphite blocks, called brushes, which rub against the commutator ring. The loop will continue to rotate anticlockwise until it is vertical. At this point, the stationary brushes won't be applying current around the loop any more because they will be contacting the gap between the commutator segments, but the inertia of the loop keeps it going a little more, until the DC supply reconnects to the commutator segments, and the current then goes around the loop in the opposite direction. The force though is still in the same direction. and the loop continues to rotate. Figure 3.6: The Operation of DC Motor 3.4.2.2 DC Motor Voltage DC motors are non-polarized - meaning that one can reverse voltage without any bad things happening. Typical DC motors are rated from about 6V-12V. The larger ones are often 24V or more. But for the purposes of this project, do stay in the 6V-12V range. It is stated that voltage is directly related to motor torque. High voltage produces higher torque. A DC motor is rated at the voltage it is most efficient at running. If very few volts are applied, it just won't work. If too much is applied, it will overheat and the coils will melt. So the general rule is to apply as close to the rated voltage of the motor. But do not surpass 12V motors unless the torque is required badly. 3.4.2.3 DC Motor Current As with all circuitry, one must pay attention to current. Too little, and it just won't work. Too much, the motor will meltdown. When buying a motor, there are two current ratings one should pay attention to. The first is operating current. This is the average amount of current the motor is expected to draw under a typical torque. Multiply this number by the rated voltage and the average power draw required to run the motor is obtained. The other current rating which one needs to pay attention to is the stall current. This is when the motor is power up, and enough torque is put to force it to stop rotating. This is the maximum amount of current the motor will ever draw, and hence the maximum amount of power too. So, one must design all control circuitry capable of handling this stall current. Also, if the motor is constantly run, or run it higher than the rated voltage, it is wise to heat sink to keep the motor's coils from melting. 3.4.2.4 DC Motor Power Rating Basically, all motors are rated at certain wattage. Wattage is energy. Inefficiency of energy conversion directly relates to heat output. Too much heat, the motor coils melt. So the manufacturers of motors know how much wattage will cause motor failure, and post this on the motor specification sheets. The equation is: Power (watts) = Voltage * Current Increase voltage and measure current until the power is about -90% below the given power rating. 3.4.2.5 DC Motor Torque Torque is defined as that force which tends to produce and maintain rotation. The function of torque in a DC motor is to provide the mechanical output or drive the piece of equipment that the DC motor is attached to. There are two torque value ratings which must been pay attention to. The first is the operating torque. This is the torque the motor was designed to give. Usually it is the listed torque value. The other rated value is stall torque. This is the torque required to stop the motor from rotating. he torque which is developed by the motor can be determined using Equation: T = KQI, where T = torque K =a Q = field 1, = armature constant depending on physical size of motor flux, number of lines of force per pole current When buying a DC motor, there are two torque value ratings which must be Pay attention to. The first is operating torque. This is the torque the motor was designed to give. Usually it is the listed torque value. The other rated value is stall torque. This is the torque required to stop the motor from rotating. If one need a little more speed, going 20% above the rated motor voltage value is fairly safe. But, that this is less efficient, and the motor should be heatsinked. 3.4.2.6 Velocity Velocity is very complex when it comes to DC motors. The general rule is motors run the most efficient when run at the highest possible speeds. Obviously however this is not possible. There are times to run the motor slowly. Just like car, it won't to keep the car constantly at high speed. The voltage and applied torque resistance obviously also affects speed. Instead using a Multisim as a simulator, Proteus-ISIS is used. Proteus-ISIS is suitable to simulate a circuit which consist PIC or motor. It can simulate the blinking LED and the rotating motor as shown in Figure 3.7. The analyses are done from this software which is very useful to verify the circuit. Figure 3.7: Layout of Proteus-ISIS. Proteus-ARES is used to design the PCB board. Using this software, a user has to know the scale of the product because in ARES, there's no scale indicator. So a user has to well familiar with proto board and component size. The layout of Proteus-ARES is shown in Figure 3.8. Figure 3.8: Layout of Proteus-ARES. 3.4.5 MPLAB IDE MPLAB IDE is software to construct and compile the programming language as shown in Figure 3.9. This software is crucial to verify the programming language. If there's error while compiling, the program can't be burned into PIC. mv, II'lP' H'le' H ' l l S U'l?' erd H'13' J C'IW R c p a-7 Em1 H ' U L ' c8y H ' Z . 9 ' rqu H ' Z 3 ' T c,*2111Z3' r->HIZI~' n8rn7nnnnn4 tris ink15 -VIW ImVlW t:'LULUUl-1' DPTIOF 'lU"1" B'CoLooUOU' ip,::::::: clrf ronz5' clrf ?2IDC hcf r K r - m , TTE h s f KhTJIN. 511 Figure 3.9: Layout of MPLAB IDE. WinPic800 is used to burn the complete program language into PIC. WinPic800 are capable to burn a complete programming language such as Assembly, C++, Visual Basic, C and etc. All the programming language will be converted to Hex file before burning into PIC. WinPic800 layout is shown in Figure 3.10. Figure 3.10: Layout of WinPic800. 3.4.7 ASSEMBLY LANGUAGE An assembly language is a low-level language used in the writing of computer programs. Assembly language uses mnemonics, abbreviations or words that make it easier to remember a complex instruction and make programming in assembly an easier task. The goal of using mnemonics in the writing of assembly language programs is to replace the more error prone, and time consuming, effort of directly programming in a target computer's numeric machine code that had been used with the very first computers. An assembly language program is translated into the target computer's machine code by a utility program called an assembler. The assembler performs a (more or less) one-to-one (isomorphic) translation from mnemonic statements into machine instructions and data. The purpose is to free the Programmer from tedious tasks such as remembering codes, calculating addresses and offsets, as well as various other constants, while still retaining full control over the machine. On the other hand, a translator that takes a program written in a high-level language and translates it to an equivalent executable machine code (andlor assembly code) is called a compiler. A "translator" that directly execute (i.e. perform) the sequence of declarations and actions in a written (high or low-level) program is called an interpreter. Assembly language programs are tightly coupled with (and specific to) a target computer architecture - as opposed to higher-level programming languages, u-hich are generally platform-independent. More sophisticated assemblers extend the basic translation of program instructions with mechanisms to facilitate program development, control the assembly process, and aid debugging. Assembly language was once widely used for all aspects of programming, but today it tends to be used more narrowly, primarily when direct hardware manipulation or unusual performance issues are involved. Typical uses are device drivers, low-level embedded systems, and real-time systems. These applications benefit from the increased speed of processing assembly program instructions. The programming flow chart is shown in Figure 3.1 1. When the program started, it will go to "Displaying Message 1". After that it will go to "Count 50 cycle". If the cycle doesn't count finish till 50, it will loop back to "Displaying Message 1". If it does, it will proceed to the next process. When this process finished the final block, it will start again at "Displaying Message 1". This process continues until the power is off.