Sei sulla pagina 1di 20

LCD Display

The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or other which are compatible with HD44580. In this project, we used the 16x2 character based LCDs, interfaced with various AT89C51 microcontroller, in 8-bit mode. 3.5.1 Pin Description The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters, whereas LCDs supporting more than 80 characters make use of 2 HD44780 controllers. Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in both for back-light LED connections). Pin description is shown in the table below. Pin No. Pin no. 1 Pin no. 2 Pin no. 3 Pin no. 4 Name VSS VCC VEE RS Description Power supply (GND) Power supply (+5V) Contrast adjust 0 = Instruction input 1 = Data input Pin no. 5 R/W 0 = Write to LCD module 1 = Read from LCD module Pin no. 6 Pin no. 7 EN D0 Enable signal Data bus line 0 (LSB)

Pin no. 8 D1 Data bus line 1 Pin no. 9 D2 Data bus line 2 Pin no. 10 Pin no. 11 Pin no. 12 Pin no. 13 Pin no. 14 D3 D4 D5 D6 D7 Data bus line 3 Data bus line 4 Data bus line 5 Data bus line 6 Data bus line 7 (MSB)

LCD Registers Display Data RAM (DDRAM) Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that is not used for display can be used as general data RAM. So whatever you send on the DDRAM is actually displayed on the LCD. For LCDs like 1x16, only 16 characters are visible, so whatever you write after 16 chars is written in DDRAM but is not visible to the user. Figure shows the DDRAM for a 16x2 display.

Character Generator ROM (CGROM) Now you might be thinking that when you send an ascii value to DDRAM, how the character is displayed on LCD? so the answer is CGROM. The character generator ROM generates 5 x 8 dot or 5 x 10 dot character patterns from 8-bit character codes. It can generate 208 5 x 8 dot character patterns and 32 5 x 10 dot character patterns. User defined character patterns are also available by mask-programmed ROM. The Table shows the CGROM structure for a 5x8 dot character LCD. As you can see in the code map, the character code from 0x00 to 0x07 is occupied by the CGRAM characters or the user defined characters. If user wants to display the fourth custom character then the code to display it is 0x03 i.e. when user sends 0x03 code to the LCD DDRAM then the fourth user created character or pattern will be displayed on the LCD.

CGRAM - Character Generator RAM As clear from the name, CGRAM area is used to create custom characters in LCD. In the character generator RAM, the user can rewrite character patterns by program. For 5 x 8 dots, eight character patterns can be written, and for 5 x 10 dots, four character patterns can be written. BF - Busy Flag Busy Flag is an status indicator flag for LCD. When we send a command or data to the LCD for processing, this flag is set (i.e BF =1) and as soon as the instruction is executed successfully this flag is cleared (BF = 0). This is helpful in producing and exact amount of delay for the LCD processing. To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is busy and will not accept next Command or data and BF = 0 means LCD is ready for the next command or data to process.

Instruction Register (IR) and Data Register (DR) There are two 8-bit registers in HD44780 controller Instruction and Data register. Instruction register corresponds to the register where you send commands to LCD e.g LCD shift command, LCD clear, LCD address etc. and Data register is used for storing data which is to be displayed on LCD. When send the enable signal of the LCD is asserted, the data on the pins is latched in to the data register and data is then moved automatically to the DDRAM and hence is displayed on the LCD. Data Register is not only used for sending data to DDRAM but also for CGRAM, the address where you want to send the data, is decided by the instruction you send to LCD. We will discuss more on LCD instruction set further in this tutorial.

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

Below shows the brief set of commands used for controlling the character LCD display. No. 1 2 3 4 5 6 Instruction Function Set: 8-bit, 1 Line, 5x7 Dots Function Set: 8-bit, 2 Line, 5x7 Dots Function Set: 4-bit, 1 Line, 5x7 Dots Function Set: 4-bit, 2 Line, 5x7 Dots Entry Mode Display off Cursor off (clearing display without clearing DDRAM 7 8 9 10 12 13 14 15 16 Display on Cursor on Display on Cursor off Display on Cursor blinking Shift entire display left Shift entire display right Move cursor left by one character Move cursor right by one character Clear Display (also clear DDRAM content) Set DDRAM address or coursor position on display 17 Set CGRAM address or set pointer to CGRAM location 0x40+add** 64+add** 0x80+add* 128+add* 0x08 0x0E 0x0C 0x0F 0x18 0x1C 0x10 0x14 0x01 8 14 12 15 24 30 16 20 1 Hex 0x30 0x38 0x20 0x28 0x06 Decimal 48 56 32 40 6

5.9 Power Supply

The power supply is designed with the normal transformer based supply. The 230V AC line voltage is step down to the 9V AC using a step down transformer. The step downed voltage is driven to a full wave bridge rectifier, which consists of 4 1N4007 diodes (D1-D4). The DC voltage from the rectifier is connected through a capacitor C1, 1000uF. The capacitor acts as a filter by removing the ripples/ ac contents in the supply. The filter voltage is connected to the 1st pin of the LM7805, a 5V regulator IC. The regulated 5V out is taken from the 3rd pin and used for the systems power supply. Capacitors C2 and C16 are used as second stage filter for removing the transients from the supply. A LED is connected through a resistor for the indication of the power.

Speed Sensing Unit


It is a non-contact type sensor, which is used to measure the actual speed of the drive. In this an LED-Phototransistor combination is used to sense the rpm. The input to the LEDphototransistor system is 5V. The disk fixed on the shaft of the motor has TWO slots. Each slot is passed through the gap between the LED- phototransistor systems thereby allowing the light to fall on to the photodiode. The output pulse generated is given to a comparator circuit. The output of op-amp is high if input voltage is more than 4.5V otherwise it is low. The output of op-amp is used to drive the transistor. The output of the transistor is given to the pin number 33 of the microcontroller in which the number of times of the light falling on to the phototransistor per second is sensed and then it multiplied by TWO in order to get revolution per minute. The six slots are used to enhance the resolution of the displayed rpm. The rpm displayed has an accuracy of +/-10 rpm.

of microcontroller

Fig.5.6 Speed Sensing Unit

RF TRASMITTER AND RECEIVER

5.1 Features of RF Transmitter and Receiver


315/418/433.92MHZ Versions Low cost 1.5-12V operation 5mA current consumption at 3V Small size 0dB output power at 3V 4800 baud operation

Description
The RCT-433 as is ideal for remote control applications where low cost and longer range is required. The transmitter operates from a 1.5-12V supply, making it ideal for battery powered applications. The transmitter employs a SAW stabilized oscillator, ensuring accurate frequency control for best range performance. Output power and harmonic emissions are easy to control, making FCC and ETSI compliance easy. The manufacturing friendly SMT style package and how cost makes the RCT-433-AS suitable for high volume applications. The RCT-433-AS is suitable for IR reflow ovens and hot air soldering.

5.2 Application Circuits

Fig. 5.1 Operation of Encoder

Fig. 5.2 Operation of Decoder

5.2.1 HT 12E
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 (type.) at VDD=5V. HT12A with a 38 kHz 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 38 kHz carrier for infrared systems.

Selection Table:-

Block Diagram:-

Fig. 5.3 Block Diagram of Encoder

PIN Assignment:-

Fig. 5.4 Pin Description of Encoder

Pin Description:-

Flowchart

Vital role of encoder is to encode the code sent by microcontroller and send it to receiver section for verification.

5.2.2 HT 12D
Features: Operating voltage: 2.4V~12V. Low power and high noise immunity CMOS technology. Low standby current. Capable of decoding 12 bits of information. 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. Pair with Holtek_s 212 series of encoders. 18-pin DIP, 20-pin SOP package

General Description:The 212 decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holtek_s 212 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 212 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 unmatched 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 212 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.

Selection Table:-

Block Diagram:-

Fig. 5.5 Block Diagram of Decoder

Pin Assignment:-

Fig. 5.6 Pin Description of Decoder

Pin Description:-

Flow Chart

Vital role of decoder is to decode the code sent by transmitter.

Isolation and gate drive circuit


Figure 5.4 shows the isolation and gate drive circuit. The driver has two main functions: To provide required gate voltage and current to MOSFETs for switching. To transmit the control signals to the bridge circuit faithfully.

PC 817

Fig. 5.4 Isolation and gate drive circuit

TO MOSFET

In the proposed scheme there are four MOSFETs in the single phase bridge inverter. So, separate isolator and driver circuits are used to drive each MOSFET. The pulses available at the output of the logic circuit are given to four individual gate drives (only one is shown in the figure, others are identical). The dc supply required for driver circuit is derived from the dc regulated power supply section. The supply is given to the optocoupler PC 817. The optocoupler consists of an LED and a phototransistor. Transistor BC107 used in the emitter follower configuration which transmits the outputs of phototransistor to gate of MOSFETs at desired level. Resistor R1 limits the current through light emitting diode of integrated circuit PC817. Resistance R1 acts as drive resistance for LED and R3 is designed to sweep out the stored charges at the transistor.

Potrebbero piacerti anche