Sunteți pe pagina 1din 5

Towards Design of a Smart Prepaid Gas Metering System

T. H. Khan, T. K. Paul, G. M. Shahabuddin, K.Wahid, A. H. Chowdhury, and S. M. L. Kabir


Institute of Information and Communication Technology,
Bangladesh University of Engineering and Technology, Bangladesh

Dept. of Electrical and Computer Engineering, University of Saskatchewan, Canada


E-mail: tak488@mail.usask.ca

below the warning level, the meter shows warning


icons and when credit reaches zero, the meter closes its
valve and thus stops further gas to flow to the
consumer. To buy credit, the consumer will have to go
to the vending station with the smart card and money.
In the vending station, user will pay the money and the
bought credit will be written in the smart card. Then
the consumer will punch the smart card to the meter
and the meter will be recharged with the bought credit.
In prepaid billing system, the consumer will be always
conscious about the remaining credit and thus try to
use gas carefully and stop its misuse. Furthermore, in
contrast with postpaid billing, the consumer can buy
credit at any time of the month from the vending
station, thus removing the pain for waiting in the long
queue at the beginning of the month in the bank. Also
in prepaid scheme, as there is no human meter reader
involved in the entire system, corruption in billing will
be stopped. Another advantage in the prepaid scheme
is that the gas transmission and distribution companies
get the money quickly and accurately which certainly
help them to revenue more.
The prepaid gas meter is a microcontroller based
system and it needs electrical power to operate. We
propose to use a removable single module consisting of
a battery charger and rechargeable battery. The
module can be connected directly with the home 220
volt or 110 volt AC supply to charge the battery. After
the battery is charged, the module can be connected
back to the gas meter. Thus it will eliminate the
overhead of the users to buy new batteries time to time.
Also the users do not have to go to shops to buy
batteries at odd times like at middle of the night as it
can be recharged in the home within a very short time.
The rest of the paper is organized as follows. In
Section 2, related works are discussed. Section 3
describes the overall system architecture and its
components. Section 4 discusses the developed
prototype and its performance and lastly Section 5
concludes the paper.

Abstract
Gas is an important source of energy in this world.
At this age of energy crisis, gas must be utilized wisely
and carefully. In this paper, a design of a smart card
based prepaid gas metering system has been presented.
Prepaid gas meter will make the consumers more
conscious to utilize gas carefully and also it promises
easy, fast and accurate billing scheme. The entire
system is designed with the state-of-the-art digital and
information technology. A prototype of the system has
been developed and tested.

1. Introduction
Gas is a major natural source of energy in this
world. It is used in every civilized country for
domestic, commercial and industrial purpose. In some
countries, the monthly gas bill for domestic consumers
is a fixed amount based on the number of burners they
are using. As the consumers need to pay a fixed
monthly bill, little attention is paid to use the gas
resource carefully. In some places, postpaid gas meters
are installed where the consumers are billed based on
the meter readings. But the disadvantage of this system
is that a human meter reader needs to visit every house
to collect the meter readings for calculating bills. This
is a tiresome, lengthy and error prone process. Also it
opens the human meter reader a door for doing
corruption. In postpaid system, the monthly bill is sent
to the consumer by postal mail and at the beginning of
the month all the gas users often need to gather in a
long queue to pay the bills. This procedure is tiresome
and time consuming.
In this paper, a prepaid gas metering system has
been proposed. Each consumer will have a digitally
designed prepaid gas meter installed in their home,
office or industry. The consumers will also have a
smart card. When gas passes through the meter, the
credit in the meter is decreased. When the credit goes

978-1-4244-5700-7/10/$26.00 2009 IEEE

55

2. Related Work

Master
Station

In [9], a design of a prepaid gas meter is presented.


But no attention is paid on how the meter will get the
electrical power and on power saving issues. For
instance, according to their design, a solenoid valve is
used to stop the gas flow which will always consume
12 watt power when gas is stopped. This large power is
impractical to provide using 1.5 volt batteries. Also,
optical sensor is used to get pulse to the meter which
will consume power at all times. Also, the issue of
stopping the gas supply, when there is no power in the
meter is not handled. On the other hand, the design
presented in this paper takes care in hardware and
firmware to save battery power. For instance, a dc
motor based latching valve is used which consumes
only about 0.5 watt of power only for a few seconds
when the motor is rotating. Also, permanent magnet
based reed switch is used instead of optical sensor to
save power. The battery power is always monitored by
the meter and a mechanism has been developed to stop
gas flow when battery is down or the battery is
intentionally removed from its casing by the user.

Internet

Vending
Station

Vending
Station
Smart Card

Gas
Meter

Gas
Meter

Gas
Meter

Gas
Meter

Gas
Meter

Gas
Meter

Figure 1. Architecture of the prepaid gas


metering system
The most important design constrain for the electrical
hardware unit of the prepaid gas meter is the power
consumption. As it is running on battery power, the
power consumption of the circuit must be as low as
possible. The block diagram of the prepaid gas meter is
shown in Fig. 3. and its several components are
discussed below.

3. System Architecture
Prepaid gas meters will be installed in home, office
or industries. For a specific region, there will be a
vending station from where the users will buy credit.
The vending stations hold the regional user database
and billing software. The communication between the
meter and the vending station is done by smart card.
All vending stations are connected with a central server
called the master station through the Internet. Master
station holds the integrated database of all the vending
stations, user account creation software and overall
system analysis tools. The overall system architecture
is shown in Fig. 1. A brief description of each
component of the system is discussed below.

Figure 2. Mechanical counter with reed switch


3.1.1. MCU A low cost 8 bit AVR microcontroller
(ATmega88) [2][3] is used as the MCU which has
8KB of program memory, 1KB byte of SRAM, and 512
byte of EEPROM. It also has analog comparator, 10
bit Analog to Digital Converter (ADC), external
interrupt sources and general purpose input/output
ports. The MCU is constructed on pico-power
technology [1][6], which makes the MCU to consume
ultra low power at sleep modes. The master clock
frequency is chosen to only 128 kHz because the lower
the clock frequency, the lower the power consumption
of the MCU [5].

3.1. Prepaid Gas Meter


The prepaid gas meter takes a mechanical
diaphragm of a postpaid gas meter as the base meter. A
reed switch [7] with magnet is connected on the right
most wheel of the mechanical counter of the gas meter
as shown in Fig. 2. When the right most wheel rotates
once, the reed switch closes and gives electrical pulse
to the MCU. The rightmost three digits are the fraction
part and the rest are the integer part of the gas volume
(m3) counter. Thus when one pulse is received by the
MCU, the MCU recognizes that 0.01 m3 volume of gas
has passed through the meter.

56

Power Bus

Relay

credit, total gas consumed, battery status, etc. are


shown. To save power, the LCD is not always turned
on. When the user presses a push button switch which
is placed at the side of the LCD, the information is
shown once and then the LCD is turned off.

Rechargeable Battery
& Charger

Fixed Battery

Valve

LCD
MCU

Enquiry
Button

Smart
Card

Voltage
Sampler
& Low
Voltage
Detector

3.1.5. Smart card unit A smart card reader/writer is


interfaced using the serial three wire bus protocol with
the MCU to read/write data to smart card. The smart
card readers Reset and Clock pins are connected with
two output ports of the MCU. The Data pin is
connected with a port which can be configured both in
input and output direction so that data can both be read
and write to smart card. We have used an SLE4428
type smart card [8] which has 1KB of non-volatile
memory and it is write-protected by a 16 bit password.
Different meter settings and meter status variables are
mapped in different memory locations of the smart
card.

Pulse
from
Reed Switch

Figure 3. Block diagram of the prepaid gas


meter
3.1.2. Pulse unit The pulse received from the
mechanical counters is connected with an external
interrupt pin of the MCU.

3.1.6. Voltage sampling unit The battery voltage is


sampled using a voltage divider circuit. The sampled
voltage is then fed to the ADC input of the MCU. The
MCU reads the ADC value after each 1m3 gas is
consumed. If the battery voltage falls below the
warning level, an icon on recharge battery is shown on
the LCD.

3.1.3. Latching valve The valve is placed on the inlet


of the gas meter diaphragm. The valve is constructed
with a DC motor. When the motor runs in one
direction, the valve is closed and when it runs in the
opposite direction, the valve is opened. To drive the
DC motor in both directions, an H-bridge circuit [4] is
used as shown in Fig. 4. The MCU sends signal to the
H- bridge circuit to run the motor in the desired
direction.

3.1.7. Battery low/remove detection unit The analog


comparator of the MCU is used to detect the minimum
allowable battery voltage or sudden removal of battery
from the battery-casing of the meter. When voltage
falls below the minimum level, the comparator triggers
an interrupt routine which turns on a relay to get power
from a fixed battery which is placed inside the meter.
Then the MCU saves meters SRAM data to
EEPROM, closes the valve and then turn off the relay
to remove power from the MCU. After the
rechargeable battery is recharged and put back to the
meter, the meter starts running from its last saved state.
Here it is important to note that the ADC can also be
used for this purpose. If ADC is used then, the ADC
must be running at all times to detect the low battery or
sudden removal of battery. As running ADC all times
will take more power than running the analog
comparator, the ADC is not used for this purpose.
3.1.8. Rechargeable battery and charger unit The
battery charger circuit consists of a Switch Mode
Power Supply (SMPS), a constant current charging
circuit, an analog comparator to detect whether the
battery is fully charged or not, a switching transistor to
turn off charging after the battery is fully charged, and
charge status indicator Light Emitting Diodes (LED).

Figure 4. Latching valves motor control


H-bridge circuit
3.1.4. Display unit A 16x2 character (HD44780)
Liquid Crystal Display (LCD) is used as the display
unit. In the display, information like the remaining

57

consists of a sever PC, a smart card reader/writer and a


slip printer to print receipts.

The rechargeable battery is also packed with the


charger circuit which groups them as a single module.
When battery voltage is low, the user will remove this
module from the meter and connect it with 220 volt or
110 volt AC supply to charge the battery. After the
battery is charged, the module will be put back to the
meter.

Mater Station
Database

Internet

Start
PC
Initialize
Smart Card
Reader

Slip Printer

Idle
Pulse
Interrupt

Smart Card
Interrupt

Cut Credit

Add Credit

Sample
Voltage

Get New
Settings
from SC

Update
Valve
Status

Copy Meter
Status to SC

Battery Low
Interrupt

Figure 6. Block diagram of vending station

Switch to
Fixed
Battery

When a user needs to buy credit, he/she goes to the


local vending station with the smart card and money.
To keep the database of the vending station up-to- date,
users are advised to punch the smart card in the meter
before coming to the vending station. When the card is
punched, the meters last status is copied to the smart
card. In the vending station, the last status of the meter
is firstly read from the smart card and save it in
database. Then according to the users demand,
vending station writes the bought credit and also writes
other new meter setting information like warning gas
volume, warning battery voltage level etc. in the smart
card. When the user returns home and punch the smart
card in the meter, the bought credit is added with the
remaining credit and the new meter settings are
activated. Vending stations maintain relation with the
master station through internet. Vending station
uploads all the meter status and vending data to the
master station and it downloads the latest meter
settings from the master station.

Save Data to
EPROM
Close Valve

Shutdown

Figure 5. Flowchart of the prepaid gas meter


firmware
The firmware inside the MCU is constructed with
two layers. The bottom layer is the hardware driver
layer which consists of routines for driving latching
valve, LCD and smart card. The upper layer is the
application layer which consists of credit calculation
and other meter operational logic. The firmware is
written in such a way that the MCU is always kept at
idle mode to save power. When an external interrupt
like pulse or smart card insertion occurs, the MCU
breaks from the idle mode and then serves the interrupt
routine and again go back to the idle mode. The flow
chart of the application layer is shown in Fig. 5.

3.3. Master Station


Master station holds the integrated database of all the
vending stations. Creation, edition and deletion of
users account are also done from here. In the master
station, the values of the meter settings variables are
set. User transaction report or meter status report of
any user can be generated from here. As the master
station holds the integrated database of all the vending
stations, the overall analysis of the system can be done
from here.

3.2. Vending station


Vending station is the office where prepaid gas meter
users go to buy credits. It holds the database of all the
local users. Every user of the prepaid gas meter has a
smart card, which establishes the connectivity between
the gas meter and the vending station. Fig. 6 shows the
basic components of a vending station. It mainly

4. Prototype development
Based on the design discussed above, a prepaid gas
meter has been constructed and assembled in the

58

laboratory. We simulated high rate of gas flow by


connecting an electronic wind blower at the inlet of the
gas meter and verified its performance. We have also
tested its performance at different worse case
conditions like at low battery voltage, sudden removal
of battery at critical code sections, and the meter
showed satisfactory performance. We have used four
1.5 volt rechargeable batteries having the capacity
3800mA hour. The current consumption at different
states of the meter is shown in Table 1.

5. Conclusion and future work


In this paper, the advantages of a prepaid gas
metering system and its design components have been
discussed. A prototype of the system has been
developed and tested successfully. Our future work
includes using super capacitor instead of using fixed
battery inside the meter and develop the entire system
in FPGA and later in ASIC. Also, real time clock can
be interfaced with the meter so that when credit
finishes at night or at holydays, the meter will not close
the valve at that time, rather continue with negative
billing and finally close the valve at working hours.

Table 1. Current consumption at different


meter states
Meter State
Idle
Gas Flowing
LCD Displaying
Smart Card Busy
Valve Rotating

Current Consumption
(mA)
3.3
3.5
3.9
65
70

REFERENCES
[1] A. M. Holberg and A. Saetre, Innovative Techniques
for Extremely Low Power Consumption with 8-bit
Microcontrollers, available at www.atmel.com, 2009
[2] Atmel AVR RISC,
http://www.atmel.com/products/avr/default.asp. 2009
[3] Atmega88 Microcontroller Datasheet,
www.atmel.com/dyn/resources/prod_documents/doc254
5.pdf
[4] Discover Circuits,
http://www.discovercircuits.com/H/hbridge.htm. 2009
[5] J. Panfil, 8-bit Microcontroller Drives Battery-Powered
Thermostat, published in Atmel Application Journal,
2008
[6] picoPower Technology,
http://www.atmel.com/ad/picopower/aber, 2009
[7] Reed Switch Developments Corporation,
http://www.reedswitchdevelopments.com/, 2009
[8] Smart Card Zone,
http://www.smartcardzone.com/datasheets/SLE4428data
sheet.pdf, 2009
[9] M.F. Khan, A. Zoha, and R.L Ali, Design and
Implementation of Smart Billing and Automated Meter
Reading System for Utility Gas, published in
International Conference on Information and Emerging
Technologies, pg 1-6, 2007.

The meter remains in the idle and gas flowing states at


most of the time. The LCD is shown only when a user
presses the enquiry button. The other remaining states
generally will occur only for few seconds in a month.
Considering the meter will consume on average 5mA
of current, the rechargeable battery will be able to
supply power to the meter for one month. After one
month, the batteries need to be recharged. On the
server side, one vending station and one master station
have
been
developed.
User
account
creation/edition/deletion, vending operation, report
generation etc. are tested successfully.

59

S-ar putea să vă placă și