Thursday 12 January 2012

dc motor controller


A
PROJECT REPORT
ON
“WIRELESS  SPEED CONTROLING OF DC MOTOR USING IR”
SUBMITED TO
RAJASTHAN TECH. UNIVERSITY KOTA
In partial fulfillment for the award of degree of
Bachelor of Technology
In
ELECTRICAL ENGINEERING

GUIDED BY:-                                                                                          SUBMITTED BY:- 
 Mr.Anil Kumar.  (Lect.)                                                              AJIT( 07ELDEE001)                                                                                                                                                                 Dept. of Elec.Engg.                                                                AMAN Sharma(0 8ELDEE203)   LIET    AlWAR                                                                              NAVEEN Yadav(08ELDEE205)
ACADEMIC SESSION 2010-2011
LAXMI DEVI INSTITUTE OF ENGINEERING & TECHNOLOGY
ALWAR 301001

CERTIFICATE
This is to certify that the project entitled WIRE LESS SPEED CONTROLIN OF
DC MOTOR  USING IR”   is being submitted by MR.AJIT ,Mr. A MAN SARMA
And MR.NAVEEN YADAV student of final year ,viii semester ,B.TECH.
Electrical Department , Laxmi Devi Institute of Engineering and Technology,
Alwar  ,is being an original and genuine work of the student and has not being
Submitted elsewhere for the award of any degree.

PROJECT GUIDE                                                        PROJECT COORDINATOR
Mr.Anil Kumar                                                              Mr. Balram Kasnia
 lecturer                                                                         lecturer
Deptt. Of Elec.  Engg.                                                  Deptt. Of Elec. Engg.
LIET                                                                             LIET

 Laxmi Devi Institute of Engineering & Tech.
Alwar –Tijara –Highway,chikani Alwar -301001
ACKNOWLEDGEMENT
Project work done in the engineering curriculum is a great opportunity to implement the theoretical knowledge gained during the course of study. But without good guidance this easy task seems to be incomprehensible.
 With this note, we express our sincere thanks to our Project coordinator      Mr. Balram Kasnia Lecturer for providing us an opportunity to do the project, and our Project Guide Mr. Anil Kumar Lecturer. He has been a great support throughout the work. For successful completion of this project.

                               Team Members:-
                                      Ajit.(07ELDEE001)
                                                 Aman Sharma.(08ELDEE203)
                                                 Naveen Yadav.(08ELDEE205)











PREFACE
The objective of this project is to provide an efficient and simple speed controlling of a DC motor  automatically . In order to achieve this objective we make the study of
   Various type of dc motor speed controller on the basis of their charactericts ,working and construction basis .By taking the study of these type of speed controller we achieve the goal. By removing there draw back and making there modification . As this approach is easily understood by  the user . In addition to this approach  the report of this project provide a deep insight of each and every component.
Before this approach we have use speed controlling  by using the method Armature resistance control ,field flux control and Armature terminal voltage control these method  have various disadvantage like armature resistance have high voltage drop to remove these disadvantage we have to use wireless speed control using armature terminal voltage control .This approach provide simple handling to the user.             


















INDEX
  1. Introduction…………..…………………….   6
  2. Types of DC motor……………………….…7
2.1  Brusshed DC motor……………………..7
2.2  Brushless DC motor…………………….8-9
  1. Speed Control of DC Motor………………...10-11
  2. Types of sped control……………………….12
4.1  Armature voltage control………………..13-14
4.1.1      Ward leonard system
4.1.2      Control rectrifier circuit
4.1.3      Series parallel armature voltage control
4.2  Field flux control………………………….15
4.3  Armature resistance control…………..…16
  1. Wireless speed control of DC moto…………17
5.1  DC motor
5.2  Electronic component……………….……18-29
5.3  PIC controller circuit………………………30-44
5.4  Reciever circuit…………………………....45-52
5.5  Transmitter circuit……………………..…..53-57
5.6  H-bridge……………………………...……..58-60
5.7  LCD display…………………………….…..61-66
5.8  Supply ……………………………..……….67-68
  1. Reference……………………………………….69





INTRODUCTION
1.DC motor
Direct current (DC) motors have been widely used in many industrial applications such as electric vehicles, steel rolling mills, electric cranes, and robotic manipulators due to precise, wide, simple and continuous control characteristics.
 the d.c. machines were invented during the second half of the 19th century. The initial pace of development work was phenomenal. The best configurations stood all the competition and the test of time and were adopted. Less effective options were discarded. The present day d.c. generator contains most, if not all, of the features of the machine developed over a century earlier. To appreciate the working and the characteristics of these machines, it is necessary to know about the different parts of the machine – both electrical and non-electrical. The description would also aid the understanding of the reason  for selecting one form of construction or the other..














Exploded view of D.C.Machine

The major parts can be identified as,
1. Body
2. Poles
3. Armature
4. Commutator and brush gear
5. Commutating poles
6. Compensating winding
7. Other mechanical parts


2. Types of dc motor:-
2.1            Brushed DC motors:-
                                                 Workings of a brushed electric motor DC motor design generates an oscillating current in a wound rotor, or armature, with a split ring commutator, and either a wound or permanent magnet stator. A rotor consists of one or more coils of wire wound around a core on a shaft; an electrical power source is connected to the rotor coil through the commutator and its brushes, causing current to flow in it, producing electromagnetism. The commutator causes the current in the coils to be switched as the rotor turns, keeping the magnetic poles of the rotor from ever fully aligning with the magnetic poles of the stator field, so that the rotor never stops (like a compass needle does) but rather keeps rotating indefinitely (as long as power is applied and is sufficient for the motor to overcome the shaft torque load and internal losses due to friction, etc.)
Many of the limitations of the classic commutator DC motor are due to the need for brushes to press against the commutator. This creates friction. Sparks are created by the brushes making and breaking circuits through the rotor coils as the brushes cross the insulating gaps between commutator sections. Depending on the commutator design, this may include the brushes shorting together adjacent sections—and hence coil ends—momentarily while crossing the gaps. Furthermore, the inductance of the rotor coils causes the voltage across each to rise when its circuit is opened, increasing the sparking of the brushes. This sparking limits the maximum speed of the machine, as too-rapid sparking will overheat, erode, or even melt the commutator. The current density per unit area of the brushes, in combination with their resistivity, limits the output of the motor. The making and breaking of electric contact also causes electrical noise, and the sparks additionally cause RFI. Brushes eventually wear out and require replacement, and the commutator itself is subject to wear and maintenance (on larger motors) or replacement (on small motors). The commutator assembly on a large motor is a costly element, requiring precision assembly of many parts. On small motors, the commutator is usually permanently integrated into the rotor, so replacing it usually requires replacing the whole rotor.
Large brushes are desired for a larger brush contact area to maximize motor output, but small brushes are desired for low mass to maximize the speed at which the motor can run without the brushes excessively bouncing and sparking (comparable to the problem of "valve float" in internal combustion engines). (Small brushes are also desirable for lower cost.) Stiffer brush springs can also be used to make brushes of a given mass work at a higher speed, but at the cost of greater friction losses (lower efficiency) and accelerated brush and commutator wear. Therefore, DC motor brush design entails a trade-off between output power, speed, and efficiency/wear.

A: shunt
B: series
C: compound
f = field coil
There are five types of brushed DC motor:
  • DC shunt-wound motor
  • DC series-wound motor
  • DC compound motor (two configurations):
    • Cumulative compound
    • Differentially compounded
  • Permanent magnet DC motor
  • Separately excited
2.2            Brushless DC motors:-
Some of the problems of the brushed DC motor are eliminated in the brushless design. In this motor, the mechanical "rotating switch" or commutator/brushgear assembly is replaced by an external electronic switch synchronised to the rotor's position. Brushless motors are typically 85–90% efficient or more (higher efficiency for a brushless electric motor of up to 96.5% were reported by researchers at the Tokai University in Japan in 2009),[17] whereas DC motors with brushgear are typically 75–80% efficient.
Midway between ordinary DC motors and stepper motors lies the realm of the brushless DC motor. Built in a fashion very similar to stepper motors, these often use a permanent magnet external rotor, three phases of driving coils, may use Hall effect sensors to sense the position of the rotor, and associated drive electronics. The coils are activated, one phase after the other, by the drive electronics as cued by the signals from either Hall effect sensors or from the back EMF (electromotive force) of the undriven coils. In effect, they act as three-phase synchronous motors containing their own variable-frequency drive electronics. A specialized class of brushless DC motor controllers utilize EMF feedback through the main phase connections instead of Hall effect sensors to determine position and velocity. These motors are used extensively in electric radio-controlled vehicles. When configured with the magnets on the outside, these are referred to by modelers as outrunner motors.
Brushless DC motors are commonly used where precise speed control is necessary, as in computer disk drives or in video cassette recorders, the spindles within CD, CD-ROM (etc.) drives, and mechanisms within office products such as fans, laser printers and photocopiers. They have several advantages over conventional motors:
  • Compared to AC fans using shaded-pole motors, they are very efficient, running much cooler than the equivalent AC motors. This cool operation leads to much-improved life of the fan's bearings.
  • Without a commutator to wear out, the life of a DC brushless motor can be significantly longer compared to a DC motor using brushes and a commutator. Commutation also tends to cause a great deal of electrical and RF noise; without a commutator or brushes, a brushless motor may be used in electrically sensitive devices like audio equipment or computers.
  • The same Hall effect sensors that provide the commutation can also provide a convenient tachometer signal for closed-loop control (servo-controlled) applications. In fans, the tachometer signal can be used to derive a "fan OK" signal.
  • The motor can be easily synchronized to an internal or external clock, leading to precise speed control.
  • Brushless motors have no chance of sparking, unlike brushed motors, making them better suited to environments with volatile chemicals and fuels. Also, sparking generates ozone which can accumulate in poorly ventilated buildings risking harm to occupants' health.
  • Brushless motors are usually used in small equipment such as computers and are generally used to get rid of unwanted heat.
  • They are also very quiet motors which is an advantage if being used in equipment that is affected by vibrations.
Modern DC brushless motors range in power from a fraction of a watt to many kilowatts. Larger brushless motors up to about 100 kW rating are used in electric vehicles. They also find significant use in high-performance electric model aircraft.





















                                3. Speed control of dc motor:-      
Generally, the rotational speed of a DC motor is proportional to the voltage applied to it, and the torque is proportional to the current. Speed control can be achieved by variable battery tappings, variable supply voltage, resistors or electronic controls. The direction of a wound field DC motor can be changed by reversing either the field or armature connections but not both. This is commonly done with a special set of contactors (direction contactors).
The effective voltage can be varied by inserting a series resistor or by an electronically controlled switching device made of thyristors, transistors, or, formerly, mercury arc rectifiers.[4]
In a circuit known as a chopper, the average voltage applied to the motor is varied by switching the supply voltage very rapidly. As the "on" to "off" ratio is varied to alter the average applied voltage, the speed of the motor varies. The percentage "on" time multiplied by the supply voltage gives the average voltage applied to the motor. Therefore, with a 100 V supply and a 25% "on" time, the average voltage at the motor will be 25 V. During the "off" time, the armature's inductance causes the current to continue through a diode called a "flyback diode", in parallel with the motor. At this point in the cycle, the supply current will be zero, and therefore the average motor current will always be higher than the supply current unless the percentage "on" time is 100%. At 100% "on" time, the supply and motor current are equal. The rapid switching wastes less energy than series resistors. This method is also called pulse-width modulation (PWM) and is often controlled by a microprocessor. An output filter is sometimes installed to smooth the average voltage applied to the motor and reduce motor noise.
Since the series-wound DC motor develops its highest torque at low speed, it is often used in traction applications such as electric locomotives, and trams. Another application is starter motors for petrol and small diesel engines. Series motors must never be used in applications where the drive can fail (such as belt drives). As the motor accelerates, the armature (and hence field) current reduces. The reduction in field causes the motor to speed up until it destroys itself. This can also be a problem with railway motors in the event of a loss of adhesion since, unless quickly brought under control, the motors can reach speeds far higher than they would do under normal circumstances. This can not only cause problems for the motors themselves and the gears, but due to the differential speed between the rails and the wheels it can also cause serious damage to the rails and wheel treads as they heat and cool rapidly. Field weakening is used in some electronic controls to increase the top speed of an electric vehicle. The simplest form uses a contactor and field-weakening resistor; the electronic control monitors the motor current and switches the field weakening resistor into circuit when the motor current reduces below a preset value (this will be when the motor is at its full design speed). Once the resistor is in circuit, the motor will increase speed above its normal speed at its rated voltage. When motor current increases, the control will disconnect the resistor and low speed torque is made available.
One interesting method of speed control of a DC motor is the Ward Leonard control. It is a method of controlling a DC motor (usually a shunt or compound wound) and was developed as a method of providing a speed-controlled motor from an AC supply, though it is not without its advantages in DC schemes. The AC supply is used to drive an AC motor, usually an induction motor that drives a DC generator or dynamo. The DC output from the armature is directly connected to the armature of the DC motor (sometimes but not always of identical construction). The shunt field windings of both DC machines are independently excited through variable resistors. Extremely good speed control from standstill to full speed, and consistent torque, can be obtained by varying the generator and/or motor field current. This method of control was the de facto method from its development until it was superseded by solid state thyristor systems. It found service in almost any environment where good speed control was required, from passenger lifts through to large mine pit head winding gear and even industrial process machinery and electric cranes. Its principal disadvantage was that three machines were required to implement a scheme (five in very large installations, as the DC machines were often duplicated and controlled by a tandem variable resistor). In many applications, the motor-generator set was often left permanently running, to avoid the delays that would otherwise be caused by starting it up as required. Although electronic (thyristor) controllers have replaced most small to medium Ward-Leonard systems, some very large ones (thousands of horsepower) remain in service. The field currents are much lower than the armature currents, allowing a moderate sized thyristor unit to control a much larger motor than it could control directly. For example, in one installation, a 300 amp thyristor unit controls the field of the generator. The generator output current is in excess of 15,000 amperes, which would be prohibitively expensive (and inefficient) to control directly with thyristors.
















4.Types of speed controlling:-
      4.1.Armature voltage control.
                     4.1.1 ward leonard system.
                     4.1.2 controlled rectifier circuit.
                     4.1.3 series parallel armature voltage control.
      4.2.Field flux control.
      4.3.Armature resistance control.   

















4.1Armature voltage control:-
In this method, shunt-field current is maintained constant from a separate source while the voltage applied to the armature is varied. Dc motors feature a speed, which is proportional to the counter emf. This is equal to the applied voltage minus the armature circuit IR drop. At rated current, the torque remains constant regardless of the dc motor speed (since the magnetic flux is constant) and, therefore, the dc motor has constant torque capability over its speed range.
Horsepower varies directly with speed. Actually, as the speed of a self-ventilated motor is lowered, it loses ventilation and cannot be loaded with quite as much armature current without exceeding the rated temperature rise.
Types of armature voltage control:-
4.1.1.Ward-Leonard system.
4.1.2.Controlled rectifier circuit.
4.1.3.Series-parallel armature voltage control.

                                4.1.1 Ward-Leonard system:-
As a very flexible, reliable means of motor speed control, the Ward Leonard System is unmatched.
The system is made up of a driving motor which runs at almost constant speed and powers a dc generator as shown in the diagram. The generator output is fed to a dc motor. By varying the generator field current, its output voltage will change. The speed of the controlled motor thus can be varied smoothly from zero to full speed. 

Since control is achieved through the generator shunt field current, the control equipment is required only for small current values. A potentiometer or rheostat in the generator field circuit enables he variation of output voltage from zero to the full value and also in either direction. The controlled motor has a constant excitation. Its speed and direction are thus determined by the generator output. 
2.Controlled rectifier circuit
The concept of the four operating quadrants is illustrated below. It shows the four possible operating states of any drive system and shows the directions of VD and ID for the DC motor drive application. To operate in quadrants 3 and 2, it must be possible to reverse the direction of ID. This type of converter is known as a four-quadrant DC converter, and is sometimes called a double or back-to-back six-pulse rectifier

With a DC motor drive fed from a four-quadrant DC converter, the operation in all four quadrants is possible with a speed control in either the forward or reverse direction.




4.2 Field flux control
Reel drives require this kind of control. The dc motor's material is wound on a reel at constant linear speed and constant strip tension, regardless of diameter.  Control is obtained by weakening the shunt-field current of the dc motor to increase speed and to reduce output torque for a given armature current. Since the rating of a dc motor is determined by heating, the maximum permissible armature current is approximately constant over the speed range. This means that at rated current, the dc motor's output torque varies inversely with speed, and the dc motor has constant-horsepower capability over its speed range.
Dc motors offer a solution, which is good for only obtaining speeds greater than the base speed. A momentary speed reduction below the dc motor's base speed can be obtained by overexciting the field, but prolonged overexcitation overheats the dc motor. Also, magnetic saturation in the dc motor permits only a small reduction in speed for a substantial increase in field voltage.
Dc motors have a maximum standard speed range by field control is 3:1, and this occurs only at low base speeds. Special dc motors have greater speed ranges, but if the dc motor's speed range is much greater than 3:1, some other control method is used for at least part of the range.





4.3Armature resistance control.   
In this method, shunt-field current is maintained constant from a separate source while the voltage applied to the armature is varied. Dc motors feature a speed, which is proportional to the counter emf. This is equal to the applied voltage minus the armature circuit IR drop. At rated current, the torque remains constant regardless of the dc motor speed (since the magnetic flux is constant) and, therefore, the dc motor has constant torque capability over its speed range.
Horsepower varies directly with speed. Actually, as the speed of a self-ventilated motor is lowered, it loses ventilation and cannot be loaded with quite as much armature current without exceeding the rated temperature rise.
                                




















5.Wireless speed controlling:-
The component used in this method:-
 5.1. DC Motor
5. 2. Basic Electronic Components
5. 3.  PIC controller Circuit
5. 4.  Receiver Circuit
5. 5. Transmitter Circuit
5. 6.  H-Bridge
5. 7. Rectifier Circuit
5. 8.  LCD Display


















5.2   Basic Electronic Components
Resistors
Resistors are components that have a predetermined resistance. Resistance determines how much current will flow through a component. Resistors are used to control voltages and currents. A very high resistance allows very little current to flow. Air has very high resistance. Current almost never flows through air. (Sparks and lightning are brief displays of current flow through air. The light is created as the current burns parts of the air.) A low resistance allows a large amount of current to flow. Metals have very low resistance. That is why wires are made of metal. They allow current to flow from one point to another point without any resistance. Wires are usually covered with rubber or plastic. This keeps the wires from coming in contact with other wires and creating short circuits. High voltage power lines are covered with thick layers of plastic to make them safe, but they become very dangerous when the line breaks and the wire is exposed and is no longer separated from other things by insulation.
Resistance is given in units of ohms. (Ohms are named after Mho Ohms who played with electricity as a young boy in Germany.) Common resistor values are from 100 ohms to 100,000 ohms. Each resistor is marked with colored stripes to indicate its resistance. 



Variable Resistors

Variable resistors are also common components. They have a dial or a knob that allows you to change the resistance. This is very useful for many situations. Volume controls are variable resistors. When you change the volume you are changing the resistance which changes the current. Making the resistance higher will let less current flow so the volume goes down. Making the resistance lower will let more current flow so the volume goes up. The value of a variable resistor is given as its highest resistance value. For example, a 500 ohm variable resistor can have a resistance of anywhere between 0 ohms and 500 ohms. A variable resistor may also be called a potentiometer (pot for short
Capacitors
).

Capacitor symbol


Now suppose you want to control how the current in your circuit changes (or not changes) over time. Now why would you? Well radio signals require very fast current changes. Robot motors cause current fluctuations in your circuit which you need to control. What do you do when batteries cannot supply current as fast as you circuit drains them? How do you prevent sudden current spikes that could fry your robot circuitry? The solution to this is capacitors.

 Capacitors are like electron storage banks. If your circuit is running low, it will deliver electrons to your circuit.
In our water analogy, think of this as a water tank with water always flowing in, but with drainage valves opening and closing. Since capacitors take time to charge, and time to discharge, they can also be used for timing circuits.
Quick note, some capacitors are polarized, meaning current can only flow one direction through them. If a capacitor has a lead that is longer than the other, assume the longer lead must always connect to positive
.
Power surge /drainage management
The problem with using robot components that drain a large amount of power is sometimes your battery cannot handle the high drain rate, Motors and servos being perfect examples. This would cause a system wide voltage drop, often resetting your microcontroller, or at least causing it to not work properly. Just a side note, it is bad to use the same power source for both your circuit and your motors. So don't do it.
Or suppose your robot motors are not operating at its full potential because the battery cannot supply enough current, the capacitor will make up for it. The solution is to place a large electrolytic capacitor between the source and ground of your power source. Get a capacitor that is rated at least twice the voltage you expect to go through it. Have it rated at 1mF-10mF for every amp required. For example, if your 20V motors will use 3 amps, use a 3mF-30mF 50V rated capacitor. Exactly how much will depend on how often you expect your motor to change speed and direction, as well as momentum of what you are actuating. Just note that if your capacitor is too large, it may take a long time to charge up when you first turn your robot on. If it is too small, it will drain of electrons and your circuit will be left with a deficit. It is also bad to allow a large capacitor to remain fully charged when you turn off your robot. Some things could accidentally short and fry. So use a simple power on LED in your motor circuit to drain the capacitor after your robot is turned off.  If your capacitor is not rated properly for voltage, then can explode with smoke. Fortunately they do not overheat if given excessive amounts of current. So just make sure your capacitor is rated higher than your highest expected.
Capacitors can also be used to prevent power spikes that could potentially fry circuitry. Next to any on/off switch or anything that that could affect power suddenly should have a capacitor across it?
Capacitors can eliminate switch bouncing. When you flip a mechanical switch, the switch actually bounces several times within a microsecond range. Normally this is too small of a time for anyone to care (or even notice), but note that a microcontroller can take hundreds of readings in a single microsecond. So if your robot was counting the number of times a switch is flipped, a single flip can count as dozens. So how do you stop this? Use a small ceramic capacitor! Just experiment until you find the power capacitance value.

Diodes

Diodes are components that allow current to flow in only one direction. They have a positive side (leg) and a negative side. When the voltage on the positive leg is higher than on the negative leg then current flows through the diode (the resistance is very low). When the voltage is lower on the positive leg than on the negative leg then the current does not flow (the resistance is very high). The negative leg of a diode is the one with the line closest to it. It is called the cathode. The positive end is called the anode.
Usually when current is flowing through a diode, the voltage on the positive leg is 0.65 volts higher than on the negative leg.

Switches
Switches are devices that create a short circuit or an open circuit depending on the position of the switch. For a light switch, ON means short circuit (current flows through the switch, and lights light up.) When the switch is OFF, that means there is an open circuit (no current flows, lights go out.
When the switch is ON it looks and acts like a wire. When the switch is OFF there is no connection.


The LED

An LED is the device shown above. Besides red, they can also be yellow, green and blue. The letters LED stand for Light Emitting Diode. The important thing to remember about diodes (including LEDs) is that current can only flow in one direction.
The 333 Mega Bright series is conventional LED Lamps utilizing higher intensity
material to achieve the brightest performance.
The semi-conductor materials used are:
AlGalnP for (333RTSC, 333YTSC)
GaN/Sic for (333B432C)
InGaN/Sic for (333B472C, 333BG2C, 333PG2C, 333W2C)

The Transistor
Transistors are basic components in all of today's electronics. They are just simple switches that we can use to turn things on and off. Even though they are simple, they are the most important electrical component. For example, transistors are almost the only components used to build a Pentium processor. A single Pentium chip has about 3.5 million transistors. The ones in the Pentium are smaller than the ones we will use but they work the same way.
Transistors that we will use in projects look like this:

The transistor has three legs, the Collector (C), Base (B), and Emitter (E). Sometimes they are labeled on the flat side of the transistor. Transistors always have one round side and one flat side. If the round side is facing you, the Collector leg is on the left, the Base leg is in the middle, and the Emitter leg is on the right.
Transistor Symbol
The following symbol is used in circuit drawings (schematics) to represent a transistor.

Basic Circuit
The Base (B) is the On/Off switch for the transistor. If a current is flowing to the Base, there will be a path from the Collector (C) to the Emitter (E) where current can flow (The Switch is On.) If there is no current flowing to the Base, then no current can flow from the Collector to the Emitter. (The Switch is off.)
Below is the basic circuit we will use for all of our transistors.









Voltage Regulator
Description
The MC78XX/LM78XX/MC78XXA series of three terminal positive regulators are available in the TO-220/D-PAK package and with several fixed output  voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection,
making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.

                          


Electrical Characteristics (MC7805/LM7805)
                                   





Ripple Rejection
Fixed Output Regulator




Photo Modules for PCM Remote Control Systems
Description
The TSOP17.. – series are miniaturized receivers for infrared remote control systems. PIN diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter. The demodulated output signal can directly be decoded by a microprocessor. TSOP17.. is the standard IR remote control receiver series, supporting all major transmission codes.





Features
_ Photo detector and preamplifier in one package
_ Internal filter for PCM frequency
_ Improved shielding against electrical field disturbance
_ TTL and CMOS compatibility
_ Output_ Low power consumption
_ High immunity against ambient light
_ Continuous data transmission possible(up to 2400 bps)
_ Suitable burst length .10 cycles/burst active low


Application Circuit

Suitable Data Format
The circuit of the TSOP17.. is designed in that way that unexpected output pulses due to noise or disturbance signals are avoided. A bandpassfilter, an integrator stage and an automatic gain control are used to suppress such disturbances.  The distinguishing mark between data signal and disturbance signal are carrier frequency, burst length and duty cycle.
The data signal should fullfill the following condition: Carrier frequency should be close to center frequency of the bandpass (e.g. 38kHz).  Burst length should be 10 cycles/burst or longer.  After each burst which is between 10 cycles and 70 cycles a gap time of at least 14 cycles is neccessary.  For each burst which is longer than 1.8ms a corresponding gap time is necessary at some time in the data stream. This gap time should have at least same length as the burst.  Up to 1400 short bursts per second can be received continuously.


5.3 PIC controller Circuit
PIC controller used in this circuit are PIC16F73 which comes in the family of PIC16FX. The controller comes under PIC16FX family are:-
• PIC16F73
• PIC16F74
• PIC16F76
• PIC16F77
Special Features of PIC16FX Family:-
PIC16F73/76 devices are available only in 28-pin packages, while PIC16F74/77 devices are available in 40-pin and 44-pin packages. All devices in the PIC16F7X family share common architecture, with the following differences:
• The PIC16F73 and PIC16F76 have one-half of the total on-chip memory of the PIC16F74 and PIC16F77
• The 28-pin devices have 3 I/O ports, while the 40/44-pin devices have 5
• The 28-pin devices have 11 interrupts, while the 40/44-pin devices have 12
• The 28-pin devices have 5 A/D input channels, while the 40/44-pin devices have 8
• The Parallel Slave Port is implemented only on the 40/44-pin devices
The available features are summarized in Table 1.

                                                                                                       

Special Microcontroller Features:
• Power-on Reset (POR)
• Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)
• Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation
• Programmable code protection
• Power saving SLEEP mode
• Selectable oscillator options
• In-Circuit Serial Programming(ICSP) via two pins
Peripheral Features:
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external rystal/clock
• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
• Two Capture, Compare, PWM modules
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
• 8-bit, up to 8-channel Analog-to-Digital converter
• Synchronous Serial Port (SSP) with SPI(Master mode) and I2C(Slave)
• Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI)
Parallel Slave Port (PSP), 8-bits wide with  external RD, WR and CS controls (40/44-pin only)
• Brown-out detection circuitry for Brown-out Reset (BOR)
CMOS Technology:
• Low power, high speed CMOS FLASH technology
• Fully static design
• Wide operating voltage range: 2.0V to 5.5V
• High Sink/Source Current: 25 mA
• Industrial temperature range
• Low power consumption:
- < 2 mA typical @ 5V, 4 MHz
- 20 ìA typical @ 3V, 32 kHz
- < 1 ìA typical standby current




Pin Diagram of 16F73










Circuit diagram of PICcontroller


Working of PIC controller:-
In the PIC controller circuit rectified dc supply obtain from the bridge rectifier is pass through a filter circuit to remove the harmonics contents. Rectified supply is provide at pin no 1 & 20 of the microcontroller and the crystal oscillator is connected at the pin no 9 & 10. The function of the crystle oscillator is to generate a frequency of specified value. The pin no 8 & 19 are grounded. A 16*2 bit LCD display is connected at the pin no 23,24,25,26,27,28.






                           
Coding for microcontroller to control the speed:-
void main()
{
     int speed;
     int start;
     int direction;
     int i;

     speed=0;
     start=0;
     direction=0;
    
     Lcd_Initialize(&PORTB);
     Lcd_Command(Lcd_CLEAR);
     Lcd_Command(Lcd_CURSOR_OFF);
     Lcd_Output(1, 1,"DC MOTOR - IR");
     Lcd_Output(2, 1,"SPEED:");
     Lcd_Output(2,7,speed);
    
     while(1)
     {

             if(PORTC.bit0)
             {
                            if(speed<100)
                            {
                                         speed=speed+1;
                            }
                          
                            Lcd_Command(Lcd_CLEAR);
                            Lcd_Command(Lcd_CURSOR_OFF);
                            Lcd_Output(1, 1,"DC MOTOR - IR");
                            Lcd_Output(2, 1,"SPEED:");
                            Lcd_Output(2,7,speed);
                           
                            delay_ms(100);
             }
            
             if(PORTC.bit1)
             {
                            if(speed>0)
                            {
                                         speed=speed-1;
                            }
                           
                          
                            Lcd_Command(Lcd_CLEAR);
                            Lcd_Command(Lcd_CURSOR_OFF);
                            Lcd_Output(1, 1,"DC MOTOR - IR");
                            Lcd_Output(2, 1,"SPEED:");
                            Lcd_Output(2,7,speed);
                           
                            delay_ms(100);

             }
            
             if(PORTC.bit2)
             {
                            while(PORTC.bit2)
                            {
                            }
                            if(direction==0)
                            {
                                       direction=1;
                            }
                            else
                            {
                                       direction=0;
                            }

             }
            
             if(PORTC.bit3)
             {

                         while(PORTC.bit3)
                         {
                         }
                         if(start==0)
                         {
                                       start=1;
                         }
                         else
                         {
                                       start=0;
                         }

             }
            
            
             if(start==1)
             {
                         if(direction==1)
                         {
                                         PORTC.bit6=1;
                                         PORTC.bit7=0;
                                        
                                        
                                         for(i=0;i<speed;i++)
                                         {
                                                             delay_ms(1);
                                         }
                                                            
                                         PORTC.bit6=0;
                                         PORTC.bit7=0;
                                        
                                         delay_ms(10);
                                        

                         }
                         else
                         {
                                         PORTC.bit6=0;
                                         PORTC.bit7=1;
                                        
                                         for(i=0;i<speed;i++)
                                         {
                                                             delay_ms(1);
                                         }

                                         PORTC.bit6=0;
                                         PORTC.bit7=0;

                                         delay_ms(10);
                         }


             }
             else
             {
                 PORTC.bit6=0;
                 PORTC.bit7=0;
             }


     }
}


Memory Organization
There are two memory blocks in each of these PICmicro® MCUs. The Program Memory and Data Memory have separate buses so that concurrent access can occur and is detailed in this section. The Program Memory can be read internally by user code  Additional information on device memory may be found in the PICmicroMid-Range Reference Manual .

Program Memory Organization
The PIC16F7X devices have a 13-bit program counter capable of addressing an 8K word x 14-bit program memory space. The PIC16F77/76 devices have 8K words of FLASH program memory and the PIC16F73/74 devices have 4K words. The program memory maps for PIC16F7X devices are shown in Figure 2-1. Accessing a location above the physically implemented address will cause a wraparound.
The RESET Vector is at 0000h and the Interrupt Vector is at 0004h.

Data Memory Organization
The Data Memory is partitioned into multiple banks, which contain the General Purpose Registers and the Special Function Registers. Bits RP1 (STATUS<6>) and RP0 (STATUS<5>) are the bank select bits: Each bank extends up to 7Fh (128 bytes). The lower locations of each bank are reserved for the Special Function Registers. Above the Special Function Registers are General Purpose Registers, implemented as static RAM. All implemented banks contain Special Function Registers. Some frequently used Special Function Registers from one bank may be mirrored in another bank for code reduction and quicker access.

  GENERAL PURPOSE REGISTER FILE
The register file  can be accessed either directly, or indirectly, through the File Select Register FSR.

 STATUS Register
The STATUS register contains the arithmetic status of the ALU, the RESET status and the bank select bits for data memory. The STATUS register can be the destination for any instruction, as with any other register. If the STATUS register is the destination for an instruction that affects the Z, DC, or C bits, then the write to these three bits isdisabled. These bits are set or cleared according to the device logic. Furthermore, the TO and PD bits are not writable, therefore, the result of an instruction with the STATUS register as destination may be different than intended. For example, CLRF STATUS will clear the upper three bits and set the Z bit. This leaves the STATUS register as 000u u1uu (where u = unchanged). It is recommended, therefore, that only BCF, BSF, SWAPF and MOVWF instructions are used to alter the STATUS register, because these instructions do not Affect  the Z, C, or DC bits from the STATUS register. For other instructions not affecting any status bits, see the "Instruction Set Summary."



STATUS REGISTER (ADDRESS 03h, 83h, 103h, 183h)

bit 7 IRP: Register Bank Select bit (used for indirect addressing)
0 = Bank 0, 1 (00h - FFh)
1 = Bank 2, 3 (100h - 1FFh)

bit 6-5 RP1:RP0: Register Bank Select bits (used for direct addressing)
11 = Bank 3 (180h - 1FFh)
10 = Bank 2 (100h - 17Fh)
01 = Bank 1 (80h - FFh)
00 = Bank 0 (00h - 7Fh)

Each bank is 128 bytes
bit 4 TO: Time-out bit
1 = After power-up, CLRWDT instruction, or SLEEP instruction
0 = A WDT time-out occurred

bit 3 PD: Power-down bit
1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction

bit 2 Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero

bit 1 DC: Digit carry/borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the 4th low order bit of the result occurred
0 = No carry-out from the 4th low order bit of the result

bit 0 C: Carry/borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred

OPTION_REG Register

The OPTION_REG register is a readable and writable register, which contains various control bits to configure the TMR0 prescaler/WDT postscaler (single assignable register known also as the prescaler), the External INT Interrupt, TMR0 and the weak pull-ups on PORTB.

OPTION_REG REGISTER (ADDRESS 81h, 181h)
bit 7 RBPU: PORTB Pull-up Enable bit
1 = PORTB pull-ups are disabled
0 = PORTB pull-ups are enabled by individual port latch values

bit 6 INTEDG: Interrupt Edge Select bit
1 = Interrupt on rising edge of RB0/INT pin
0 = Interrupt on falling edge of RB0/INT pin

bit 5 T0CS: TMR0 Clock Source Select bit
1 = Transition on RA4/T0CKI pin
0 = Internal instruction cycle clock (CLKOUT)

bit 4 T0SE: TMR0 Source Edge Select bit
1 = Increment on high-to-low transition on RA4/T0CKI pin
0 = Increment on low-to-high transition on RA4/T0CKI pin

bit 3 PSA: Prescaler Assignment bit
1 = Prescaler is assigned to the WDT
0 = Prescaler is assigned to the Timer0 module











INTCON Register :-

The INTCON register is a readable and writable register, which contains various enable and flag bits for the TMR0 register overflow, RB Port change and External RB0/INT pin interrupts.

INTCON REGISTER (ADDRESS 0Bh, 8Bh, 10Bh, 18Bh)

bit 7 GIE: Global Interrupt Enable bit
1 = Enables all unmasked interrupts
0 = Disables all interrupts

bit 6 PEIE: Peripheral Interrupt Enable bit
1 = Enables all unmasked peripheral interrupts
0 = Disables all peripheral interrupts

bit 5 TMR0IE: TMR0 Overflow Interrupt Enable bit
1 = Enables the TMR0 interrupt
0 = Disables the TMR0 interrupt

bit 4 INTE: RB0/INT External Interrupt Enable bit
1 = Enables the RB0/INT external interrupt
0 = Disables the RB0/INT external interrupt

bit 3 RBIE: RB Port Change Interrupt Enable bit
1 = Enables the RB port change interrupt
0 = Disables the RB port change interrupt

bit 2 TMR0IF: TMR0 Overflow Interrupt Flag bit
1 = TMR0 register has overflowed (must be cleared in software)
0 = TMR0 register did not overflow

bit 1 INTF: RB0/INT External Interrupt Flag bit
1 = The RB0/INT external interrupt occurred (must be cleared in software)
0 = The RB0/INT external interrupt did not occur

bit 0 RBIF: RB Port Change Interrupt Flag bit A mismatch condition will continue to      set flag bit RBIF. Reading PORTB will end the mismatch condition and allow flag bit RBIF to be cleared.
1 = At least one of the RB7:RB4 pins changed state (must be cleared in software)
0 = None of the RB7:RB4 pins have changed state









 PIE1 Register :-
The PIE1 register contains the individual enable bits for the peripheral interrupts.

PIE1 REGISTER (ADDRESS 8Ch)


bit 7 PSPIE(1): Parallel Slave Port Read/Write Interrupt Enable bit
1 = Enables the PSP read/write interrupt
0 = Disables the PSP read/write interrupt

bit 6 ADIE: A/D Converter Interrupt Enable bit
1 = Enables the A/D converter interrupt
0 = Disables the A/D converter interrupt

bit 5 RCIE: USART Receive Interrupt Enable bit
1 = Enables the USART receive interrupt
0 = Disables the USART receive interrupt

bit 4 TXIE: USART Transmit Interrupt Enable bit
1 = Enables the USART transmit interrupt
0 = Disables the USART transmit interrupt

bit 3 SSPIE: Synchronous Serial Port Interrupt Enable bit
1 = Enables the SSP interrupt
0 = Disables the SSP interrupt

bit 2 CCP1IE: CCP1 Interrupt Enable bit
1 = Enables the CCP1 interrupt
0 = Disables the CCP1 interrupt

bit 1 TMR2IE: TMR2 to PR2 Match Interrupt Enable bit
1 = Enables the TMR2 to PR2 match interrupt
0 = Disables the TMR2 to PR2 match interrupt

bit 0 TMR1IE: TMR1 Overflow Interrupt Enable bit
1 = Enables the TMR1 overflow interrupt
0 = Disables the TMR1 overflow interrupt













PIR1 REGISTER (ADDRESS 0Ch)

bit 7 PSPIF(1): Parallel Slave Port Read/Write Interrupt Flag bit
1 = A read or a write operation has taken place (must be cleared in software)
0 = No read or write has occurred

bit 6 ADIF: A/D Converter Interrupt Flag bit
1 = An A/D conversion is completed (must be cleared in software)
0 = The A/D conversion is not complete

bit 5 RCIF: USART Receive Interrupt Flag bit
1 = The USART receive buffer is full
0 = The USART receive buffer is empty

bit 4 TXIF: USART Transmit Interrupt Flag bit
1 = The USART transmit buffer is empty
0 = The USART transmit buffer is full

bit 3 SSPIF: Synchronous Serial Port (SSP) Interrupt Flag
1 = The SSP interrupt condition has occurred, and must be cleared in software before returning from the Interrupt Service Routine. The conditions that will set this bit are:
SPI               A transmission/reception has taken place.
I2 C Slave     A transmission/reception has taken place.
I2 C Master   A transmission/reception has taken place.
The initiated START condition was completed by the SSP module.
The initiated STOP condition was completed by the SSP module.
The initiated Restart condition was completed by the SSP module.
The initiated Acknowledge condition was completed by the SSP module.
A START condition occurred while the SSP module was IDLE (multi-master system).
A STOP condition occurred while the SSP module was IDLE (multi-master system).
0 = No SSP interrupt condition has occurred

bit 2 CCP1IF: CCP1 Interrupt Flag bit
Capture mode:
1 = A TMR1 register capture occurred (must be cleared in software)
0 = No TMR1 register capture occurred

Compare mode:
1 = A TMR1 register compare match occurred (must be cleared in software)
0 = No TMR1 register compare match occurred

PWM mode:  Unused in this mode
bit 1 TMR2IF: TMR2 to PR2 Match Interrupt Flag bit
1 = TMR2 to PR2 match occurred (must be cleared in software)
0 = No TMR2 to PR2 match occurred
bit 0 TMR1IF: TMR1 Overflow Interrupt Flag bit
1 = TMR1 register overflowed (must be cleared in software)
0 = TMR1 register did not overflow

5.4 Receiver Circuit
Component used in receiver circuit are HT12D , Voltage regulator , Crystal oscillator , filter circuit , Capacitor .


Receiver circuit arrangement are shown below



Features
_ Operating voltage: 2.4V~12V
_ Low power and high noise immunity CMOS technology
_ Low standby current
_ Capable of decoding 12 bits of information
_ Pair with Holtek_s 2 series of encoders
_ Binary address setting
_ Received codes are checked 3 times
_ Address/Data number combination
_ HT12D: 8 address bits and 4 data bits
_ HT12F: 12 address bits only
_ Built-in oscillator needs only 5% resistor
_ Valid transmission indicator
_ Easy interface with an RF or an infrared transmission medium
_ Minimal external components


Applications
_ Burglar alarm system
_ Smoke and fire alarm system
_ Garage door controllers
_ Car door controllers
_ Car alarm system
_ Security system
_ Cordless telephones
_ Other remote control systems

General Description
The 2 decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holtek_s 2 12 series of encoders (refer to the encoder/decoder cross reference table). For proper operation, a pair of  encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 2 12 series of encoders that are transmitted by a carrier using an RF or an IR transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or nmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The 2 12 series of decoders are capable of decoding informations that consist of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits, and HT12F is used to decode 12 bits of address information.
Block Diagram
Pin arrangement of HT12D

Functional Description Operation
The 2 12 series of decoders provides various combinations of addresses and data pins in different packages so as to pair with the 2 12 series of  encoders. The decoders receive data that are transmitted by an encoder and interpret the first N bits of code period as addresses and the last 12_N bits as data, where N is the address code number. A signal on the DIN pin activates the oscillator which in turn decodes the incoming address and data. The decoders will then check the received
address three times continuously. If the received address codes all match the contents of the decoder_s local address, the 12_N bits of data are decoded to activate the output pins and the VT pin is set high to indicate a valid
transmission. This will last unless the address code is incorrect or no signal is received. The output of the VT pin is high only when the transmission is valid. Otherwise it is always low.

Output type
Of the 2 12  series of decoders, the HT12F has no data output pin but its VT pin can be used as a momentary data output. The HT12D, on the other hand, provides 4 latch type data pins whose data remain unchanged until new data are received.




Decoder timing





Address/Data sequence
The following table provides address/data sequence for various models of the 2
12 series of decoders. A correct device should be chosen according to the requirements of the individual addresses and data.



Oscillator frequency vs supply voltage

The recommended oscillator frequency is fOSCD (decoder)  50 fOSCE (HT12E encoder) 1  3 fOSCE (HT12A encoder).
5.5  Transmitter Circuit
                                           
Features
_ Operating voltage
_ 2.4V~5V for the HT12A
_ 2.4V~12V for the HT12E
_ Low power and high noise immunity CMOS technology
_ Low standby current: 0.1_A (typ.) at VDD=5V
_ HT12A with a 38kHz carrier for infrared transmission medium
_ Minimum transmission word
_ Four words for the HT12E _ One word for the HT12A
_ Built-in oscillator needs only 5% resistor
_ Data code has positive polarity
_ Minimal external components
_ HT12A/E: 18-pin DIP/20-pin SOP package


General Description
The 212 encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/ data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits  via an RF or an infrared transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E or a DATA trigger on the HT12A further enhances the application flexibility of the 212 series of encoders. The HT12A additionally provides a 38kHz carrier for infrared system.



DATA trigger
HT12A

                                                         
                                            Electrical Characteristics
Functional Description
Operation
The 212 series of encoders begin a 4-word transmission cycle upon receipt of a transmission enable (TE for the HT12E or D8~D11 for the HT12A, active low). This cycle will repeat itself as long as the transmission enable (TE or D8~D11) is held low. Once the transmission enable returns high the encoder output completes its final cycle and then stops as shown below.


Address/data programming (preset)
The status of each address/data pin can be individually pre-set to logic _high_ or _low_. If a transmission- enable signal is applied, the encoder scans and transmits the status of the 12 bits of address/ data serially in the order A0 to AD11 for the HT12E encoder and A0 to D11 for the HT12A encoder. During information transmission these bits are transmitted with a preceding synchronization bit. If the trigger signal is not applied, the chip enters the standby mode and consumes a reduced current of less than 1_A for a supply voltage of 5V. Usual applications preset the address pins with individual security codes using DIP switches or PCB wiring, while the data is selected by push buttons or electronic switches. The following figure shows an application using the HT12E:












5.6.  H-Bridge circuit


Description:-

The L293D is a monolithic integrated high voltage, high current four channel vriver designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays  solenoides, DC and stepping motors) and switching power transistors.  To simplify use as two bridges is pair of channels is equiped with an enable input. As eparate supply input is provited  form the logic, allowing operation at a low voltage and internal clamp diodes are included. This device is suitable for use in switching applications at frequencies up to 5 KHz. The L293D is assembled in a 16 lead plastic
packege which has 4 center pins connected together and used for heatsinking .
                                                                                 


ELECTRICAL CHARACTERISTICS
                                                                                                  
Liquid Crystal Display
            The HD44780U dot-matrix liquid crystal display controller and driver LSI displays alphanumerics, Japanese kana characters, and symbols. It can be configured to drive a dot-matrix liquid crystal display under the control of a 4- or 8-bit microprocessor. Since all the functions such as display RAM, character generator, and provided on one chip, a minimal system can be interfaced with this controller/driver liquid crystal driver, required for driving a dot-matrix liquid crystal display are internally.

Block Diagram
                     

Function Description
Registers
The HD44780U has two 8-bit registers, an instruction register (IR) and a data register (DR). The IR stores instruction codes, such as display clear and cursor shift, and address information for display data RAM (DDRAM) and character generator RAM (CGRAM). The IR can only be written from the MPU. The DR temporarily stores data to be written into DDRAM or CGRAM and temporarily stores data to be read from DDRAM or CGRAM. Data written into the DR from the MPU is automatically written into DDRAM or CGRAM by an internal operation. The DR is also used for data storage when reading data from DDRAM or CGRAM. When address information is written into the IR, data is read and then stored into the DR from DDRAM or CGRAM by an internal operation. Data transfer between the MPU is then completed when the MPU reads the DR. After the read, data in DDRAM or CGRAM at the next address
is sent to the DR for the next read from the MPU. By the register selector (RS) signal, these two registers can be selected (Table 1).
Busy Flag (BF)
When the busy flag is 1, the HD44780U is in the internal operation mode, and the next instruction will not be accepted. When RS = 0 and R/: = 1 (Table 1), the busy flag is output to DB7. The next instruction must be written after ensuring that the busy flag is 0.
Address Counter (AC)
The address counter (AC) assigns addresses to both DDRAM and CGRAM. When an address of an instruction is written into the IR, the address information is sent from the IR to the AC. Selection of either DDRAM or CGRAM is also determined concurrently by the instruction. After writing into (reading from) DDRAM or CGRAM, the AC is automatically incremented by 1 (decremented by 1). The AC contents are then output to DB0 to DB6 when RS = 0 and R/: = 1

Character Generator ROM (CGROM)
The character generator ROM generates 5 ´ 8 dot or 5 ´ 10 dot character patterns from 8-bit character codes (Table 4). It can generate 208 5 ´ 8 dot character patterns and 32 5 ´ 10 dot character patterns. User-defined character patterns are also available by mask-programmed ROM.
Character Generator RAM (CGRAM)
In the character generator RAM, the user can rewrite character patterns by program. For 5 ´ 8 dots, eight character patterns can be written, and for 5 ´ 10 dots, four character patterns can be written. Write into DDRAM the character codes at the addresses shown as the left column of Table 4 to show the character patterns stored in CGRAM. See Table 5 for the relationship between CGRAM addresses and data and display patterns. Areas that are not used for display can be used as general data RAM.
Modifying Character Patterns
·  Character pattern development procedure The following operations correspond to the numbers listed in Figure 7:
1. Determine the correspondence between character codes and character patterns.
2. Create a listing indicating the correspondence between EPROM addresses and data.
3. Program the character patterns into the EPROM.
4. Send the EPROM to Hitachi.
5. Computer processing on the EPROM is performed at Hitachi to create a character pattern listing, which is sent to the user.
6. If there are no problems within the character pattern listing, a trial LSI is created at Hitachi and samples are sent to the user for evaluation. When it is confirmed by the user that the character patterns are correctly written, mass production of the LSI proceeds at Hitachi.
Timing Generation Circuit
The timing generation circuit generates timing signals for the operation of internal circuits such as DDRAM, CGROM and CGRAM. RAM read timing for display and internal operation timing by MPU access are generated separately to avoid interfering with each other. Therefore, when writing data to DDRAM, for example, there will be no undesirable interferences, such as flickering, in areas other than
the display area.

Liquid Crystal Display Driver Circuit
The liquid crystal display driver circuit consists of 16 common signal drivers and 40 segment signal drivers. When the character font and number of lines are selected by a program, the required common signal drivers automatically output drive waveforms, while the other common signal drivers continue to output non-selection waveforms.
Sending serial data always starts at the display data character pattern corresponding to the last address of the display data RAM (DDRAM). Since serial data is latched when the display data character pattern corresponding to the starting address enters the internal shift register, the HD44780U drives from the head display.

Cursor/Blink Control Circuit
The cursor/blink control circuit generates the cursor or character blinking. The cursor or the blinking will appear with the digit located at the display data RAM (DDRAM) address set in the address counter (AC). For example (Figure 8), when the address counter is 08H, the cursor position is displayed at DDRAM address 08H.

Interfacing to the MPU
The HD44780U can send data in either two 4-bit operations or one 8-bit operation, thus allowing interfacing with 4- or 8-bit MPUs.  For 4-bit interface data, only four bus lines (DB4 to DB7) are used for transfer. Bus lines DB0 to DB3 are disabled. The data transfer between the HD44780U and the MPU is completed after the 4-bit data
has been transferred twice. As for the order of data transfer, the four high order bits (for 8-bit operation, DB4 to DB7) are transferred before the four low order bits (for 8-bit operation, DB0 to DB3).  The busy flag must be checked (one instruction) after the 4-bit data has been transferred twice. Two more 4-bit operations then transfer the busy flag and address counter data.  For 8-bit interface data, all eight bus lines (DB0 to DB7) are used.

Reset Function
Initializing by Internal Reset Circuit
An internal reset circuit automatically initializes the HD44780U when the power is turned on. The following instructions are executed during the initialization. The busy flag (BF) is kept in the busy state until the initialization ends (BF = 1). The busy state lasts for 10 ms after VCC rises to 4.5 V.
1. Display clear
2. Function set:
DL = 1; 8-bit interface data
N = 0; 1-line display
F = 0; 5 ´ 8 dot character font
3. Display on/off control:
D = 0; Display off
C = 0; Cursor off
B = 0; Blinking off
4. Entry mode set:
I/D = 1; Increment by 1
S = 0; No shift
Note: If the electrical characteristics conditions listed under the table Power Supply Conditions Using
Internal Reset Circuit are not met, the internal reset circuit will not operate normally and will fail to initialize the HD44780U. For such a case, initial-ization must be performed by the MPU as explained in the section, Initializing by Instruction.

Instructions
Outline
Only the instruction register (IR) and the data register (DR) of the HD44780U can be controlled by the MPU. Before starting the internal operation of the HD44780U, control information is temporarily stored into these registers to allow interfacing with various MPUs, which operate at different speeds, or various peripheral control devices. The internal operation of the HD44780U is determined by signals sent from
the MPU. These signals, which include register selection signal (RS), read/ write signal (R/:), and the data bus (DB0 to DB7), make up the HD44780U instructions (Table 6). There are four categories of instructions that:
·  Designate HD44780U functions, such as display format, data length, etc.
·  Set internal RAM addresses
·  Perform data transfer with internal RAM
·  Perform miscellaneous functions

HD44780U
191Normally, instructions that perform data transfer with internal RAM are used the most. However, autoincrementation by 1 (or auto-decrementation by 1) of internal HD44780U RAM addresses after each data write can lighten the program load of the MPU. Since the display shift instruction (Table 11) can perform concurrently with display data write, the user can minimize system development time with maximum
programming efficiency. When an instruction is being executed for internal operation, no instruction other than the busy flag/address read instruction can be executed.
Because the busy flag is set to 1 while an instruction is being executed, check it to make sure it is 0 before sending another instruction from the MPU. Note: Be sure the HD44780U is not in the busy state (BF = 0) before sending an instruction from the
MPU to the HD44780U. If an instruction is sent without checking the busy flag, the time between the first instruction and next instruction will take much longer than the instruction time itself.

Instruction Description
Clear Display
Clear display writes space code 20H (character pattern for character code 20H must be a blank pattern) into all DDRAM addresses. It then sets DDRAM address 0 into the address counter, and returns the display to its original status if it was shifted. In other words, the display disappears and the cursor or blinking goes to the left edge of the display (in the first line if 2 lines are displayed). It also sets I/D to 1 (increment mode) in entry mode. S of entry mode does not change.

Return Home
Return home sets DDRAM address 0 into the address counter, and returns the display to its original status if it was shifted. The DDRAM contents do not change.
The cursor or blinking go to the left edge of the display (in the first line if 2 lines are displayed).

Entry Mode Set
I/D: Increments (I/D = 1) or decrements (I/D = 0) the DDRAM address by 1 when a character code is written into or read from DDRAM. The cursor or blinking moves to the right when incremented by 1 and to the left when decremented by 1. The same applies to writing and reading of CGRAM.

S: Shifts the entire display either to the right (I/D = 0) or to the left (I/D = 1) when S is 1. The display does not shift if S is 0. If S is 1, it will seem as if the cursor does not move but the display does. The display does not shift when reading from DDRAM. Also, writing into or reading out from CGRAM does not shift the display.

Display On/Off Control

D: The display is on when D is 1 and off when D is 0. When off, the display data remains in DDRAM,  but can be displayed instantly by setting D to 1.

C: The cursor is displayed when C is 1 and not displayed when C is 0. Even if the cursor disappears, the function of I/D or other specifications will not change during display data write. The cursor is displayed using 5 dots in the 8th line for 5 ´ 8 dot character font selection and in the 11th line for the 5 ´ 10 dot character font selection

B: The character indicated by the cursor blinks when B is 1 (Figure 13). The blinking is displayed as switching between all blank dots and displayed characters at a speed of 409.6-ms intervals when fcp or fOSC is 250 kHz. The cursor and blinking can be set to display simultaneously .

Cursor or Display Shift
Cursor or display shift shifts the cursor position or display to the right or left without writing or reading display data (Table 7). This function is used to correct or search the display. In a 2-line display, the cursor moves to the second line when it passes the 40th digit of the first line. Note that the first and second line displays will shift at the same time. When the displayed data is shifted repeatedly each line moves only horizontally. The second line display does not shift into the first line position. The address counter (AC) contents will not change if the only action performed is a display shift.

Function Set
DL: Sets the interface data length. Data is sent or received in 8-bit lengths (DB7 to DB0) when DL is 1, and in 4-bit lengths (DB7 to DB4) when DL is 0.When 4-bit length is selected, data must be sent or received twice.

N: Sets the number of display lines.

F: Sets the character font.

Note: Perform the function at the head of the program before executing any instructions (except for the read busy flag and address instruction). From this point, the function set instruction cannot be executed unless the interface data length is changed.
Set CGRAM Address

Set CGRAM address sets the CGRAM address binary AAAAAA into the address counter. Data is then written to or read from the MPU for CGRAM.


Instruction and Display Correspondence
·8-bit operation, 8-digit ´ 1-line display with internal reset for an example of an 8-digit  1-line display in 8-bit operation. The HD44780U functions must be set by the function set instruction prior to the display. Since the display data RAM can store data for 80 characters, as explained before, the RAM can be used for displays such as for advertising when combined with the display shift operation.

Since the display shift operation changes only the display position with DDRAM contents unchanged, the first display data entered into DDRAM can be output when the return home operation is performed.


·  4-bit operation, 8-digit ´ 1-line display with internal reset The program must set all functions prior to the 4-bit operation (Table 12). When the power is turned on, 8-bit operation is automatically selected and the first write is performed as an 8-bit operation. Since DB0 to DB3 are not connected, a rewrite is then required. However, since one operation is completed in two accesses for 4-bit operation, a rewrite is needed to set the functions (see Table 12). Thus, DB4 to DB7 of the function set instruction is written twice.

·  8-bit operation, 8-digit ´ 2-line display For a 2-line display, the cursor automatically moves from the first to the second line after the 40thdigit of the first line has been written. Thus, if there are only 8 characters in the first line, the  DDRAM address must be again set after the 8th character is completed. (See Table 13.) Note that the
display shift operation is performed for the first and second lines. In the example of Table 13, the display shift is performed when the cursor is on the second line. However, if the shift operation is performed when the cursor is on the first line, both the first and second lines move together. If the shift is repeated, the display of the second line will not move to the first line. The same display will only shift within its own line for the number of times the shift is repeated.

Note: When using the internal reset, the electrical characteristics in the Power Supply Conditions UsingInternal Reset Circuit table must be satisfied. If not, the HD44780U must be initialized by instructions. See the section, Initializing by Instruction.











POWER SUPPLY
Power supply can be defined as electronic equipment, which is a stable source of
 D.C. power for electronic circuits.



Transmitter Batteries
                                                                                                Lead Acid batteries were developed in the late 1800s, and were the first commercially practical batteries. They remain popular because they are easy and inexpensive to manufacture. Rechargeable lead-acid batteries have been available since the 1950s and have become the most widely used type of battery today.
Their drawback is remember that lead acid batteries have the serious problem of being very large and heavy, need to always be kept charged, and do not have the high discharge rates as the more modern batteries.

There are three main types of lead acid batteries. Wet Cell (flooded) Gel Cell, and Absorbed Glass Mat (AGM). The Gel Cell and the AGM batteries are specialty batteries that typically cost twice as much as a premium wet cell. However they store very well and do not tend to sulfate or degrade as easily or as easily as wet cell.
Lithium (Li-ion) is the new standard for portable power. Li-ion batteries have the same high energy capacity as NiMHs, power output rates of NiCads, and weigh about 20%-35% less. They also have zero memory effect problems, meaning you can recharge whenever. Although lithium batteries are the most advanced for portable power, they are also the most expensive. Also, they are made out of totally non-toxic material, making them safe for cute squirrels and pretty trees. What is to be remembered is to, lithium ignites very easily, and forms large quantities of hydrogen when put in contact with water, so don't shoot at it or blow it up or anything of that nature. Also, fire extinguishers are usually water based, so don’t use them on lithium battery fires.

















6. Reference
1. A.E. Fitzgerald,C.Kingley ad S.d. Umans,Electric Machinary, Tata Mc-graw hill, International Student Edition, 4th Ed, 1983.
2. I.J. Nagrath and D.P. Kothari, Electric Machines, Tata Mc-graw hill,New Delhi, 1985.
3. W. Leonard, Control of Electric Drives, Berlin, Springer-Varleg, 1985.
4. B.J. Chalmers, Electric Motor Handbook, Butterworths, London, 1988.
5. R.W. Jones, Electric Control System, Wiley, New York, 1953.                         
6. A. Fransua and R. Magureanu, Electic Machine and Drives System, Editura Technica, Bucharest.
7. M.E. EI-Hawari, Principles of Electric Machine with Power Electronics Applications, Prentice Hall-Reston, 1986.
8. T. Kanjo and S. Nagamori, Parmanent Magnet and Brushless DC Motor, Clarandon Press, Oxford, 1985.