Bluetooth Technology For Automatic Meter Reading Computer Science

Essay add: 21-10-2016, 20:54   /   Views: 42

In this chapter we will explore more about how meter reading is done, the different type of techniques that exist to read meters, and automatic meter reading; specially the use of Bluetooth technology for automatic meter reading. A world wide view will be explored before we look to the context of Mauritius.


A meter is a device that can detects and displays the exact quantity of an element, substance or any quantifiable matter, may it be electrons, water, gas, glucose and many others.

There are many uses of meters and in many different sectors of our world. For example, in health sector; meters are used to measure the level of glucose in the blood, to measure pulse rate, and many others. The utility sector, like gas, water or electricity companies, uses a very large numbers of meters. These companies have to monitor the usage of the resources used by their customers so that they can be charged for the amount they have used. There are also other meters like: gauss meters, geomagnetic meters, microwave meters, and many more.

As we have seen, there are many sectors in which meters are being used; we cannot focus our attention in all of them. So, we will concentrate our effort in the utility sector, more specifically the one for electricity companies. Why this choice? Because Energy sector is a driving force in our world and that many developments and advances are thanks to electricity. So from here on we will focus our attention on that specific domain.

Types of meters

There are many types of meters depending on the area of use. The main types of electric meters are:

Electromechanical Induction Meter (Standard Meter): It is a meter which counts the number of turns an aluminium disc does. The amount of electricity used is directly proportional to the number of revolutions of the aluminium disc. The electricity is measured in kilowatt-hours and the rate of charge remains constant all over the day. These types of meters are commonly used on single phase alternating current supply.

Electronic Meters: These meters have an electronic display and make use of wireless technologies like Bluetooth, GSM and GPRS to transfer information about electrical consumption. They have inbuilt automatic sensors which helps to detect electrical energy theft or meter tampering.

Prepaid meters: are like the standard meters; the only difference is that, instead getting a bill at the end of the month, it is a pay as you use service. I.e. the consumer pays in advance for the electricity consumption.

Smart meter: These meters record the amount of electricity consumption for a certain period of time. The recorded data is then sent to the utility company for monitoring and billing purposes. Smart meters can transfer data from and to the meter, i.e. it is a two way communication.

Meter reading

Electric meters measure electricity mostly in kilowatt hour (kWh). One kilowatt hour is equal to the amount of energy used by a load of one kilowatt over a period of one hour, or 3,600,000 joules. The meter reading process is done periodically, so that consumers can be billed for that period of time. There are different methods used by different companies for metering. There are two ways that can be identified. Namely: the traditional way and new techniques.

The traditional way, which uses the 'standard meter', can be described as: The meter reader goes to the consumer's place. There, the meter reader reads the current value on the meter and note it down on the bill for the previous electricity consumption period. The bill is then given to the consumer. The meter reader will then enter the current value in the company's system, so that the consumer can be billed for that current period.

The new techniques, which uses, electronic and smart meter are as follows: The meter reader makes use of new technologies to read the meter value, and meters have an electronic display. There are many different new techniques used for meter reading, and they will be further elaborated below.

Automatic meter reading (AMR)

Automatic meter reading (AMR), is the technology where data about consumption and the status of the meter device is collected automatically. The data is sent to a central database for it to be analysed and billing purpose. Meters for water, gas, and electricity can use the AMR technique.

With the uses of AMR, there can be one way or two-way communication. In the one way communication, query is done only to know the reading value from the meter. Whereas in the two way communication; functions can also be implemented to the meter.

Techniques for automatic meter reading

There are several techniques for automatic meter reading; some of them are listed below.

Touch Technology

In the touch technology, a meter reader have a device, it may be a handheld computer or specialised data collection device. When the meter reader in close range to the meter; the latter press a button. A signal is sent firm the device to the meter and the reading of the meter is saved on the device. That saved data is downloaded to a data collection computer for billing purpose. This technique is also referred as "on-site" AMR, as the meter reader needs to go on site to read the meter reading.

Radio Frequency Network

As its name suggest, the network uses radio wave to communicate with the meters. There are automatic reading systems which uses the radio based technology such Wi-Fi, ZigBee, Bluetooth and many others. Some of them are listed below.

Handheld: a meter reader collects meter reading from meters which support AMR system. The meter reader carries a portable computer with a radio frequency receiver and transceiver which reads the meter readings value. [2]

Mobile: it is also referred to as "drive-by" is a technique where the meter reading device is installed in a vehicle. The meter reader needs only to drive the vehicle along the path where the meters are found and the meter reading value is read automatically by the device installed in the vehicle. [2]

Fixed network: it is a method where there is a network which is installed permanently to read meter reading. The network consists of many repeaters, collectors and a lot of other equipments so that values read are transferred to a central database. This method does not need the intervention of any human to read the metering value.

Some time a hybrid AMR system is implemented so that when the fixed network goes down, the mobile system come into action. [2]

Assessing the traditional meter reading and AMR

The advantage and disadvantage of both traditional meter reading and AMR techniques are listed in the table below.

Traditional Meter ReadingAdvantageDisadvantage

Creation of job, as more people are needed to perform meter reading

Social contact with consumers

There can be error when reading the value.

Difficult to detect fraud on meters.

Some people consider the meter reader as an intruder in their privacy.

Security of the person performing the reading the person may be attacked by dogs

Table 2‑1: Traditional Meter Reading

Automatic meter readingAdvantageDisadvantage

Enable theft detection.

More accurate meter reading.

Reduce operating cost.

There is no need to enter consumer's property (except for exceptional cases).

If the system is down, billing will be affected.

The use of radio waves can be a source of concern to a minority of people

Table 2‑2: AMR

Existing system using Automatic Meter reading

There are many AMR systems implemented in many in different countries and using many of the different techniques listed above. Some of the existing AMR systems are listed:

New Mexico Gas Company is using the AMR service. This has greatly helped to improve the working of the company. [4]

"The Ontario government introduced legislation on Nov. 3, 2005 to start the process of getting "smart meters" into every home and small business in the province by 2010". [5]

"Meridian Energy has started replacing traditional electricity meters with new smart electricity meters which will set a new benchmark for electricity retailing in New Zealand" [6]

Existing system of Bluetooth enable meter reading

There are some companies which are using Bluetooth enabled meter for the reading of their meters, and there are some supplies of Bluetooth enabled meters. The topic is further developed below.

Existing system

"Cambridge Consultants has delivered a prototype design of a Bluetooth-based radio module to the leading utility metering company, Actaris. Based on a single-chip Bluetooth device, the module provides new opportunities to drive down the cost of remote metering, allowing meters to be wireless-enabled at very low cost and opening the door to high-integrity consumer-activated schemes. Consumers with Bluetooth mobile phones, laptops or PDAs would have the option of taking meter readings themselves and communicating them to the utility company over the internet or GSM." [7]

Bluetooth enabled meters suppliers

There are many suppliers of Bluetooth enabled meters. Some of the suppliers are listed below.

Landis+Gyr, is a company which design and manufactures electricity meters. This company have also design a Bluetooth reading system where they can read meters using Bluetooth. [8]

Figure 2‑1: Bluetooth reader [8]

Metex Corporation limited is a company which is manufacture meter readers, and the company has meters with Bluetooth technology. These meters can be used in an AMR system. [9]

Current situation in Mauritius

In Mauritius, we have the Central Electricity Board (CEB), Central Water Authority (CWA) and Waste Water Authority (WMA) as the main utilities companies. All these utilities companies are using the traditional way for their billing purposes. .I.e. a meter reader will go home by home and read their respective standard meter.

The CEB is doing research on how to implement automatic meter reading and they have some electronic meters for testing purposes. CEB has also intention to implement prepaid meters.

The AMR system on which CEB is experimenting consist of meter which has a modem. Then a communication is set with the modem and concerned data is read. That data is used for the billing purpose. As mentioned, the system is still at a testing phase, so a lot are still need to be done. To be able to implement AMR system all standard meters need to be changed to AMR supported meters, and meter readers need to be trained to be able to use the new system.

Bluetooth TechnologyWhat is Bluetooth?

Bluetooth is a wireless technology for short range communications which was developed to replace the cables connecting devices, may it be fixed or portable ones. Such devices are; mobile phones, printers, cameras, desktop computer, and many others. The Bluetooth technology is a low power, low cost and maintains high levels of security.

"Bluetooth technology operates in the unlicensed industrial, scientific and medical (ISM) band at 2.4 to 2.485 GHz, using a spread spectrum, frequency hopping, full-duplex signal at a nominal rate of 1600 hops/sec." [10]

The Bluetooth Special Interest Group (SIG), an organization of several companies work together to maintain and develop the Bluetooth technology. [10]

The name "Bluetooth" comes from Danish King Harold Bluetooth. He was influential in uniting warring factions in parts of what is now Norway, Sweden and Denmark. [11]

Bluetooth technology can withstand interference from wireless technologies which uses the 2.4 GHz spectrum. Adaptive frequency hopping (AFH) of Bluetooth technology detects other devices in the spectrum and avoid the frequency they are using. [11]

According to Martin Reynolds, an analyst with Gartner Group's Dataquest, "The thing about Bluetooth is that it really will ship in the billions of units once it gains momentum. It's really a multibillion-dollar market." [12]

Bluetooth Logo

Figure 2‑2: Bluetooth logo [13]

Bluetooth range

Bluetooth radio waves use certain amount of energy and can goes up to a maximum of certain diameter. The table below show Bluetooth class and its limit up to where it can go.

ClassPower use (mW)Range (approximate) in meters1









Table 2‑3: Bluetooth class range


There are two type of network:

Piconet: is made up of one master and one or more slaves but only up to a maximum of seven active slaves at a time. The device initiating the connection automatically becomes the master and is the master of the piconet. Slaves may not communicate directly with each other; they can only communicate with the master and transfer data when they are granted transmission time by the latter. Slaves synchronize their frequency hopping with the master using the master's clock and Bluetooth address.

Figure 2‑3: Typical piconet [14]

Scatternet: Multiple piconets with overlapping coverage areas form a scatternet. Each piconet may have only one master, but slaves may participate in different piconets on a time-division multiplex basis. A device may be a master in one piconet and a slave in another or a slave in more than one piconet.

Figure 2‑4: Typical scatternet [15]

Bluetooth protocol stacks

The Bluetooth protocol stack allows Bluetooth devices from different manufactures to work with one another. Some of Bluetooth protocol stacks

 LMP (Link Management Protocol); configure and control links to other devices.

 L2CAP (Logical Link Control & Adaptation Protocol); links upper layer protocols over the Baseband and the passing on of quality of service information.

RFCOMM (Cable replacement protocol): protocol provides emulation of serial ports over the L2CAP protocol.

 Service Discovery Protocol; provide a way for discovering services provided by or available through a Bluetooth device. It also allows applications to know about the characteristics of the services which are available.

 HCI (Host/Controller Interface); access the hardware status and control register. It also provides a command interface to the Link Manager and Baseband Link Controller.

Bluetooth radio is a transceiver which transmits and receives modulated Bluetooth radio waves for the devices.

Figure 2‑5: Bluetooth protocol stacks [15]

Bluetooth profiles

Bluetooth profiles help two devices which have the same profile to communicate with each other. Each Bluetooth device must support at least one profile. There are a wide range of Bluetooth profiles that explain many different types of applications.

Generic Access Profile (GAP): Provides the basis Bluetooth functionality for all profiles. Some of the functionalities are like setting up L2CAP links, handling security modes and discoverable modes.

Serial Port Profile (SPP): Provides serial port (RS-232) emulation based on the RFCOMM part of the Bluetooth stack.

Dial Up Networking Profile (DUNP): Defines how to a Bluetooth device can be used as a Dial Up Networking gateway

FAX Profile: Defines how a Bluetooth device can be used as a FAX gateway

Headset Profile: Defines what is required to transfer audio e.g. a wireless Bluetooth headset

LAN Access Point Profile: Defines how a Bluetooth device can be used as a LAN access point

Generic Object Exchange Profile (GOEP): Provides support for the OBjext EXchange (OBEX) protocol over Bluetooth links

Object Push Profile: Defines how to exchange vCard and vCalendar objects, based on the GOEP

File Transfer Profile: Defines functionality of how to navigate through folders and copying, deleting or creating a file or folder on a Bluetooth device, based on the GOEP.

Figure 2‑6 : Bluetooth Profiles [16]


Short transmission range up to a maximum of 100 meters with class 1.

Low Power: Bluetooth takes relatively low power, thus it is suitable for devices with restricted battery capacity.

Interoperability: as it have standardised protocols.

Robustness: capable of operating in an environment strongly where there are many other radio waves

Technologies for developing the system

There are many phase for the development of a system and there are many tools available for their development. Two categories can be identified for a system; hardware and software. The hardware part is the part that can be hold by hands and move if it is portable. The software part can be seen as the one who make the hardware works correctly. Without the software, the hardware cannot be used fully.

Programming language

There are a series of programming languages that are available to programmers to code systems. Each programming language has an area of application where it is better. Some of the programming languages are listed below.


Java is cross platform and GNU General Public License programming language. Java is an object-oriented, class-based, general-purpose, and concurrent language. It is intended to let application developers "write once, run anywhere". Java programming languages is used in many systems ranging from applications software to web applications. Java can be use for Bluetooth programming. Java Communication Process (JCP) developed JSR 82, Java API for Bluetooth, so that Bluetooth enabled devices can be code easily using J2ME.

Integrated development environment (IDE) help to code with java, some examples are:


The NetBeans IDE is written in Java and needs JVM run. It can run on different operating system like Windows, Mac OS, Linux, and Solaris. A JDK is required for the functionality of Java development. Netbeans also has a GUI design tool that help developers to design GUIs.


Eclipse was mostly written in java and can be used to develop java application. There are a lot of plug-in which helps to for development.


J2ME is Java platform used to code embedded devices, like mobile phones. Java ME source code is licensed under the GNU General Public License. J2ME can be use to code systems with wireless connection.

C programming language

C is a general-purpose computer programming language that can run on many platforms. C can be use for developing portable application software.


Python is a multi-paradigm programming language and it is cross platform, i.e. it can work on different operation systems. Python can be use for Bluetooth programming.

Visual Basic.Net (VB.Net)

Visual basic is implemented on .Net framework. VB.Net was designed by Microsoft and it is an object oriented language.

Relational Database Management System (RDMS)

Some of RDMS are listed below:


MySQL is a relational database management system which is released under the GNU General Public License. It offers multi-user access to databases and it is cross platform software.


PostgreSQL is an object-relational database management system (ORDBMS) and it is released under PostgreSQL License. Thus it can be modified and distributed in any form desired.

Web Server

A Web server is responsible to process users' request and reply back. The replies are mainly HyperText Markup Language (HTML) documents. Web servers are mainly used t host Web sites.

Apache HTTP Server

Apache HTTP Server is a Web server which is licensed under Apache License 2.0, which means that it is an open source HTTP server. It is platform independent, highly secure and efficient.

Internet Information Server (IIS)

IIS was created and is owned by Microsoft. There is need to buy it license to use it.

Web Development Tools

There are many server side scripting languages that are used. Some of them are listed below:


PHP (Hypertext Preprocessor) is a general-purpose scripting language that was designed for web development so as to have dynamic web pages. PHP can work on most servers and operating system.


ASP.NET allows programmers to build dynamic web pages, web services and web application. It is a web application framework developed and marketed by Microsoft.


Some of the hardware that can be used is listed below.

Mobile phone

Mobiles phones have become a common electronic device. It offers many options than just make call and send messages. Nowadays we can access the Internet via mobile phones, and there are many applications that where developed on mobile phone. New generation mobile phones are equipped with camera and Bluetooth.

Laptop/ Computers

Computer is like the tool that enables programmers to work. All most all programming languages, not to say all, can work on computers. They are also equipped with many wireless devices like Wi-Fi and Bluetooth.

Embedded devices

There are embedded devices that are designed specifically to do certain things. Some examples are: MP3 player, washing machines, Bluetooth meter reader, and many others.

Evaluation of ToolsProgramming language

The programming language is what will help to make the software. Each programming language has positive and negative points depending on the type of software that need to be developed. The pros and cons of certain programming languages are listed below.




Offer better networking capability

Available on various platforms

J2ME applications are portable

Rich user interface

Robust security features.

There is a wide range of mobiles which support Java, thus having wide range of mobile phone that can be used.

Midlet cannot access all native resources without authorization.

Application need to adapt for phones which have different CLDC, MIDP, JSR and Bluetooth.

Table 3‑4: J2ME




Java code can work on many different platforms.

Java is secure, robust and reliable.

Java provides use of multithreading.

Java is object oriented and allows creation of modular programs and reusable code.

Java have an API for Bluetooth programming

Java is slower and consumes more memory when compared to languages such as C or C++.

Table 3‑5: Java

Web Servers

Web servers are what will enable the data to be access over a network in a convenient way. There are a lot of web servers, some of them are described below.


Apache is open and thus can be customised easily according to requirements

Multi-platform. It runs on a wide variety of operating systems, including all variants of UNIX, Windows 9x/NT, and Mac OS

Apache is not regularly updated

Requires more technical knowledge to install and configure

Table 3‑6: Apache


GUI mode installation.

Works with a wide range of operating systems and browsers.

Source code is proprietary.

Can only work within Windows environment.

Table 3‑7: IIS

Web Development Languages

Web development language will be used to code for application at server side. There is a wide pool of language that is available. Some of them are listed below with their some of their pros and cons.


PHP is free and easy to use.

PHP help to interact with database easily.

Can support many operating systems, like Windows, Linux and Mac OS.

PHP engine need to be installed on server to use PHP.

Debugging can be lengthy for complex program.

Table 3‑8: PHP


ASP.NET code is compiled at server before being sent to the browser; thus faster.

ASP.NET pages are simple to write and can cope with heavy traffic without affecting performance adversely

ASP.NET runs on only windows platform.

ActiveX objects are platform specific, thus it will not work easily on many Web servers.

Table 3‑9: ASP.Net


Relational Database Management System (RDMS) will be used to store all data. It is very important as all sensitive data will be there and data will be used to do billing purpose.


Easy to use.

Free and Open source system.

Runs on a range of different platforms.

Can handle large sets of data.

It is secure. Passwords are encrypted

Recovery of database is not guaranteed in case of a power cut.

Operates over known IP ports which facilitate the task of intruders

Table 3‑10: MySQL


It is a free and Open source software

PostgreSQL can work on different platform

PostgreSQL is very scalable and extensible

It is slow compared to MySQL

Lacks binary distribution for all the supported platforms.

Table 3‑11: PostgresSQL

Choice of Final Tools

Java is appropriate for the desktop application as it can work on many different platforms and have an API for Bluetooth.

J2ME is used for the mobile application development as many mobile phones can support java and have an API for Bluetooth.

Bluecove API for Bluetooth programming as it is open source and support java.

PHP will be used for the web application as it is free and easy to interact with database.

MySQL is more suitable for database system as it is free and work well with Web servers.


The design section gives an overview of the structure of the software and architecture of the system. It also includes the data involved, the interfaces between system components, algorithm and protocol to be used for the system implementation.

System Design Issues

Several system design issues like performance, quality of service, fault tolerance, and security, which are important in the design of a system, are discussed below.

Performance Issues

The performance issues are concerned with the limitation of computers in term of processing power and communication capacities. These issues can be described in the followings ways:

Responsiveness: It is how fast the system processes given input to give an output. The use of threading allows multiple tasks to process simultaneously. Threads can be used for processor intensive process. Threads can be implemented in Java Environment.

Applications running on networks depend greatly on the load and performance of servers and also the network load itself. Server and network load balancing can be used to prevent them from being overloaded. Such technique is beyond the scope of this project. When using the Internet, there is a probability of communication delays and data being corrupted, this beyond of one's control.

Throughput: It is of the system corresponds to the amount of data transmitted between the client and server in a given time interval.

On a wireless network is takes a long time to establish connection between the server and the client and the latency time of HTTP is significantly high. So, the number of HTTP round trips in the application must be kept to the strict minimum.


Robustness is the ability of the system to operate in the presence of incorrect input or cope with errors when the system is running.

Validations check like length check and data type check can be used to prevent wrong input and catch errors where shared resources are being accessed.


Interaction with the system can be in many different ways. Data or command input to the system will make it produce certain result. Some of the ways that can interact with the system are listed below.

The use of graphical user interface (GUI) to facilitate user to communicate with the system.

Providing options and menus where possible instead of typing data.

Users using the mobile application need to enter data via phone keypad.

Use of meaningful icons, so that user can interact quickly with the system.


The web application can support multiple users at a time and can receive and process multiple requests a time. The system must be able to cope if there is significant increase in the number of users and additional resources can be added if needed to.


The mobile application can be run on Java enabled mobiles phones which support MIDP 2.0. The web application can run on multiples types of servers.

Limit size of JAR file

The mobile application has limited resources to use. So the application is obfuscated to reduce its size. The obfuscation process helps to remove unused classes and libraries.

Error, Exception Handling and Fault Tolerance

The application should continue to work correctly in presence of software, hardware and network faults. Errors will be caught in try-catch blocks to alert user of the error.


Security is one of the focal point of a system. There is no system on earth which can be tagged as impenetrable. What can be done is, to make the system less vulnerable to attacks. The system needs to protect data from unauthorized users. The ways to protect the system is listed below.

Users need a username and password to be able to access the system. User will be identified and authenticated before they can use the system.

The database will be protected with password.

Architectural Design

In this section, the different components of the system are illustrated and how they interact between them.

Overall Architecture

The system is made up of three main components: the meter, the mobile application and the server application. The mobile application will be used to read a value via Bluetooth from the meter and will send that value via mobile network operator to the server. The connection between the mobile and the server is done via wireless connection such as GPRS, WAP, EDGE or Wi-Fi.

The meter will be a simulated meter on a laptop that will be accessed via Bluetooth by a mobile application.

The server will be used to host the web site and connect to the database. That database will be used to store all information needed.

The figure below shows the overall architecture.

Figure 4‑7: Overall architecture

Detailed architecture

Figure 4‑8: Component diagram

Communication Design

The communication design is based on issues when client application and the server communicate to exchange information and the protocol used for the data transmission.

Communication Protocol

Hypertext Transfer Protocol (HTTP) will be used as communication protocol between the client and the server. The HTTP protocol is a request-response protocol. Client send request with some parameters to the server and the latter will reply to that request.

The Bluetooth protocol, radio frequency communication (RFCOMM) will be used to communicate between the meter and the mobile application. RFCOMM is a simple transport protocol which offers reliable data stream

Static modeling

Class diagram

< Class diagram >

Dynamic modeling

Activity diagram

Activity diagram show a graphical representation of the path activities can take and any iteration or decisions along the path.

Read a meter value

Figure 4‑9: Read meter value

Administrator login to web application

Figure 4‑10: Administrator access web application

Meter reader change username/password

Figure 4‑11: Meter reader change username/password


The implementation process is where the codes are written for the system. The different aspects of the analysis and design phase are applied in this section to meet both analysis and design requirements. This chapter includes standard and conventions to be used during the coding process and sample codes. There is also a development plan to show the tentative time that different modules will take to code.

Implementation Issues

Different issues like performance, reliability and security, need to be considered during the implantation phase. These issues will after the system greatly and will influence user experience.


Performance can be a measure of the system's responsiveness and throughput


The architecture of the system is a client and server one. The client sends data to the server which processes it and replies back the client. All request made to the server are attended and replied back. As soon as authenticated users change their username or password, the database will be updated immediately. When reading values are received, an entry will be made to the database instantly.


The data transfer rate between the meter and the mobile application will depend upon the environment where it is being executed. But if there is no obstacle the data rate will be that of Bluetooth. When data will be transferred from mobile application to the server, the transfer rate will depend on which wireless technology the mobile application is using.


Each section will be using different protocols depending on what it is intended to do.

Between the meter and the mobile application, Bluetooth is being used as transmission medium and the protocol is RFCOMM.

HTTP protocol is being used to transfer data between mobile application and server, and also between clients and server application.

Standards and Conventions

It is easier to read and understand codes when they are written in an elegant and consistent way. Standards and convention help to have a standard way for programmers to write code for different components of the system. It also facilitates program maintenance. Some of the conventions used are listed below.

Naming conventions

Naming conventions helps to have a standard when naming identifies and program codes are easier to read. Identifiers should have meaningful names that reflect what they are used for. The table below shows the standard for naming identifiers.

Naming conventions for identifiers

Identifier Type

Naming Convention



Class Name

Title Case

The first letter of each word capitalized



Upper Case

Should be all uppercase with words separated by underscores ("_")



Mixed Case

The first letter lowercase, with the first letter of each word capitalized.



Mixed Case

First word in lower case and the remaining words capitalized.


Naming convention for objects

The interfaces have several objects and naming conventions are needed for these objects. The table below shows the naming conventions for the objects.


Naming Convention





Test Field



Command button



Combo box



Coding Convention

It is important to make code as clear as possible when writing the codes. To achieve this code convention is used.


Indentation helps to improve readability and clarity.


Identifiers are declared at the beginning of each class or class block. One identifier is declared per line so that can add comments next to it.


Comments have been used where necessary to help to understand the code, to know what a function is used for, or to know the purpose an identifier.

Version tracking

Software version is used to track the most recent version of software. The highest number is the most recent one.

Developments environment and Tools

This section consists of the hardware and software tools details that are used to develop the different modules of the system.

Hardware Specifications

The list of hardware used is listed below.

Laptop Computer

Mobile Phones

The laptop computer was used to develop and test the software, whereas the mobiles phones were used to test the mobile application.

The table below provides an overview of the hardware specifications of the laptop computer used.



Intel Core i3 2.2Ghz



Hard Disk

320 GB


802.11b/g/n, Dell Wireless 365 Bluetooth 2.1

The table below shows the specification of the mobile phones used for the proper development of the mobile application

ComponentNokia 3500cMIDP Version


CLDC Version





Nokia S40

Wireless Connection



Software Specification

Several software have been used for implementing the various part of the system.

Software Component


Operating System

Microsoft Windows 7 32-bit

Java Development

Java 2 Platform Enterprise Edition 6 Software Development Kit (JDK 6.0)

J2SE Runtime Environment (JRE 6)


Version 2.1.0


Version 2.0

Web Development

PHP 5.3.5, MySQL 5.5.8


Netbeans 6.9.1

Other Tools

PhpMyAdmin 3.3.9

Development ProcessImplementation Details


A meter will be simulated so that its reading can be read by the mobile application. The meter will be acting as the server in the Bluetooth network. The mobile application will access it and read the value. Sample codes of the meter server connection are shown below.

//Create the servicve url

String connectionString = "btspp://localhost:" + uuid +";name="+myMeterName;

//open server url

StreamConnectionNotifier streamConnNotifier = (StreamConnectionNotifier) connectionString );

Mobile application

The mobile application will be used to read the meter reading from the meter. The mobile application will act as client in the Bluetooth network and will access the meter which will be acting as the server. After that the meter reading is read, the value is sent to the server. Sample codes of the mobile application connection to the server are shown below.

   // Open an HTTP Connection object

      httpConn = (HttpConnection);

      // Setup HTTP Request to POST



        "Profile/MIDP-1.0 Confirguration/CLDC-1.0");



      httpConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

Server application

The server application will receive data from the mobile application and save that data to the database. Sample codes of the connection to the database are show below.

//mySQL connection string


if (!$conn)


die ('Could not connect:'.mysql_error());


//select database

$db=mysql_select_db($database ,$conn);

if (!$db)


die ('Could not select database:'.mysql_error());



The database is used to store data for the proper running of the system. It stores data about meters, customers, meter readers and readings. A screenshot of the meter reader table from the database is show below.

Error handling and fault tolerance

The system has been designed in such a way that it catches human made errors and displays an error message. Error like, if user has wrongly input data, the user will be notified of the error. However, unexpected system errors also can occur and this part, the system will take care of notifying the user. Some of the errors that may occur are listed below.

If user has entered the wrong username or password in the mobile application, an error message will be displayed.

Alert error = new Alert("Login Incorrect", "Please try again", null, AlertType.ERROR);


If there is any input output error, it will be caught; the sample code is show below.

} catch (IOException e) {

System.out.println("IOException: " + e.getMessage());


Integration and Testing

Testing is a process to examine how the software works with real world data, to examine the output from the software and look for any anomalies with it. The testing process helps to find errors, not their absence.

White Box Testing

White box testing depends on the code logic and the program structure. In this type of testing, the program codes are studied and every possible path in the program is tested at least once. One weak point of this type of testing is that it will not detect if there are functions missing.

Black Box Testing

Black box testing considers the program as a black box, into which data are input and from which the output are displayed. The test data are derived by examining what the program is supposed to do. Black box testing was used to test the system.

The testing process is an iterative one; the different stages need to be retested when a modification is made to in one of the stages. The different stages can be classified in five parts; unit testing, module testing, sub-system testing, system testing and acceptance testing.

Unit testing: the individual components of the system are tested.

Module testing: collections of dependent components are tested.

Sub-system testing: collections of modules which have been combined into sub-system are tested.

System testing: all the subsystems which are related are added together to make the whole system and then the entire system is tested.

Acceptance testing: the user that will use the system will test it will real life data.

Unit testing

Module testing

Sub-system testing

Acceptance testing

System testing

Figure 6‑12 : stages in software testing

Unit testing

The system has different components and they implemented separately. These components have been tested individually. Unit testing helps to have error free components which will be useful when performing the integration. Unit testing have been performed on the different components and any error found was corrected.

Module and sub-system testing

The different components have been grouped into modules which have then been integrated in sub systems. Below are the test cases of some of the modules.

Login sub-system test case

Test ID


Expected Result



Blank username and password

Error message: Username cannot be blank



Invalid username and password

Error message: Wrong username or password. Please try again



Invalid username and correct password

Error message: Wrong username or password. Please try again



Correct username and invalid password

Error message: Wrong username or password. Please try again



Correct username and password

Main menu is shown


Register meter reader sub-system

Test ID


Expected Result


All field are blank

Error message: Forename cannot be blank


Input correct data

Data saved to database


Edit address

address is updated and saved to database


Change password sub-system

Test ID


Expected Result


Both password does not match

Error message: Password does not match


Input correct data

Password updated



The different modules which have been integrated into sub-system need now to be integrated to form the entire system. There are two type of integration; Top-down approach and Bottom-up approach.

Top down approach

In this method, the integration and testing start at the highest level and goes down to the lower level one by one. The trend is from top goes towards the bottom, the lowest levels are normally modules.

Level 2

Level 2

Level 1

Bottom up approach

In this method, the lowest components are tested first and then added up to next level and tested again. The trend is from bottom to the top, where the top is the highest level..

Level 2

Level 2

Level 1

The system is designed and implemented modules by modules, thus the bottom up integration will be best.

Integration testing

When integrating sub-modules together, errors can arise. Integration testing can take place when all the sub-modules have been tested and are error free. It ensures that sub-systems can work together correctly. The integration of the system was successful, there were some small errors, but they were tackled.

System testing

All the sub-systems are integrated to make the entire system. Below a test was done to read a value form the meter and sent that value to the database.

The login screen

Searching for meters

Meter is chosen and the value sent and saves in database.


This project has helped me to work within restricted time and to meet deadlines. It has also helped to increase my knowledge about various technologies like Java, PHP and Bluetooth. This project has given me an insight of how projects are developed and its different stages. I hope that this system can serve as a model and that some of its principal can be used to apply to other sectors.

Critical Appraisal

In this section, the requirements of the system are checked with those implemented to make sure that the system has been developed correctly and completely.

Project AchievementsFunctional Requirement AssessmentNon-Functional Requirements AssessmentFeaturesImplementedAssessementPerformanceMobile application and server respond quicklyUsabilityBoth mobile and server application is easy to useScalabilityThe server can cope with multiple connections.AvailabilityThe system is always available when server is on.Reliability

The server can handle a large number of simultaneous processes

RobustnessErrors have been taken care of.PortabilityServer can run on many platforms. Any Java enabled mobile phone with MIDP 2.0 can support the mobile application.PrivacyOnly valid users can use the systemSecurityPartiallyBluetooth access point has not been protected. Access to web application has been protected with login.Critical Analysis of the system

In this section, the strength and weakness of the system that has been listed.


The use of AJAX technology makes the website more interactive and gives faster responses as no page reloading is necessary in most cases.

The system provides robust security through the use of authentication.

The client is J2ME-based and can thus be installed on a large range of devices.

Bluetooth technology help to protect the meter, as the person need to be in a range of ten meters with the meter to be able to attempt any attack on it.

Weaknesses of the system

If the network operator system crashes, no reading can be done

If the server crashes there is no backup server.

Bluetooth access point is at risk.

Future Works

The system could be enhanced in various ways in the future:

Cater for different servers, in case one is down, the system can work.

Save reading to the phone memory, and send the data when network available.

Work different mobile platform

Use of new versions of Bluetooth.

Article name: Bluetooth Technology For Automatic Meter Reading Computer Science essay, research paper, dissertation