5. Software Development for Prepaid Energy Meter
The system software is implemented by C language and the developed code is edited, compiled and
debugging by Win-AVR software.
a. Algorithm for Energy Metering system at consumer’s end
1 Start
2 Initialize the display.
3 Decide whether the number of units in Microcontroller is sufficient or not. If the balance is insufficient then disconnect the load from supply otherwise connect to the load to supply.
4 Count the number of pulses initiated from Energy Meter IC AD7751 with the help of counter0 when the load consumes power.
5 Measure time with the help of timer1.
6 Calculate power, P = 3000´ X using this equation, where X denotes the frequency of pulses that is produced by the Energy Meter IC.
7 Calculate energy using the following equation, Units