Home Energy Consumption Alert On Handset and Monitoring Using Iot and Cloud
Home Energy Consumption Alert On Handset and Monitoring Using Iot and Cloud
ABSTRACT
The project is based on smart monitoring of energy consumption using Arduino Uno
and uploading into cloud using Wi-Fi module and SMS alert using GSM module. Normally,
people regret over energy consumption at the billing time so through this project we are
intending to help them .At first we measure the energy using an analog energy meter and
send the value and process the data using Arduino, current sensors are attached at each loads
and current consumption of each load are measured using those current sensors and those
measured values are sent to the Arduino where they are processed. The Node MCU, which is
an Wi-Fi module that acts as a gateway to send the data to the cloud where the user can view
the real time data so that they can reduce their consumption.GSM Module is a module that
send messages to handsets of the user, the program for the Arduino is written in such a way
that it sends an alert message to user upon specific unit of consumption which is predefined
onto the Arduino. This allows the user to manage their loads according to the financial
stability. The user can estimate the amount of energy consumption according to their uses and
reduce their load .The monitoring of energy consumption in cloud enables the user for the
time to time monitoring of load energy consumption. The energy consumption project mainly
focuses on financial poor people where their motive is to reduce their energy consumption for
reduced electricity bill
CHAPTER 1
1.1 INTRODUCTION:
A smart grid is an enhanced power grid that utilizes digital communication
technologies to improve the efficiency, sustainability, and reliability in power grids. One of
the most salient advantages is that entities in smart grid can mutually communicate with each
other in a real-time manner. For example, smart metering, which is a basic function in smart
grids, allows a power provider to remotely and timely obtain the user consumption, and
accordingly re-allocate the resource to generate the right amount of power to satisfy the user
demand without unnecessary waste. Although smart metering has its advantages, it also
brings challenges. Smart metering using modern communication technologies is in the risk of
cyber-attacks. The meters are distributed and the transmission medium is physically exposed
to attackers. The readings collected from meters may face the threat of being sniffed,
intercepted, or altered. In order to protect the user privacy and the integrity of meter readings,
it is of great importance to take security into consideration. Moreover, although the majority
of meters are distributed in clustered power supply areas, there are some hard-to-reach meters
far from the clustered area. Data shows that the 1% hard-to-reach meters can account for as
much as 50% of the entire smart metering network operational cost. Therefore, it can save up
to 50% of unnecessary cost by solving such 1% problem. In this paper, our research aims to
solve the above challenges by proposing a secure smart metering system based on LoRa
technology which is a new type of wireless telecommunication network designed to allow
long-range communications. We use symmetric cryptography to secure the data during the
transmission. To maintain a long-term security feature, we further design a key management
protocol to remotely and securely update the encryption keys that are used to protect the
transmitted data. We implement the system and conduct experiments to evaluate its usability
and efficiency. In summary, we make the following contributions:
• We implement our design and conduct evaluation experiments which demonstrate the
practicality of our design in real-world smart grid scenario.
• We discuss a variant of metering topology considering the battery limit of other meters to
facilitate the application of our design to other energy/utility domains, e.g., water metering
and gas metering.
In existing method there is no advanced technology for measuring the reading of electric bill
in home’s, humans are placed for take readings from home, in such cases no one is present in
home and previous month current reading will be noted. Due to this electric bill are not
maintained properly and human need is required here. The increasing trend there are lot of
problems should be handled. At first the higher supply needs have to be met by the increment
of energy production. Along with this fact, higher demand may involve a gird overload. Due
to this method we can’t control power limit to homes and industries, every one use many
usages of their electricity
DISADVANTAGES
PROBLEM DESCRIPTION:
The existing system for detecting power theft isn't an efficient one. The facility theft
happening is detected while taking the energy meter readings by calculating the difference
between the facility received within the transformer which received within the destination.
No measure is taken to forestall it.In this project wireless technology is used to monitor theft
in Electricity meter. An electric meter is a device used for measuring the amount of electrical
energy supplied to a residential or commercial building. Due to the increasing cost of
electricity, the electricity related theft increases and thus tampering and security in electric
meters has become a major concern for government agencies across the globe. Ineffective
and inefficient present methods of detecting and preventing Power and electricity theft cause
a revenue loss along with damage to personal and Public property.
1.3 PROPOSED SYSTEM
Here we introduce an advanced smart metering system for measuring and controlling
the electricity. We monitor the current and voltage through sensors for each device. This
method Consumes less power and high efficiency. If any user uses more electricity,
indication will be send and power will be cut off for certain time. User will go to EB office
and get a permission for high use of electricity.
Voltage and Current sensor is placed for measuring the voltage and current state of the EB
meter, this will identify the power usages in home. So we can avoid the wastage of power and
power saving will take place is and also we can get the electricity bill in wireless technology,
no man power is needed for take reading in homes and industries. The system will also
provide whenever power cut occurs means the reason (ex: power theft, maintenance
scheduling, billing problem.etc) sent through via SMS.
In these proposed system IOT technology is used to transmit the Alert message to the
customer, during High Power consumption. This process will be happening when needed that
means if SMS is received from authorized server mobile transmission customer and EB. Then
the energy theft controlled by current, voltage and short-circuit sensor. Reduces the manual
manipulation work and theft. Use of GSM in the system provides the numerous advantages of
wireless network systems. In these model we set the certain value of current & voltage level
by the help of programming. If the current & voltage level less than the certain value means,
there is no High-Power consumption. So the Alert message not send & the led also OFF.
When the voltage & Current above the certain value Alert message send to the customer &
the LED is turn ON for the indication Cost wise low when compared to other energy meters
without automatic meter reading and high power consumption. Payment reminder should also
be sent Payment reminder should also be sent
ADVANTAGES
BLOCK DIAGRAM
Buzzer
Voltage / Current
Sensor
Relay
NodeMCU
Module
Load 1
ARDUINO UNO
Load 2
GSM Module
LED
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
Embedded C
Arduino IDE
CHAPTER-3
MODULE DESCRIPTION
HARDWARE UNIT
Basic power supply the input power transformer has its primary winding connected to
the mains (line) supply. A secondary winding, electro-magnetically coupled but electrically
isolated from the primary is used to obtain an AC voltage of suitable amplitude, and after
further processing by the PSU, to drive the electronics circuit it is to supply. The transformer
stage must be able to supply the current needed. If too small a transformer is used, it is likely
that the power supply's ability to maintain full output voltage at full output current will be
impaired. With too small a transformer, the losses will increase dramatically as full load is
placed on the transformer. As the transformer is likely to be the costliest item in the power
supply unit, careful consideration must be given to balancing cost with likely current
requirement. There may also be a need for safety devices such as thermal fuses to disconnect
the transformer if overheating occurs, and electrical isolation between primary and secondary
windings, for electrical safety.
Fig 3.1.1.1 Step down Transformer
An Arduino is actually a microcontroller based kit which can be either used directly
by purchasing from the vendor or can be made at home using the components, owing to its
open source hardware feature. It is basically used in communications and in controlling or
operating many devices. It was founded by Massimo Banzi and David Cuartielles in 2005.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial
converter. "Uno" means one in Italian and is named to mark the upcoming release of Arduino
1.0. The Uno and version 1.0 will be the reference versions of Arduino, moving forward.
The Uno is the latest in a series of USB Arduino boards, and the reference model for
the Arduino platform; for a comparison with previous versions.
Arduino’s processor basically uses the Harvard architecture where the program code
and program data have separate memory. It consists of two memories- Program memory and
the data memory. The code is stored in the flash program memory, whereas the data is stored
in the data memory. The Atmega328 has 32 KB of flash memory for storing code (of which
0.5 KB is used for the bootloader), 2 KB of SRAM and 1 KB of EEPROM and operates with
a clock speed of 16MHz.
The most important advantage with Arduino is the programs can be directly loaded to
the device without requiring any hardware programmer to burn the program. This is done
because of the presence of the 0.5KB of Bootloader which allows the program to be burned
into the circuit. All we have to do is to download the Arduino software and writing the code.
3.2.1.1 ARDUINO PIN DIAGRAM
Arduino Uno consists of 14 digital input/output pins (of which 6 can be used as PWM
outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an
ICSP header, and a reset button
Arduino can be power either from the pc through a USB or through external source like
adaptor or a battery. It can operate on a external supply of 7 to 12V. Power can be applied
externally through the pin Vin or by giving voltage reference through the IORef pin. The
Arduino Uno can be powered via the USB connection or with an external power supply. The
power source is selected automatically. External (non-USB) power can come either from an
AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging. The
board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended
range is 7 to 12 volts.
3.2.3 DIGITAL INPUTS
3.2.5 AREF
3.2.6 RESET
Programs written in Arduino are known as sketches. A basic sketch consists of 3 parts
1. Declaration of Variables
2. Initialization: It is written in the setup () function.
3. Control code: It is written in the loop () function.
The sketch is saved with. ino extension. Any operations like verifying, opening a
sketch, saving a sketch can be done using the buttons on the toolbar or using the tool
menu.
The sketch should be stored in the sketchbook directory.
Chose the proper board from the tools menu and the serial port numbers.
Click on the upload button or chose upload from the tools menu. Thus the code is
uploaded by the bootloader onto the microcontroller.
3.2.8 BASIC ADRUINO FUNCTIONS
digitalRead(pin): Reads the digital value at the given pin.
digitalWrite(pin, value): Writes the digital value to the given pin.
pinMode(pin, mode): Sets the pin to input or output mode.
analogRead(pin): Reads and returns the value.
analogWrite(pin, value): Writes the value to that pin.
serial.begin(baud rate): Sets the beginning of serial communication by setting the bit
rate.
3.2.9 FEATURES
It is inexpensive
It comes with an open source hardware feature which enables users to develop their
own kit using already available one as a reference source.
The Arduino software is compatible with all types of operating systems like
Windows, Linux, and Macintosh etc.
It also comes with open source software feature which enables experienced software
developers to use the Arduino code to merge with the existing programming language
libraries and can be extended and modified.
It is easy to use for beginners.
We can develop an Arduino based project which can be completely stand alone or
projects which involve direct communication with the software loaded in the
computer.
It comes with an easy provision of connecting with the CPU of the computer using
serial communication over USB as it contains built in power and reset circuitry.
3.3 RELAY
We know that most of the high end industrial application devices have relays for their
effective working. Relays are simple switches which are operated both electrically and
mechanically. Relays consist of a n electromagnet and also a set of contacts. The switching
mechanism is carried out with the help of the electromagnet. There are also other operating
principles for its working. But they differ according to their applications. Most of the devices
have the application of relays.
Fig 3.3.1 Relay
The main operation of a relay comes in places where only a low-power signal can be
used to control a circuit. It is also used in places where only one signal can be used to control
a lot of circuits. The high end applications of relays require high power to be driven by
electric motors and so on. Such relays are called contactors.
Electromagnet
Movable Armature
Switch point contacts
Spring
Fig 3.3.1.1 Relay design
The diagram shows an inner section diagram of a relay. An iron core is surrounded by
a control coil. As shown, the power source is given to the electromagnet through a control
switch and through contacts to the load. When current starts flowing through the control coil,
the electromagnet starts energizing and thus intensifies the magnetic field. Thus the upper
contact arm starts to be attracted to the lower fixed arm and thus closes the contacts causing a
short circuit for the power to the load. On the other hand, if the relay was already de-
energized when the contacts were closed, then the contact move oppositely and make an open
circuit. As soon as the coil current is off, the movable armature will be returned by a force
back to its initial position. This force will be almost equal to half the strength of the magnetic
force. This force is mainly provided by two factors. They are the spring and also gravity.
Relays are mainly made for two basic operations. One is low voltage application and
the other is high voltage. For low voltage applications, more preference will be given to
reduce the noise of the whole circuit. For high voltage applications, they are mainly designed
to reduce a phenomenon called arcing.
3.4 BUZZER
A buzzer or beeper is a signaling device, the word "buzzer" comes from the rasping
noise that buzzers made when they were electromechanical devices, operated from stepped-
down AC line voltage at 50 or 60 cycles. Other sounds commonly used to indicate that a
button has been pressed are a ring or a beep
BUZZER CIRCUIT
This novel buzzer circuit uses a relay in series with a small audio transformer and
speaker. When the switch is pressed, the relay will operate via the transformer primary and
closed relay contact. As soon as the relay operates the normally closed contact will open,
removing power from the relay, the contacts close and the sequence repeats, all very quickly
so fast that the pulse of current causes fluctuations in the transformer primary, and hence
secondary.
The speakers tone is thus proportional to relay operating frequency. The capacitor C
can be used to "tune" the note. The nominal value is 0.001uF, increasing capacitance lowers
the buzzers tone.
TYPES OF BUZZER
ELECTROMECHANICAL
PIEZOELECTRIC
Buzzers are typically used for identification and alarm purposes across many major
industries.
INDUSTRIES SERVED
CUI's buzzer line utilizes two main technologies. Each technology has specific advantages
and tradeoffs that must be taken into consideration depending on the application
requirements.
BENEFITS OF BUZZER
The use of warning systems like delta-alarm or electric buzzers could be very
beneficial in minimizing loss of lives during a disaster or accident. They are important
devices in any building or facilities to alert and notify people if a timely evacuation is
necessary.
Specialized electric alarm systems could act as warning about threatening liquid level
conditions in lift pump chambers, sewage, and other non-potable water applications. It
is essential that you know how efficiently your home is or business site’s sewer
system works and this can be gauged more accurately if it is accompanied by an
electric sewage alarm.
Most electro mechanical buzzers are easy to set up. In fact, you don’t need to hire an
electrician to install it, since no hard wiring is usually needed. This means cutting
down on expenditure for hiring a professional installer.
In workplace, electric buzzers, especially those with timing software, offers more
benefits and features than traditional timers and expensive bell. They could be
synchronized with automatic software via computer to control and switch times or
channels within the day.
Electric buzzers could even be used in a wide array of appliances. Some buzzers are
now used in switching sounds of electric home appliances such as microwaves,
washing machines, calculators, smoke detectors, and telephone ringers, transmitters,
and many more.
With the help of electro-mechanical buzzers, you can be notified of an automobile
entering your residence or business when you’re in remote areas, so you never miss a
warning.
MODERN APPLICATION
Novelty uses
Judging Panels
Educational purposes
Annunciator panels
Electronic metronomes
Game show lock-out device
Microwave ovens and other household appliances
Sporting events such as basketball games
Electrical alarms
Joy buzzer- a mechanical buzzer used for pranks
GSM is a mobile communication modem; it is stands for global system for mobile
communication (GSM). The idea of GSM was developed at Bell Laboratories in 1970. It is
widely used mobile communication system in the world. GSM is an open and digital cellular
technology used for transmitting mobile voice and data services operates at the 850MHz,
900MHz, 1800MHz and 1900MHz frequency bands.
GSM system was developed as a digital system using time division multiple access
(TDMA) technique for communication purpose. A GSM digitizes and reduces the data, then
sends it down through a channel with two different streams of client data, each in its own
particular time slot. The digital system has an ability to carry 64 kbps to 120 Mbps of data
rates.
There are various cell sizes in a GSM system such as macro, micro, pico and umbrella
cells. Each cell varies as per the implementation domain. There are five different cell sizes in
a GSM network macro, micro, pico and umbrella cells. The coverage area of each cell varies
according to the implementation environment.
GSM ARCHITECTURE
A GSM network consists of the following components:
A Mobile Station: It is the mobile phone which consists of the transceiver, the
display and the processor and is controlled by a SIM card operating over the network.
Base Station Subsystem: It acts as an interface between the mobile station and the
network subsystem. It consists of the Base Transceiver Station which contains the
radio transceivers and handles the protocols for communication with mobiles. It also
consists of the Base Station Controller which controls the Base Transceiver station
and acts as a interface between the mobile station and mobile switching center.
Network Subsystem: It provides the basic network connection to the mobile stations.
The basic part of the Network Subsystem is the Mobile Service Switching Centre
which provides access to different networks like ISDN, PSTN etc. It also consists of
the Home Location Register and the Visitor Location Register which provides the call
routing and roaming capabilities of GSM. It also contains the Equipment Identity
Register which maintains an account of all the mobile equipments wherein each
mobile is identified by its own IMEI number. IMEI stands for International Mobile
Equipment Identity.
SMS
CSD or HSCSD
GPRS / UMTS
AT commands with a GSM/GPRS MODEM or mobile phone can be used to access following
information and services:
Information and configuration pertaining to mobile device or MODEM and SIM card.
SMS services.
MMS services.
Fax services.
Data and Voice link over mobile network.
TYPES OF AT COMMANDS
Basic commands are AT commands that do not start with "+". For example, D (Dial),
A (Answer), H (Hook control), and O (Return to online data state) are basic
commands.
Extended commands are AT commands that start with "+". All GSM AT commands
are extended commands. For example, +CMGS (Send SMS message), +CMGL (List
SMS messages), and +CMGR (Read SMS messages) are extended commands.
The number of SMS messages that can be processed by a GSM modem per minute is very
low only about six to ten SMS messages per minute.Here are some of the tasks that can be
done using AT commands with a GSM/GPRS modem or mobile phone:
Get basic information about the mobile phone or GSM/GPRS modem. For example,
name of the manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number
(International Mobile Equipment Identity) (AT+CGSN), and the software version
(AT+CGMR).
Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and
IMSI number (International Mobile Subscriber Identity) (AT+CIMI).
Get the current status of the mobile phone or GSM/GPRS modem. For example,
mobile phone activity status (AT+CPAS), mobile network registration status
(AT+CREG), radio signal strength (AT+CSQ), battery charge level, and battery
charging status (AT+CBC).
Establish a data connection or voice connection to a remote modem (ATD, ATA,
etc.).
Send and receive fax (ATD, ATA, AT+F*).
Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write
(AT+CMGW), or delete (AT+CMGD) SMS messages and obtain notifications of
newly received SMS messages (AT+CNMI).
Read (AT+CPBR), write (AT+CPBW), or search (AT+CPBF) phonebook entries.
Perform security-related tasks, such as opening or closing facility locks (AT+CLCK),
checking whether a facility is locked (AT+CLCK), and changing passwords
(AT+CPWD). (Facility lock examples: SIM lock [a password must be given to the
SIM card every time the mobile phone is switched on] and PH-SIM lock [a certain
SIM card is associated with the mobile phone; to use other SIM cards with the mobile
phone, a password must be entered.])
Control the presentation of result codes / error messages of AT commands. For
example, you can control whether to enable certain error messages (AT+CMEE), and
whether error messages should be displayed in numeric format or verbose format
(AT+CMEE=1 or AT+CMEE=2).
Get or change the configurations of the mobile phone or GSM/GPRS modem. For
example, change the GSM network (AT+COPS), bearer service type (AT+CBST),
radio link protocol parameters (AT+CRLP), SMS centre address (AT+CSCA), and
storage of SMS messages (AT+CPMS).
Save and restore configurations of the mobile phone or GSM/GPRS modem. For
example, save (AT+CSAS) and restore (AT+CRES) settings related to SMS
messaging such as the SMS centre address.
APPLICATIONS
3.6 LED
LED (LIGHT EMITTING DIODE) consists of a chip of semiconducting
material impregnated, or doped, with impurities to create a p-n junction. As in other diodes,
current flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse
direction. Charge-carriers—electrons and holes—flow into the junction from electrodes with
different voltages. When an electron meets a hole, it falls into a lower energy, and
releases energy in the form of a photon.
.
LEDs are usually built on an n-type substrate, with an electrode attached to the p-
type layer deposited on its surface. P-type substrates, while less common, occur as well.
Many commercial LEDs, especially Gann/InGaN, also use sapphire substrate. Most materials
used for LED production have very high refractive indices. This means that much light will
be reflected back in to the material at the material/air surface interface. Therefore, Light
extraction in LEDs is an important aspect of LED production, subject to much research and
development.
Typical indicator LEDs are designed to operate with no more than 30–60 mill
watts [mW] of electrical power. Around 1999, Philips Lumileds introduced power LEDs
capable of continuous use at one watt [W]. These LEDs used much larger semiconductor die
sizes to handle the large power inputs. Also, the semiconductor dies were mounted onto metal
slugs to allow for heat removal from the LED die.
One of the key advantages of LED-based lighting is its high efficiency, as measured by its
light output per unit power input. White LEDs quickly matched and overtook the efficiency
of standard incandescent lighting systems. In 2002, Lumileds made five-watt LEDs available
with a luminous efficiency of 18–22 lumens per watt [lm/W]. For comparison, a conventional
60–100 W incandescent light bulb produces around 15 lm/W, and standard fluorescent lights
produce up to 100 lm/W. (The luminous efficiency article discusses these comparisons in
more detail.)
Parts of an LED
In September 2003, a new type of blue LED was demonstrated by the company Cree, Inc. to
provide 24 mW at 20 milliamperes [mA]. This produced a commercially packaged white
light giving 65 lm/W at 20 mA, becoming the brightest white LED commercially available at
the time, and more than four times as efficient as standard incandescent. In 2006 they
demonstrated a prototype with a record white LED luminous efficiency of 131 lm/W at 20
mA. Also, Seoul Semiconductor has plans for 135 lm/W by 2007 and 145 lm/W by 2008,
which would be approaching an order of magnitude improvement over standard incandescent
and better even than standard fluorescents.Nichia Corporation has developed a white light
LED with luminous efficiency of 150 lm/W at a forward current of 20 mA.It should be noted
that high-power (≥ 1 W) LEDs are necessary for practical general lighting applications.
Typical operating currents for these devices begin at 350 mA. The highest efficiency high-
power white LED is claimed by
Philips Lumileds Lighting Co. with a luminous efficiency of
115 lm/W (350 mA).
Cree issued a press release on November 19, 2008 about a laboratory prototype LED
achieving 161 lumens/watt at room temperature. The total output was 173 lumens, and the
correlated colour temperature was reported to be 4689 K.
I-V diagram for a diode an LED will begin to emit light when the on-voltage is exceeded.
Typical on voltages are 2-3 Volt
V-I CHARACTERSTICS
As with current sensors, also with voltage sensors it is possible to cover certain
voltage range with one sensor type. To give an idea of the secondary voltage signal level,
one fixed point (ratio) inside the rated voltage range could be 20000/√3V primary value,
typically corresponding to 2/√3V secondary-signal level.
Ideal for situations where power quality is an issue, Voltage Watch sensors facilitate
monitoring of supply voltage levels. They identify under voltage or overvoltage concerns and
help protect critical motors and electronics. Because they have an industry-standard 4–20 mA
output, they are easily coupled to a data logger, panel meter or PLC for real-time monitoring
and reporting.
DESCRIPTION
This module is based on resistance points pressure principle, and it can make the input
voltage of red terminal reduce 5 times of original voltage.
The max Arduino analog input voltage is 5 V, so the input voltage of this module
should be not more than 5 V.
ADVANTAGES
APPLICATIONS
Traction
Main convertors.
Auxiliaries.
Battery chargers
Choppers
Sub-stations.
Connect this voltage sensor module with Arduino sensor shield through 3 Pin sensor
cable, not only can easily realize to detect and control the voltage, but also can display
the voltage through the IIC LCD1602 LCD module and make voltage monitor.
3.8 CURRENT SENSOR
Analog output, which duplicates the wave shape of the sensed current
Bipolar output, which duplicates the wave shape of the sensed current
Unipolar output, which is proportional to the average or RMS value of the sensed
current
Direct current input,
Unipolar with a Unipolar output, which duplicates the wave shape of the sensed
current
Digital output which switches when the sensed current exceeds a certain threshold
APPLICATIONS
Suitable for the current measuring
Monitoring and protection of AC motor
Lighting equipment
Air compressor
SPECIFICATIONS
Input Current: 0~30A AC
Output Mode: DC 0~1V
Non-linearity:2-3%
Build-in sampling resistance (RL): 62Ω
Turn Ratio: 1800:1
Resistance Grade: Grade B
Work Temperature: -25°C ~ ﹢70°C
Dielectric Strength(between shell and output): 1000V AC/1min 5mA
Leading Wire in Length: 1m
Open Size: 13mm x 13mm
CHAPTER 4
SOFTWARE UNIT
4.1 EMBEDDED C
In 2008, the C Standards Committee extended the C language to address these issues
by providing a common standard for all implementations to adhere to. It includes a number of
features not available in normal C, such as, fixed-point arithmetic, named address spaces, and
basic I/O hardware addressing.
Embedded C uses most of the syntax and semantics of standard C, e.g., main()
function, variable definition, datatype declaration, conditional statements (if, switch, case),
loops (while, for), functions, arrays and strings, structures and union, bit operations, macros,
etc. A Technical Report was published in 2004 and a second revision in 2006.
4.1.1 NECESSITY
During infancy years of microprocessor based systems, programs were developed
using assemblers and fused into the EPROMs. There used to be no mechanism to find what
the program was doing. LEDs, switches, etc. were used to check for correct execution of the
program. Some ‘very fortunate’ developers had In-circuit Simulators (ICEs), but they were
too costly and were not quite reliable as well. As time progressed, use of microprocessor-
specific assembly-only as the programming language reduced and embedded systems moved
onto C as the embedded programming language of choice. C is the most widely used
programming language for embedded processors/controllers. Assembly is also used but
mainly to implement those portions of the code where very high timing accuracy, code size
efficiency, etc. are prime requirements.
As assembly language programs are specific to a processor, assembly language didn’t
offer portability across systems. To overcome this disadvantage, several high level languages,
including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but
couldn’t find wide acceptance. Amongst those, C got wide acceptance for not only embedded
systems, but also for desktop applications. Even though C might have lost its sheen as
mainstream language for general purpose applications, it still is having a strong-hold in
embedded programming. Due to the wide acceptance of C in the embedded systems, various
kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all this
facilitated development of embedded systems using C. Assembly language seems to be an
obvious choice for programming embedded devices. However, use of assembly language is
restricted to developing efficient codes in terms of size and speed. Also, assembly codes lead
to higher software development costs and code portability is not there. Developing small
codes are not much of a problem, but large programs/projects become increasingly difficult to
manage in assembly language. Finding good assembly programmers has also become
difficult nowadays. Hence high level languages are preferred for embedded systems
programming.
4.1.2 ADVANTAGES
It is small and simpler to learn, understand, program and debug.
Compared to assembly language, C code written is more reliable and scalable, more
portable between different platforms.
C compilers are available for almost all embedded devices in use today, and there is a
large pool of experienced C programmers.
Unlike assembly, C has advantage of processor-independence and is not specific to
any particular microprocessor/microcontroller or any system. This makes it
convenient for a user to develop programs that can run on most of the systems.
As C combines functionality of assembly language and features of high level
languages, C is treated as a ‘middle-level computer language’ or ‘high level assembly
language’.
It is fairly efficient.
It supports access to I/O and provides ease of management of large embedded
projects.
Java is also used in many embedded systems but Java programs require the Java
Virtual Machine (JVM), which consumes a lot of resources. Hence it is not used for
smaller embedded devices.
Other High-level programming language like Pascal, FORTRAN also provide some
of the advantages.
4.2.1 TOOLS
Auto Format
this formats your code nicely: i.e. indents it so that opening and closing curly braces
line up, and that the statements inside curly braces are indented more.
Archive Sketch
Archives a copy of the current sketch in .zip format. The archive is placed in the same
directory as the sketch.
Fix Encoding & Reload
Fixes possible discrepancies between the editor char map encoding and other
operating systems char maps.
Serial Monitor
Opens the serial monitor window and initiates the exchange of data with any
connected board on the currently selected Port.
Board
Select the board that you're using. See below for descriptions of the various boards.
Port
This menu contains all the serial devices (real or virtual) on your machine. It should
automatically refresh every time you open the top-level tools menu.
Programmer
For selecting a hardware programmer when programming a board or chip and not
using the on-board USB-serial connection.
Burn Boot loader
The items in this menu allow you to burn a bootloader onto the microcontroller on an
Arduino board.
4.2.2 TABS, MULTIPLE FILES, AND COMPILATION
Allows you to manage sketches with more than one file (each of which appears in its
own tab). These can be normal Arduino code files (no visible extension), C files (.c
extension), C++ files (.cpp), or header files (.h).
4.2.3 UPLOADING
Before uploading your sketch, you need to select the correct items from the Tools >
Board and Tools > Port menus. The boards are described below. Once you've selected the
correct serial port and board, press the upload button in the toolbar or select the Upload item
from the File menu. Current Arduino boards will reset automatically and begin the upload.
With older boards (pre-Diecimila) that lack auto-reset, you'll need to press the reset
button on the board just before starting the upload. On most boards, you'll see the RX and
TX LEDs blink as the sketch is uploaded. The Arduino Software (IDE) will display a
message when the upload is complete, or show an error.
When you upload a sketch, you're using the Arduino bootloader, a small program that
has been loaded on to the microcontroller on your board.
It allows you to upload code without using any additional hardware. The bootloader
is active for a few seconds when the board resets; then it starts whichever sketch was most
recently uploaded to the microcontroller. The bootloader will blink the on-board (pin 13)
LED when it starts (i.e. when the board resets).
4.2.4 LIBRARIES
Libraries provide extra functionality for use in sketches, e.g. working with hardware
or manipulating data. To use a library in a sketch, select it from the Sketch > Import
Library menu. This will insert one or more #include statements at the top of the sketch and
compile the library with your sketch. Because libraries are uploaded to the board with your
sketch, they increase the amount of space it takes up.
If a sketch no longer needs a library, simply delete its #include statements from the
top of your code. There is a list of libraries in the reference. Some libraries are included with
the Arduino software. Others can be downloaded from a variety of sources or through the
Library Manager. Starting with version 1.0.5 of the IDE, you do can import a library from a
zip file and use it in an open sketch. See these instructions for installing a third-party library.
It Displays serial data being sent from the Arduino or Genuino board (USB or serial
board). To send data to the board, enter text and click on the "send" button or press enter.
Choose the baud rate from the drop-down that matches the rate passed to Serial.begin in your
sketch. Note that on Windows, Mac or Linux, the Arduino or Genuino board will reset (rerun
your sketch execution to the beginning) when you connect with the serial monitor. You can
also talk to the board from Processing, Flash, MaxMSP, etc (see the interfacing page for
details).
4.2.6 REFERENCES
Some preferences can be set in the preferences dialog (found under the Arduino menu
on the Mac, or File on Windows and Linux). The rest can be found in the preferences file,
whose location is shown in the preference dialog.
Since version 1.0.1, the Arduino Software (IDE) has been translated into 30+ different
languages. By default, the IDE loads in the language selected by your operating system.
If you would like to change the language manually, start the Arduino Software (IDE)
and open the Preferences window. Next to the Editor Language there is a dropdown menu of
currently supported languages. Select your preferred language from the menu, and restart the
software to use the selected language. If your operating system language is not supported, the
Arduino Software (IDE) will default to English.
YOU can return the software to its default setting of selecting its language based on
your operating system by selecting System Default from the Editor Language drop-down.
This setting will take effect when you restart the Arduino Software (IDE).
Similarly, after changing your operating system's settings, you must restart the
Arduino Software (IDE) to update it to the new default language.
4.2.8 BOARDS
The board selection has two effects: it sets the parameters (e.g. CPU speed and baud
rate) used when compiling and uploading sketches; and sets and the file and fuse settings
used by the burn boot loader command. Some of the board definitions differ only in the latter,
so even if you've been uploading successfully with a particular selection you'll want to check
it before burning the boot loader. You can find a comparison table between the various
boards here.
Arduino Software (IDE) includes the built in support for the boards in the following list,
all based on the AVR Core. The Boards included in the standard installation allows to add
support for the growing number of new boards based on different cores like Arduino Due,
Arduino Zero, Edison, Galileo and so on.
CHAPTER 5
LITERATURE SURVEY
Year: 2016
Hot-swappable devices play an important role for achieving high availability and easy
maintainability in power grids, especially in substations. However, they also present a
potential attack vector for malware to penetrate an otherwise highly closed system. We
propose SwapGuard, a software-only solution that effectively guards a power grid system
against swapped-in devices infected with malware. Built upon existing software-based
attestation techniques, Swap Guard’s design can securely handle hot-swapping event and
accommodate different types of devices and networks. We evaluate SwapGuard on real-world
power grid devices. The experimental results show that SwapGuard incurs low overhead to
the operation of the system, in terms of the additional time required before a swapped-in
device starts to function, the overhead to bootstrap the whole system, and the overhead to
defend against unattested devices.
Year:2021
The urge to manage daily energy consumption has now become a worldwide priority. The
Internet of Things (IoT)-based smart meter has been widely used to monitor energy
consumption in many households. Lora WAN connectivity is confirmed to be one of the most
reliable connectivity to be used as a network system for IoT use cases. It can fulfill the needs
of low power, long-range, efficient, and affordable IoT technology in utility energy
monitoring. Lora WAN-based smart electric meters are designed in rural areas for monitoring
and managing electric energy consumption. The smart electric meter system consists of smart
kWh meters, LoRa gateway, network system, and dashboard for energy usage monitoring.
The system design process consists of feature design, architecture design, data flow design,
LoRa gateway site planning, and platform setup. The implementation can be concluded that
LoRa can be used for smart electric meters in rural areas. A gateway can reach a maximum
distance of 1.58 km, with an RSSI of -99.40 dBm ±4.56 dBm. LoRa gateway availability can
reach 100% by implementing gateway protection systems. The Lora WAN-based smart
electricity meter has also proven to be cost optimized, efficiently reducing monthly costs to
92.12%.
Title: Design and Implementation of an IoT-Based Energy Monitoring System for Managing
Smart Homes
Author: Michael OpokuAgyeman; Zainab Al-Waisi; IglaHoxha
Year: 2019
The usage of smart meters has been expanding rapidly since the 2000s, as they
provide economic, social and environmental benefits for multiple stakeholders. A smart meter
can have a customizable design based on the requirements of customer and utility company.
They can be implemented by using different sensors and devices, supported by dedicated
communication infrastructure. This paper presents the design and implementation of a full
working smart meter system that provides remote control of individual loads by using
Arduino, Raspberry Pi and other sensors. The implemented system includes a mobile
application, developed for the client to control and manage the smart meter, along with a
website application, developed for the utility company to monitor and administer the system.
The energy monitoring system is equipped with various features such as sending a
notification to the client if consumption budget exceeds a customizable threshold (75%),
payment options by Visa or PayPal and many others.
Title: LORAWAN Internet of Things Network Planning for Smart Metering Services
Year: 2020
Optimization of energy usage is essential to minimize the waste of energy usage. Smart
Metering is a solution to resolve this problem. It can measure, collect, analyze energy
distribution and its consumption, and communicate with metering devices on schedule and
on-demand, i.e., for electricity, water, and gas services. However, selecting the right Internet
of Things (IoT) network connectivity to deploy Smart Metering services is still the main
challenge, especially for the dense urban setting. LoRaWAN is one of the most popular Low
Power Wide Area technologies consider as a suitable IoT network connectivity for Smart
Metering because LoRaWAN has a long battery life, using unlicensed frequency and low cost
of deployment. In this research, the LoRaWAN IOT network planning to deliver Smart
Metering services was conducted in Jakarta City, as representative of the dense urban setting.
The network planning methods are using capacity and coverage analysis as well as radio
network planning simulation. It is found that to deploy Smart Metering services in the Jakarta
City area, at least 23 gateways are required with Spreading Factor (SF) values of 7, Code
Rate (CR) of 1/2/3/4, and can serve at the level of receiver sensitivity > -129dBm. An average
received signal level of -78.84 dBm with an average of throughput distribution of 21.69 kbps
were obtained based on coverage prediction simulation. Meanwhile the Signal to Noise Ratio
(SNR) simulation generated the highest SNR is 30 dB, and the lowest SNR is -20dB resulting
in the average SNR level of the entire region is about -1.05dB.
Year: 2016
An invention using a data processing system, herein called the Pitch Processing
System, comprising a Pitch Processing Module, a User Control Module, a transducer,
software, and signal processing techniques integrated into an electric stringed musical
instrument. The system automatically and dynamically provides pitch alteration of the
instrument without requiring human or electromechanical intervention to physically change
string tension. The system corrects unintentional pitch drift and intonation errors, and
provides intentional pitch altering techniques for temperament changes, altered tuning styles,
and pitch bending. The result is a pitch altered signal output from the instrument.
Embodiments herein include a variety of input/output signal configurations for both analog
and digital interfaces to support maximum flexibility of the Pitch Processing System.
Title: Smart energy meter billing using GSM with warning system
Year: 2017
The main idea of the project is to modernize our billing system using GSM. The GSM
is a technique works on the principle of TDMA - time division multiple access and operates
at the frequency of 900MHZ. The details of power displaced in the energy meter is
transferred to the mobile using GSM and it also shows the units consumed by the load. If the
number of units consumed by the total load exceeds certain limit means it will give a warning
based on tariff and also we are doing to turn ON and turn OFF the load by setting password
to each load using GSM technique. Thus with the help of this project we can reduce the
electricity bills.
Year: 2022
The advancement in emerging technologies to make life easier has brought a boon to
the world of innovations. In the rural parts of the country, still it has been seen in door-to-
door electricity bill collection where a person from the electricity department needs to visit
each home to take a household electric meter reading. This manual process of reading bills is
a rigid and time taking task. Errors in the reading bill such as extra amount and crime
committed in name of reading bills have been recorded in the last few years. In times of
pandemic, it became more difficult to read bills, and consumers were pressurized to pay bills
of more than 9- 10 months at a single time. To overcome this, there is a need for a smart
energy meter that could automate the system of bill reading. This paper introduces the idea of
the smart energy meter using LoRa technology. LoRa module which can work with a
microprocessor can be very useful to implement this idea. LoRa can transmit a huge amount
of data accurately up to a large distance without any significant loss. In big cities, smart
energy meter is being used which can read the units and send bills. But since these devices
need high-speed network connectivity, hence it is not possible to implement the same
technology in rural parts of the country. This paper tends to implement a smart energy meter
that could make the existing meter smart, rather than installing a new meter.
CHAPTER 6
SYSTEM ANALYSIS
The existing system uses only an image based approach. It does not support minutiae
approach. It takes long time identification and also the result is not accurate.
The purpose of the System Analysis is to produce the brief analysis task and also to
establish complete information about the concept, behaviour and other constraints such as
performance measure and system optimization. The goal of System Analysis is to completely
specify the technical details for the main concept in a concise and unambiguous manner.
The package selected to develop Finger print matching is MATLAB and the package
has more advanced features. As the system is to be developed in Finger print matching,
MATLAB platform with windows Application is preferred.
The ability to become part of a Windows Server domain, a group of computers that
are remotely managed by one or more central servers. A sophisticated access control scheme
that allows specific permissions on files to be granted to specific users under normal
circumstances. However, users can use tools other than Windows Explorer (like cacls or File
Manager), or restart to Safe Mode to modify access control lists. Remote Desktop server,
which allows a PC to be operated by another Windows XP user over a local area network or
the Internet.
Offline Files and Folders, which allow the PC to automatically store a copy of files
from another networked computer and work with them while disconnected from the network.
Encrypting File System, which encrypts files stored on the computer's hard drive so they
cannot be read by another user, even with physical access to the storage medium. Centralized
administration features, including Group Policies, Automatic Software Installation and
Maintenance, Roaming User Profiles, and Remote Installation Service (RIS). Support for two
physical central processing units (CPU). (Because the number of CPU cores and Hyper-
threading capabilities on modern CPUs are considered to be part of a single physical
processor, multi core CPUs is supported using XP Home Edition.) Windows Management
Instrumentation Console (WMIC): WMIC is a command-line tool designed to ease WMI
information retrieval about a system by using simple keywords (aliases).
In this phase it is necessary to analyze the availability of the resources that are required to
design, develop, Implement and Test the project. The resources to be analyzed are
Manpower, Time and the system Requirements. Teams of two members are involved in the
entire SDLC life cycle except the testing phase. The testing phase is guided by the
professional testers before the implementation of the product. Time Analyzed to complete the
project is approximately four months with 4 hrs on daily basis except weekends. System
requirements are analyzed and listed below.
The objective of feasibility study is not only to solve the problem but also to acquire a
sense of its scope. During the study, the problem definition was crystallized and aspects of
the problem to be included in the system are determined. Consequently, benefits are
estimated with greater accuracy at this stage. The key considerations are:
Economic feasibility
Technical feasibility
Operational feasibility
6.6.1 ECONOMIC FEASIBILITY
Economic feasibility studies not only the cost of hardware, software is included but
also the benefits in the form of reduced costs are considered here. This project, if installed
will certainly be beneficial since there will be reduction in manual work and increase in the
speed of work.
6.6.2 TECHNICAL FEASIBILITY
This is the most important step of the feasibility study this study helps to predict the
operational ability of the system that is being developed. This study also helps to analyze the
approach towards which the system must be developed by which development effort is
reduced. Proposed system is beneficial only if they can be turned into information systems,
that will meet the organization requirements. This system supports in producing good results
and reduces manual work. Only by spending time to evaluate the feasibility, do we reduce the
chances from extreme embarrassments at larger stager of the project. Effort spend on a
feasibility analysis that results in the cancellation of a proposed project is not a wasted effort.
CHAPTER 7
SYSTEM TESTING
7.1 TESTING OBJECTIVES
Type of Testing
1. Unconventional Testing
2. Conventional Testing
1. Peer review
3. Inspection
4. Document Verification
7.1.2 CONVENTIONAL TESTING
Conventional Testing is a process of finding the bugs and validating the project. Testing team
involves in this testing process and validating that developed project is according to client
requirement or not. This process is a correction technique where testing team find bugs and
reporting to the development team for correction on developed project built.
7.2.1UNIT TESTING
The primary goal of unit testing is to take the smallest piece of testable software in the
application, isolate it from the remainder of the code, and determine whether it behaves
exactly as you expect. Each unit is tested separately before integrating them into modules to
test the interfaces between modules. Unit testing has proven its value in that a large
percentage of defects are identified during its use. In the company as well as seeker
registration form, the zero length username and password are given and checked. Also the
duplicate username is given and checked. In the job and question entry, the button will send
data to the server only if the client side validations are made. The dates are entered in wrong
manner and checked. Wrong email-id and web site URL (Universal Resource Locator) is
given and checked.
Testing is done for each module. After testing all the modules, the modules are
integrated and testing of the final system is done with the test data, specially designed to
show that the system will operate successfully in all its aspects conditions. Thus the system
testing is a confirmation that all is correct and an opportunity to show the user that the system
works.
7.2.3VALIDATION TESTING
The final step involves Validation testing, which determines whether the software
function as the user expected. The end-user rather than the system developer conduct this test
most software developers as a process called “Alpha and Beta Testing” to uncover that only
the end user seems able to find. The compilation of the entire project is based on the full
satisfaction of the end users. In the project, validation testing is made in various forms. In
question entry form, the correct answer only will be accepted in the answer box. The answers
other than the four given choices will not be accepted.
A number of software testing strategies have been proposed in the literature. All
provide the software developer with a template for testing and all have the following generic
characteristics:
1. Testing begins at the component level and works “outward” toward the integration of
the entire computer-based system.
3. The developer of the s/w conducts testing and for large projects, independent test
group.
4. Testing and debugging are different activities, but debugging must be accommodated
in any testing strategy.
The strategies for integrating software components into a functioning product include the
bottom-up strategy, the top-down strategy and to ensure that modules will be available for
integration into the evolving software product when needed. The integration strategy dictates
the order in which modules must be available and thus exerts a strong influence on the order
in which modules are written, debugged and unit tested.
It is just the vice versa of the Black Box testing. There we do not watch the internal variables
during testing. This gives clear idea about what is going on during execution of the system.
The point at which the bug occurs were all clear and were removed.
In this testing we give input to the system and test the output. Here we do not go for watching
the internal file in the system and what are the changes made on them for the required output.
7.7 INTERFACE TESTING
The Interface Testing is performed to verify the interfaces between sub modules while
performing integration of sub modules aiding master module recursively.
Module Testing is a process of testing the system, module by module. It includes the various
inputs given, outputs produced and their correctness. By testing in this method we would be
very clear of all the bugs that have occurred.
7.9 MAINTENANCE
The objectives of this maintenance work are to make sure that the system gets into
work all time without any bug. Provision must be for environmental changes which may
affect the computer or software system. This is called the maintenance of the system.
Nowadays there is the rapid change in the software world. Due to this rapid change, the
system should be capable of adapting these changes. In our project the process can be added
without affecting other parts of the system. Maintenance plays a vital role. The system will
able to accept any modification after its implementation. This system has been designed to
favor all new changes. Doing this will not affect the system’s performance or its accuracy.
This is the final step in system life cycle. Here we implement the tested error-free system into
real-life environment and make necessary changes, which runs in an online fashion.
CONCLUSION:
This paper proposes and implements a secure and costefficient smart metering
solution, i.e., secure smart metering infrastructure based on IOT technology. Moreover, a key
management protocol with self-verification and future key secrecy is designed to work with
the proposed infrastructure to maintain a long-term security by updating keys periodically.
The evaluation also demonstrates the practicability ofthe proposed solution in real-world
scenarios.
REFERENCES:
[2] Semtech announces the industry’s first single chip hybrid plc and lora wireless platform
for smart grid, smart metering and iot applications.
http://investors.semtech.com/releasedetail.cfm?ReleaseID=968700.
[5] M. Badra and S. Zeadally. Key management solutions in the smart grid environment. In
Wireless and Mobile Networking Conference (WMNC), 2013 6th Joint IFIP, pages 1–7.
IEEE, 2013.
[6] C. Beaver, D. Gallup, W. Neumann, and M. Torgerson. Key management for scada.
Cryptog. Information Sys. Security Dept., Sandia Nat. Labs, Tech. Rep. SAND2001-3252,
2002.
[9] X. Dong, S. Jauhar, and B. Chen. Swapguard: A softwareonly solution for attesting hot-
swappable devices in powergrids. In Smart Grid Communications (SmartGridComm), 2016
IEEE International Conference on, pages 357–363.IEEE, 2016.
[10] S. Fuloria, R. Anderson, F. Alvarez, and K. McGrath. Key management for substations:
Symmetric keys, public keys or no keys? In Power Systems Conference and Exposition
(PSCE), 2011 IEEE/PES, pages 1–6. IEEE, 2011.