• No results found

HARDWARE IMPLEMENTATION .1 Complete Schematic of Smart Energy Meter

In document Smart Energy Meter Project Report (Page 48-54)

Fig 4.1: Complete schematic of Smart Energy Meter

4.1.2 Connections of P89C51RD2FN

The pin configuration of P89C51RD2XX:-

Fig 4.2: Pin diagram of P89C51RD2FN

In this project the microcontroller is connected to MAX232, LCD, Keypad, sensors.

The connections of microcontroller are given briefly below:

 Pin1 to pin8 (Port 0) of controller are connected to the data lines of keypad (D0-D8).

 The reset pin is connected to the 9th pin (RST) of P89C51RD2FN, as it is used for set reset the program.

 While the 10pin is connected to the 12th pin of MAX232.

 11th pin of controller is connected to the 11th pin of MAX232.

 The interrupt given by the IR sensors from the 555IC timer should be connected to the 12th pin i.e. INTO pin of controller.

 13th pin is used as an external interrupt, but here in this project there is no use with this pin.

 The crystal oscillator which gives a frequency of 11.0592 MHz for the required Baud rate of 9600Hz to the microcontroller. This crystal oscillator is

connected in between 18th (XALT 1) and 19th (XALT 2) pins of program. Whenever the PSEN pin is connected to ground then we can execute the last dumped program, likewise when 29th pin is connected to VCC then code can be dumped into the controller.

 Address Latch Enable pin (30th pin) of controller is connected to the ground hence no connections need not to be given to this pin.

 External Access Enable or programming supply voltage should be latched when RST is released and any subsequent changes have no effect. This pin also receives the programming supply voltage (VPP) during Flash programming. Hence the pin 31st must be connected to high i.e. VCC.

 Port0 (pins 32 to 39) are connected to LCD in this project. But these should be connected to other peripherals through pull up resistors.

4.1.3 Pin connections of LCD

The LCD used for output display is JHD162A series. The detailed connections of LCD is described briefly as

 The 1st and 2nd pins of JHD162A LCD are connected to ground and high voltage VCC respectively.

 3rd pin of LCD is connected to the centre pin of the potentiometer or variable resistor so as to adjust the contrast of LCD.

 The 4th, 5th, 6th pins are connected to 26th (P 2.5), 27th (P 2.6), 28th (P 2.7) pins

Fig 4.3: connection of LCD with P89C51RD2FN.

4.1.4 KEYPAD CONNECTIONS:

 The keypad used is 4*4 keypad

 The pins 1, 2, 3, 4 which are connected to columns of the keypad are connected to 1, 2, 3, 4(P1.0 to P1.3) pins of the microcontroller respectively.

 The pins 5, 6, 7, 8 which are connected to rows of the keypad are connected to 5, 6, 7, 8(P1.4 to P1.7) pins of the microcontroller respectively.

4.1.5 MAX232 AND DB9 CONNECTION:

MAX232 and DB9 connector plays a key role in program dumping and communication between project kit to the PC host.

 Capacitor C10 of capacitance 1Uf is connected across 1st and 3rd pins of MAX232 and C9 of capacitance 1Uf is connected in between 4th and 5th pins.

 Charge pump capacitors are required for the MAX232 to work it as voltage level shifter. The charge pump capacitors used here are C7 and C8 whose capacitance is 1Uf. C7 is connected between 6th pin and ground, while C8 is connected across 2nd pin of MAX232 and Vcc.

 12th and 11th pins of MAX232 are connected to the 10th and 11th pins of P89C51RD2FN controller respectively. These acts as a transmitter and receiver for the data flow.

 To connect the MAX232 to the PC host we require a medium named as DB9 connector. The 2nd and 3rd pin of the DB9 connector should be connected to the 14th and 13th pins of MAX232 respectively. While the 5th pin is grounded.

4.1.6 IC555 TIMER and IR transmitter connections:

 The sensor is designed using a 555 timer, a IR transmitter and a IR receiver.

 The 555 timer is operated in astable mode of operation.

 The 1st pin is grounded.

 The 2nd pin and 6th pin are shorted, 2nd pin is connected to VCC through the 10K and 220K pot, IR receiver is connected to 2nd pin in reverse bias.

 The pin 3 of 555 timer is an output pin which is connected to the 12th pin (P 3.2) of the microcontroller.

 The 4th pin and 8th pin are shorted, 8th pin is connected to VCC and 0.1µf capacitor is connected between 8th pin and ground.

 The 5th pin is grounded through 0.01µf capacitor.

 The IR transmitter is connected between VCC and ground through 270 ohm resistor. It is connected in forward bias.

 If there is obstruction between transmitter and receiver, the receiver output gives 3V to 5V.

 Whenever there is an obstruction of current between transmitter and receiver, the current passed to receiver decreases and hence the voltage across voltage divider decreases. As a result a short pulse is applied to the port pin of the 8051 microcontroller. On receiving a pulse from the sensor circuit, the controller increments the counter which indicates the consumption of electricity.

The IR sensor implementation using 555 timer is shown in figure below:

Fig 4.4: connection of IR sensors with 555 timers.

CHAPTER - 5

CHAPTER-5

is accomplished by sending a number of initialization instructions to the LCD.

The first instruction to send is the no of data for the LCD i.e., with an 8-bit or 4-bit data bus. The other thing need to specify is display matrix; in the selected LCD it is a 5x8 dot character font. These two options are selected by sending the command 38h to the LCD as a command. The command can give to the LCD by invoking the pre defined function call lcdcmd with passing parameters value of 38H ,the syntax for the same can be given like lcdcmd(0x38).

5.1.2 The initialization sequence code can be given as follows:

lcdcmd(0x38); // 2 lines and 5x7 matrix

lcdcmd(0xC0); // force cursor to begging of 2nd line lcdcmd(0x0E); // display on, cursor blinking

lcdcmd(0x01); //clear display screen

lcdcmd(0x06); // increment cursor (shift cursor right) lcdcmd(0x80); // force cursor to begging of 1st line

In document Smart Energy Meter Project Report (Page 48-54)

Related documents