+ All Categories
Home > Documents > 2.Multitariff Prepaid Energy Meter

2.Multitariff Prepaid Energy Meter

Date post: 05-Apr-2018
Category:
Upload: divya-mathew
View: 236 times
Download: 0 times
Share this document with a friend

of 34

Transcript
  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    1/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Chapter 1

    INTRODUCTION

    The recharging of the user account can be done as in conventional mobile phone

    prepaid recharging. A consumer can collect the prepaid recharging card from elec-

    tricity can be drawn until the amount is finished. If there is no account balance,

    then the electric current supply is disconnected using a relay circuit.

    The energy measurement chip AD7751 computes the instantaneous power by mul-

    tiplying the inputs in current channels and voltage channels.This is fed to a

    counter,thereby obtaining the effective energy consumed.The Real Time Clock

    (RTC) monitors the Time Of Day and the local shops and recharge using mobile

    phone in the specified format. This DTMF data will be processed in the office sec-

    tion and if valid, corresponding amount is credited to the specific consumer by an

    RF module section whose transmitter is in the electricity office section and receiv-

    er integrated with the consumer electricity meter section. Thus, once the amount is

    credited, tariff is varied.

    At the office section, the database of each consumer is assigned a unique code

    along with the consumer consumption balance.The monitoring of the energy con-

    sumption pattern during the day can be monitored.This enables the electricity

    board to keep track of malpractices of over consumption and give warnings if nec-

    essary.The office section also consists of the RF transceiver for varying the con-

    sumer balance.

    DEPARTMENT OF ELECTRONICS ENGINEERING 1

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    2/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    The current variation between the two current channels must not be greater than

    12.5%. In that case, the supply is automatically cut off. The consumer account bal-

    ance is decremented until it becomes les than a minimum value. Below this, a

    warning is given by the beep of a buzzer. The consumer gets a unique code to

    recharge his balance. The consumer authentication code followed by a code corre-

    sponding to a recharge denomination is sent to the office section, which is decod-

    ed and accordingly the balance is updated.

    DEPARTMENT OF ELECTRONICS ENGINEERING 2

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    3/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Chapter 2

    HARDWARE

    2.1: Energymeter section

    The energymeter section calculates the energy consumption using the energy meteringIC AD7751.

    Fig 2.1:Performance curve circuit of AD7751

    The AD7751 is a high accuracy fault tolerant electrical energy measurement IC intended

    for use with two-wire distribution system. The AD7751 incorporates a novel fault detection

    scheme that both warns of fault conditions and allows the AD7751 to continue accurate

    billing.

    DEPARTMENT OF ELECTRONICS ENGINEERING 3

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    4/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    The AD7751 supplies average real power information on the low frequency outputs F1 and

    F2. These logic outputs are used to directly drive an electromechanical counter. The CF

    logic output gives instantaneous real power information. This output is intended to be used

    for calibration purposes.

    The ADCs digitize the voltage signals from the current and voltage transducers.

    These ADCs are 16-bit second order sigma-delta with an oversampling rate of 900 kHz.

    This analog input structure greatly simplifies transducer interfacing by providing a wide

    dynamic range for direct connection to the transducer and also simplifying the antialiasing

    filter design. A programmable gain stage in the current channel further facilitates easy

    transducer interfacing. A high-pass filter in the current channel removes any dc component

    from the current signal. This eliminates any inaccuracies in the real power calculation due

    to offsets in the voltage or current signalssee HPF and Offset Effects section. The real

    power calculation is derived from the instantaneous power signal. The instantaneous power

    signal is generated by a direct multiplication of the current and voltage signals. In order to

    extract the real power component (i.e., the dc component) the instantaneous power signal is

    low-pass filtered.

    Fig 2.2:Signal Processing block diagram

    DEPARTMENT OF ELECTRONICS ENGINEERING 4

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    5/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    2.2: RTC Section

    This section is used to compute the peak hours and vary the tariff accordingly. A

    DS1307 module was used as Real Time Clock.

    The DS1307 Serial Real-Time Clock is a low-power, full binary-coded decimal

    (BCD) clock/calendar plus 56 bytes of NV SRAM. Address and data are transferred

    serially via a 2-wire, bi-directional bus. The clock/calendar provides seconds, minutes,

    hours, day, date, month, and year information. The end of the month date is automatically

    adjusted for months with fewer than 31 days, including corrections for leap year. The clock

    operates in either the 24-hour or 12-hour format with AM/PM indicator. The DS1307 has a

    built-in power sense circuit that detects power failures and automatically switches to the

    battery supply.

    Fig 2.3:Pinout diagram of DS1307

    DEPARTMENT OF ELECTRONICS ENGINEERING 5

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    6/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    The DS1307 operates as a slave device on the serial bus. Access is obtained by

    implementing a START condition and providing a device identification code followed by a

    register address. Subsequent registers can be accessed sequentially until a STOP condition

    is executed.

    The RTC was interfaced with the microcontroller and the time was

    monitored.The peak hours were programmed to have a higher tariff.

    DEPARTMENT OF ELECTRONICS ENGINEERING 6

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    7/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    2.3: DTMF Section

    The Dual Tone Multiple Frequency (DTMF) tones are used to update the

    balance by the consumer. A unique code is sent using a mobile phone by the consumer.The

    recharge can be done in multiples of a certain denomination. The DTMF signals are

    received in the office section and correspondingly the database checked and balance is

    updated accordingly.

    The MT8870D is a complete DTMF receiver integrating both the bandsplit

    filter and digital decoder functions. The filter section uses switched capacitor techniques

    for high and low group filters; the decoder uses digital counting techniques to detect and

    decode all 16 DTMF tone pairs into a 4-bit code.

    DEPARTMENT OF ELECTRONICS ENGINEERING 7

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    8/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 2.4:Pinout diagram of DTMF decoder

    2.4: RF Section

    The function of a radio frequency (RF) transmitter is to modulate, up convert, and amplify

    signals for transmission into free space. An RF transmitter generally includes a modulator

    that modulates an input signal and a radio frequency power amplifier that is coupled to the

    modulator to amplify the modulated input signal which is again coupled to an antenna that

    transmits the amplified modulated input signal.

    The RF transceiver used is CC2500. The CC2500 is a low-cost 2.4 GHz transceiver

    designed for very low-power wireless applications.

    RF Performance

    DEPARTMENT OF ELECTRONICS ENGINEERING 8

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    9/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    High sensitivity (104 dBm at 2.4 kBaud,1% packet error rate)

    Low current consumption (13.3 mA in RX,250 kBaud, input well above sensitivity

    limit)

    Programmable output power up to +1 dBm

    Excellent receiver selectivity and blocking performance

    Programmable data rate from 1.2 to 500 kBaud

    Frequency range: 2400 2483.5 MHz

    Fig 2.5:Pinout diagram of CC2500

    DEPARTMENT OF ELECTRONICS ENGINEERING 9

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    10/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    CC2500 features a low-IF receiver. The received RF signal is amplified by the low noise

    amplifier (LNA) and down-converted in quadrature (I and Q) to the intermediate frequency

    (IF). At IF, the I/Q signals are digitised by the ADCs. Automatic gain control (AGC), fine

    channel filtering, demodulation bit/packet synchronization are performed digitally.The

    transmitter part of CC2500 is based on direct synthesis of the RF frequency. The frequency

    synthesizer includes a

    completely on-chip LC VCO and a 90 degrees phase shifter for generating the

    I and Q LO.

    The energy consumption balance updation value is sent to the office section by the RF

    transceiver.The balance in the database of the consumer is incremented

    correspondingly.The reception side is a RF transceiver which receives the data and gives it

    to the control unit microcontroller which does the updation.

    2.5: LCD Module

    A liquid crystal display (LCD) is an electronically-modulated optical device

    shaped into a thin, flat panel made up of any number of color or monochrome pixels filled

    with liquid crystals and arrayed in front of a light source (backlight) or reflector. It is often

    utilized in battery-powered electronic devices because it uses very small amounts of

    electric power.

    DEPARTMENT OF ELECTRONICS ENGINEERING 10

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    11/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 2.6:LCD pinouts

    Register select: Two types of registers

    * Command Code Register: When RS=0, command code register will be selected.

    * Data register: When RS=1, data register is selected.

    Read/Write: R/W input allows the user to write information to LCD or read information

    from it. The data that is being currently displayed will be stored in a buffer memory

    DDRAM.

    R/W=0-Reading

    R/W=1-Writing

    E-Enable:

    The enable pin is used by the LCD to latch information at its data pins. When data is sup-

    plied to data pins, a high to low pulse must be applied to this pin in order for the LCD to

    latch the data present in the data pins.

    DEPARTMENT OF ELECTRONICS ENGINEERING 11

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    12/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 2.7 Interfacing LCD with AtMega32

    2.6: Power supply

    DEPARTMENT OF ELECTRONICS ENGINEERING 12

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    13/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    The ac voltage (240V), is connected to a transformer, which steps down that ac

    voltage to a level of the desired dc output. A diode rectifier then provides a full-wave

    rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage.

    This resulting dc voltage usually has some ripple or ac voltage variation. A regulator circuit

    removes the ripples and also retains the same dc value even if the input dc voltage varies,

    or the load connected to the output dc voltage changes. This voltage regulation is usually

    obtained using one of the popular voltage regulator IC units.

    Fig 2.8:Block diagram of power supply

    Chapter 3

    DEPARTMENT OF ELECTRONICS ENGINEERING 13

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    14/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    CIRCUIT DESIGN

    3.1 Energymeter section:

    The output frequencies obtained in F1,F2 and CF can be calibrated according to the

    following table.

    Table 3.1:Frequency calibration table

    The user can select one of four frequencies.This frequency selection determines the maxi-

    mum frequency on F1 and F2. These outputs are intended to be used to drive

    the energy register. Since only four different output frequencies can be selected, the avail-

    able frequency selection has been optimized for a meter constant of 100 imp/kWhr with a

    maximum current of between 10 A and 120 A.

    The computation of power by the IC is done as:

    DEPARTMENT OF ELECTRONICS ENGINEERING 14

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    15/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    (1)

    (2)

    the real powerPcan be expressed

    in terms of its fundamental real

    power (P1) and harmonic real pow-er (PH).

    (3)

    Design of Analog inputs:

    DEPARTMENT OF ELECTRONICS ENGINEERING 15

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    16/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 3.1: Typical connection for Channel 1

    Here the analog inputs are being used to monitor both the phase and neutral currents. Be-

    cause of the large potential difference between the phase and neutral, two CTs (currenttransformers) must be used to provide the isolation. Notice both CTs are referenced to

    AGND (analog ground), hence the common-mode voltage is 0 V. The CT turns ratio and

    burden resistor (Rb) are selected to give a peak differential voltage of 660 mV/gain.

    Fig 3.2:Typical connections for Channel 2

    Here a PT(potential transformer) is used to provide complete isolation

    from the mains voltage.

    3.2 RF section:

    DEPARTMENT OF ELECTRONICS ENGINEERING 16

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    17/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 3.3: Configured CC2500 transceiver

    The CC2500 transceiver is configured in both energymeter and office section to

    work at a frequency of 2.400GHz and baud rate 9600.

    METER SECTION CIRCUIT DIAGRAM

    DEPARTMENT OF ELECTRONICS ENGINEERING 17

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    18/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 3.4: Meter section circuit diagram

    OFFICE SECTION CIRCUIT DIAGRAM

    DEPARTMENT OF ELECTRONICS ENGINEERING 18

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    19/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 3.5: Office section circuit diagram

    Chapter 4

    SOFTWARE

    DEPARTMENT OF ELECTRONICS ENGINEERING 19

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    20/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    4.1 Meter section program flowchart

    DEPARTMENT OF ELECTRONICS ENGINEERING 20

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    21/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Fig 4.1: Meter section program flowchart

    4.2 Office section program flowchart

    DEPARTMENT OF ELECTRONICS ENGINEERING 21

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    22/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    NO

    YES

    DEPARTMENT OF ELECTRONICS ENGINEERING 22

    START

    INITIALISE

    SLEEP

    ENABLE INTERRUPT

    INITIALISE USART

    IF

    INTERRU

    PT?

    C

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    23/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    NO

    YES

    Fig 4.2:Office section program flowchart

    4.3 Programs

    DEPARTMENT OF ELECTRONICS ENGINEERING 23

    C

    CONSUMER NUMBER= DATA(0-

    CARD NUMBER= DATA(4-7)

    CHECK THE CONSUMER & CARD

    NO WITH DATABASE

    IFMATCH?

    SEND THE CORRESPONDING CODE

    RETURN

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    24/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    #include

    #include

    #include

    #include

    #include

    #include

    #include "I2C.h"

    #include "lcd.h"

    #include "ds1307.h"

    #ifndef F_CPU //define cpu clock speed if not defined

    #define F_CPU 8000000

    #endif

    #define BAUDRATE 9600 //set desired baud rate

    #define UBRRVAL ((F_CPU/(BAUDRATE*16UL))-1) //calculate UBRR value

    #define RADDR 0x44 //define receive parameters

    #define eetariff1 0x1E

    #define eetariff2 0x2E

    #define eebalance 0x3E

    #define tar1 0x05

    #define tar2 0x0A

    #define lowerlimit 0x05

    void USART_Init(void)

    {

    //Set baud rate

    UBRRL=(uint8_t)UBRRVAL; //low byte

    UBRRH=(UBRRVAL>>8); //high byte

    UCSRC=(1

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    25/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    (0

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    26/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    uint8_t rxdata,temp,balance;

    rxdata=USART_vReceiveByte();

    temp=rxdata&0xf0;//get upper nibble to get receiver address

    if(temp == 0x04)

    {

    rxdata &= 0x0f;

    balance= eeprom_read_byte(eebalance);

    balance+=rxdata;

    eeprom_write_byte(eebalance,balance);

    }

    }

    void cutoff()

    {

    PORTD|=(1

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    27/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    /*void display1(uint8_t totalkwh1,uint8_t tariff1,uint8_t balance)

    {

    LCDClear();

    LCDGotoXY(1,1);

    LCDWriteInt(totalkwh1,5);

    LCDWriteString("KWH");

    LCDGotoXY(10,1);

    LCDWriteString("T:R");

    LCDWriteInt(tariff1,2);

    LCDWriteStringXY(1,2,"BAL:R");

    LCDWriteInt(balance,5);

    }*/

    void settime()

    {

    uint8_t hr,min,sec,am_pm,temp;

    hr=8;

    min=30;

    sec=44;

    am_pm=0;

    temp=((sec/10)

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    28/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    temp=((hr/10)4);

    DEPARTMENT OF ELECTRONICS ENGINEERING 28

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    29/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    Time[5]=':';

    DS1307Read(0x01,&data);

    Time[4]=48+(data & 0b00001111);

    Time[3]=48+((data & 0b01110000)>>4);

    Time[2]=':';

    DS1307Read(0x02,&data);

    Time[1]=48+(data & 0b00001111);

    Time[0]=48+((data & 0b00010000)>>4);

    //LCDClear();

    //LCDWriteStringXY(2,1,Time);

    //AM/PM

    /*if(data & 0b00100000)

    {

    LCDWriteStringXY(11,1,"PM");

    }

    else

    {

    LCDWriteStringXY(11,1,"AM");

    }*/

    //Wait Some time and keep testing key input

    }

    DEPARTMENT OF ELECTRONICS ENGINEERING 29

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    30/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    uint8_t findtariff(char time[12],uint8_t data2)

    {

    uint8_t tariff;

    if(data2 & 0b00100000)

    {

    if(time[1]>=7 & time[1]

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    31/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    uint8_t temp;

    DS1307Read(0x00,&temp);

    temp&=(~(1

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    32/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    {

    cutoff();

    }

    else

    {

    gettime(Time,data);

    tariff=findtariff(Time,data);

    cuton(); //display1(totalkwh,tariff,balance);

    count=TCNT1;

    unit=count/64;

    rem=count%64;

    TCNT1=rem;

    totalkwh+=unit;

    gettime(Time,data);

    tariff=findtariff(Time,data);

    amt=unit*tariff;

    balance-=amt;

    eeprom_write_byte(eebalance,balance);

    delayms(25);

    }

    }while(balance>lowerlimit);

    }

    CONCLUSION

    DEPARTMENT OF ELECTRONICS ENGINEERING 32

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    33/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    The project Multitariff prepaid energymeter provides a comprehensive

    solution to the requirement of human labour for energy consumption billing.It also

    provides flexibility for the consumers to have a pre-payement option, thereby providingconvenience. The variable tariff billing features ensures the monitoring of domestic energy

    consumption at various timings and charge more for peak hour consumption.

    DEPARTMENT OF ELECTRONICS ENGINEERING 33

  • 8/2/2019 2.Multitariff Prepaid Energy Meter

    34/34

    MODEL ENGINEERING COLLEGE MULTITARIFF PREPAID ENERGYMETER

    FUTURE ENHANCEMENTS

    -The energy consumptions readings can be sent through power lines.

    -The electricity board can monitor the consumptions at different timings by each consumer

    and can send notifications in case of high peak hour consumption.


Recommended