Sunteți pe pagina 1din 82

Wireless Energy Meter with Automated Tariff

Calculation
ABSTRACT

The aim of the project is to minimize the queue at the energy meter billing counters and
to restrict the usage of energy meter automatically, if the bill is not paid. The project also
aims at proposing a system that will reduce the loss of power and revenue due to power
thefts and other illegal activities. The work system adopts a totally new concept of
“Wireless Energy Meter with Automated Tariff Calculation”. The GSM technology is
used so that the consumer would receive messages about the consumption of power (in
watts) and if it reaches the minimum amount, it would automatically alert the consumer
to recharge. This technology holds good for all electricity distribution companies, private
communities, IT parks and self-containing housing projects. The implementation of this
project will help in better energy management, conservation of energy and also in doing
away with the unnecessary hassles over incorrect billing. The automated billing system
will keep track of the real time consumption and will leave little scope for disagreement
on consumption and billing. It is observed that one of the faulty subsystems contributing
to the huge revenue loss in Nigerian Power Sector is the metering and billing system.
Errors get introduced at every stage of energy billing, like: errors with electro-mechanical
meters, human errors while noting down the meter reading; and error while processing
the paid bills and the due bills. The remedy for this drawback is a prepaid energy billing.
There are clear results from many countries, where prepaid system has reduced the
revenue loss by a large amount. A GSM-based Energy Recharge Interface which contains
a prepaid card equivalent to a mobile SIM card. The prepaid card communicates with the
power utility using GSM communication network. Once the prepaid card is out of
balance, the consumer load is disconnected from the utility supply by the latching Relay
(contactor). The power utility can recharge the prepaid card remotely through GSM/SMS
mode base on customer requests. The results obtained shows good system performance.
A prior billing is bound to do away with the problems of unpaid bills and human error in
meter readings, thereby ensuring justified revenue for the utility.
INTRODUCTION

Microchip has positioned itself to target the motor control market, where our
advanced designs, progressive process technology and industry leading product
performance enables us to deliver decidedly superior performance over our competitors,
which includes the best of the industry. These products are positioned to provide a
complete product solution for embedded control applications found throughout the
consumer, automotive and industrial control markets. Microchip products are meeting the
unique design requirements of the motion control embedded applications.

EMBEDDED SYSTEM:

An embedded system is a special-purpose system in which the computer


is completely encapsulated by or dedicated to the device or system it controls. Unlike a
general-purpose computer, such as a personal computer, an embedded system performs
one or a few predefined tasks, usually with very specific requirements. Since the system
is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost
of the product. Embedded systems are often mass-produced, benefiting from economies
of scale.

Personal digital assistants (PDAs) or handheld computers are generally


considered embedded devices because of the nature of their hardware design, even
though they are more expandable in software terms. This line of definition continues to
blur as devices expand. With the introduction of the OQO Model 2 with the Windows XP
operating system and ports such as a USB port — both features usually belong to
"general purpose computers", — the line of nomenclature blurs even more.

Physically, embedded systems ranges from portable devices such as digital


watches and MP3 players, to large stationary installations like traffic lights, factory
controllers, or the systems controlling nuclear power plants.
.

Examples of
Embedded Systems:
 Avionics, such as inertial guidance systems, flight control
hardware/software and other integrated systems in aircraft and missiles
 Cellular telephones and telephone switches
 Engine controllers and antilock brake controllers for automobiles
 Home automation products, such as thermostats, air conditioners,
sprinklers, and security monitoring systems
 Handheld calculators
 Handheld computers
 Household appliances, including microwave ovens, washing machines,
television sets, DVD players and recorders
 Medical equipment
 Personal digital assistant
 Videogame consoles
 Computer peripherals such as routers and printers.
 Industrial controllers for remote machine operation.
INTRODUCTION TO THE PROJECT:

The Electrical metering instrument technology has come a long way from what it was
more than 100 years ago. From the original bulky meters with heavy magnets and coils, there
have been many innovations that have resulted in size & weight reduction in addition to
improvement in features and specifications. Resolution and accuracy of the meter have seen
substantial improvements over the years. Introduction of the digital meter in the later part of last
century has completely changed the way Electrical parameters are measured. Starting with
Voltmeters & Ammeters, the digital meter has conquered the entire spectrum of measuring
instruments due to their advantages like ease of reading, better resolution and rugged
construction. Of particular significance is the introduction of the Electronic Energy Meter in the
mid-eighties. Now a days, the energy consumption and energy distribution has become a big
subject for discussion because of huge difference in energy production and consumption. In this
regard, energy consumers are facing so many problems due to the frequent power failures;
another important reason for power cuts is due to the un-limited energy consumption of rich
people. In this aspect, to minimize the power cuts and to distribute the energy equally to all areas,
some restriction should have over the power consumption of each and every energy consumer,
and according to that the Government should implement a policy, by introducing Autonomous
Energy Meters everywhere in domestic sector. Hence, the need has come to think on this line and
a solution has to be emerged out.

BLOCK DIAGRAM:

POWER SUPPLY LCD


SYSTEM

OPTO COUPLER

ENERGY
GSM
SOURCE ENERGY
ARDUINO UNO MODULE
(230VAC) METER

RELAY

LOAD
BLOCK DIAGRAM EXPLANATION:
This Project mainly consists of Power Supply section, ARDUINO UNO Microcontroller
section, LCD display section, Current Sensor, OPTO coupler, relays, energy meter, WIFI IOT.

Power supply:

This section is meant for supplying Power to all the sections mentioned above. It
basically consists of a Transformer to step down the 230V ac to 9V ac followed by diodes. Here
diodes are used to rectify the ac to dc. After rectification the obtained rippled dc is filtered using a
capacitor Filter. A positive voltage regulator is used to regulate the obtained dc voltage.

OPTO COUPLER:

An OPTOCOUPLER is an electronic component that interconnects two separate


electrical circuits by means of a light sensitive optical interface.

ENERGY METER:

An electricity meter, electric meter, electrical meter, or energy meter is a device that


measures the amount of electric energy consumed by a residence, a business, or an
electrically powered device.

Electric utilities use electric meters installed at customers' premises for billing purposes.


They are typically calibrated in billing units, the most common one being the kilowatt
hour (kWh). They are usually read once each billing period.

When energy savings during certain periods are desired, some meters may measure
demand, the maximum use of power in some interval. "Time of day" metering allows
electric rates to be changed during a day, to record usage during peak high-cost periods
and off-peak, lower-cost, periods. Also, in some areas meters have relays for demand
response load shedding during peak load periods.
RELAY:

A relay is an electrically operated switch. Many relays use an electromagnet to


mechanically operate a switch, but other operating principles are also used, such as solid-
state relays. Relays are used where it is necessary to control a circuit by a separate low-
power signal, or where several circuits must be controlled by one signal. The first relays
were used in long distance telegraph circuits as amplifiers: they repeated the signal
coming in from one circuit and re-transmitted it on another circuit. Relays were used
extensively in telephone exchanges and early computers to perform logical operations.

LCD DISPLAY:

A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated


optical device that uses the light-modulating properties of liquid crystals. Liquid crystals
do not emit light directly, instead using a backlight or reflector to produce images in color
or monochrome. LCDs are available to display arbitrary images (as in a general-purpose
computer display) or fixed images with low information content, which can be displayed
or hidden, such as preset words, digits, and seven-segment displays, as in a digital clock.
They use the same basic technology, except that arbitrary images are made up of a large
number of small pixels, while other displays have larger elements. LCDs can either be
normally on (positive) or off (negative), depending on the polarizer arrangement. For
example, a character positive LCD with a backlight will have black lettering on a
background that is the color of the backlight, and a character negative LCD will have a
black background with the letters being of the same color as the backlight.

ARDUINO UNO MICROCONTROLLER:

The Arduino UNO is an open-source microcontroller board based on


the Microchip ATmega328P microcontroller and developed by Arduino.cc. The board is
equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to
various expansion boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated Development
Environment) via a type B USB cable. It can be powered by a USB cable or by an
external 9 volt battery, though it accepts voltages between 7 and 20 volts. It is also
similar to the Arduino Nano and Leonardo. The hardware reference design is distributed
under a Creative Commons Attribution Share-Alike 2.5 license and is available on the
Arduino website.

GSM:

GSM (Global System for Mobile communications) is a standard developed by the


European Telecommunications Standards Institute (ETSI) to describe the protocols for
second-generation (2G) digital cellular networks used by mobile devices such as mobile
phones and tablets. It was first deployed in Finland in December 1991. As of 2014, it has
become the global standard for mobile communications – with over 90% market share,
operating in over 193 countries and territories.
HARDWARE COMPONENTS
POWER SUPPLY:
The power supply is designed to convert high voltage AC mains electricity to a
suitable low voltage supply for electronic circuits and other devices. A power supply can
by broken down into a series of blocks, each of which performs a particular function. A
D.C. power supply which maintains the output voltage constant irrespective of a.c mains
fluctuations or load variations is known as “Regulated D.C Power Supply”
For example a 5V regulated power supply system as shown below:

Fig 22: Functional Block Diagram of Power supply


Transformer:
A transformer is an electrical device which is used to convert electrical power
from one electrical circuit to another without change in frequency.
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains
electricity is AC. Step-up transformers increase in output voltage, step-down
transformers decrease in output voltage. Most power supplies use a step-down
transformer to reduce the dangerously high mains voltage to a safer low voltage. The
input coil is called the primary and the output coil is called the secondary. There is no
electrical connection between the two coils; instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. The two lines in the middle
of the circuit symbol represent the core. Transformers waste very little power so the
power out is (almost) equal to the power in. Note that as voltage is stepped down current
is stepped up. The ratio of the number of turns on each coil, called the turn’s ratio,
determines the ratio of the voltages. A step-down transformer has a large number of turns
on its primary (input) coil which is connected to the high voltage mains supply, and a
small number of turns on its secondary (output) coil to give a low output voltage.

Fig 23: An Electrical Transformer

Rectifier:
A circuit, which is used to convert a.c to dc, is known as RECTIFIER. The
process of conversion a.c to d.c is called “rectification”
Types of Rectifiers:
 Half wave Rectifier
 Full wave rectifier
1. Center tap full wave rectifier.
2. Bridge type full bridge rectifier.

Full-wave Rectifier:
From the above comparisons we came to know that full wave bridge rectifier as
more advantages than the other two rectifiers. So, in our project we are using full wave
bridge rectifier circuit.
Bridge Rectifier:
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve
full-wave rectification. This is a widely used configuration, both with individual diodes
wired as shown and with single component bridges where the diode bridge is wired
internally.

A bridge rectifier makes use of four diodes in a bridge arrangement as shown


in fig(a) to achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the diode
bridge is wired internally.

Operation:
During positive half cycle of secondary, the diodes D2 and D3 are in forward
biased while D1 and D4 are in reverse biased as shown in the fig(b). The current flow
direction is shown in the fig (b) with dotted arrows.

Fig(24.B)
During negative half cycle of secondary voltage, the diodes D1 and D4 are in
forward biased while D2 and D3 are in reverse biased as shown in the fig(c). The current
flow direction is shown in the fig (c) with dotted arrows.

Fig(24.C)

Filter:
A Filter is a device, which removes the a.c component of rectifier output but allows the
d.c component to reach the load.
Capacitor Filter:
We have seen that the ripple content in the rectified output of half wave rectifier
is 121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high
percentages of ripples is not acceptable for most of the applications. Ripples can be
removed by one of the following methods of filtering:
(a) A capacitor, in parallel to the load, provides an easier by –pass for the ripples voltage
though it due to low impedance. At ripple frequency and leave the d.c.to appears the load.
(b) An inductor, in series with the load, prevents the passage of the ripple current (due to
high impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c)
(c) various combinations of capacitor and inductor, such as L-section filter section
filter, multiple section filter etc. which make use of both the properties mentioned in (a)
and (b) above.
Filtering is performed by a large value electrolytic capacitor connected across the
DC supply to act as a reservoir, supplying current to the output when the varying DC
voltage from the rectifier is falling. The capacitor charges quickly near the peak of the
varying DC, and then discharges as it supplies current to the output. Filtering
significantly increases the average DC voltage to almost the peak value (1.4 × RMS
value).
To calculate the value of capacitor(C),
C = ¼*√3*f*r*Rl
Where,
f = supply frequency,
r = ripple factor,
Rl = load resistance
Note: In our circuit we are using 1000microfarads.

Type of Rectifier
Parameter Half wave Full wave Bridge
Number of diodes
1 2 4
PIV of diodes
Vm 2Vm Vm

D.C output voltage Vm/ 2Vm/ 2Vm/

Vdc, at 0.318Vm 0.636Vm 0.636Vm


no-load

Ripple factor 1.21 0.482 0.482


Ripple
frequency f 2f 2f
Rectification
efficiency 0.406 0.812 0.812
Transformer
Utilization 0.287 0.693 0.812
Factor(TUF)
RMS voltage Vrms Vm/2 Vm/√2 Vm/√2

Table: Comparison of rectifier circuits:


Regulator:
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current ('overload protection') and overheating
('thermal protection'). Many of the fixed voltage regulator ICs have 3 leads and look like
power transistors, such as the 7805 +5V 1A regulator shown on the right. The LM7805 is
simple to use. You simply connect the positive lead of your unregulated DC power
supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to
the Common pin and then when you turn on the power, you get a 5 volt supply from the
output pin.

Fig 25: A Three Terminal Voltage Regulator


78XX:
The Bay Linear LM78XX is integrated linear positive regulator with three
terminals. The LM78XX offer several fixed output voltages making them useful in wide
range of applications. When used as a zener diode/resistor combination replacement, the
LM78XX usually results in an effective output impedance improvement of two orders of
magnitude, lower quiescent current. The LM78XX is available in the TO-252, TO-220 &
TO-263packages,
Features:
• Output Current of 1.5A
• Output Voltage Tolerance of 5%
• Internal thermal overload protection
• Internal Short-Circuit Limited
• No External Component
• Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V
• Offer in plastic TO-252, TO-220 & TO-263
• Direct Replacement for LM78XX.

ARDUINO UNO:
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by Arduino.cc. The board is
equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to
various expansion boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated Development
Environment) via a type B USB cable. It can be powered by a USB cable or by an
external 9 volt battery, though it accepts voltages between 7 and 20 volts. It is also
similar to the Arduino Nano and Leonardo. The hardware reference design is distributed
under a Creative Commons Attribution Share-Alike 2.5 license and is available on the
Arduino website.
Layout and production files for some versions of the hardware are also available. "Uno"
means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0.
The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of
Arduino, now evolved to newer releases. The Uno board is the first in a series of USB
Arduino boards, and the reference model for the Arduino platform. The ATmega328 on
the Arduino Uno comes preprogrammed with a bootloader that allows uploading new
code to it without the use of an external hardware programmer. It communicates using
the original STK500 protocol. The Uno also differs from all preceding boards in that it
does not use the FTDI USB-to-serial driver chip. Instead, it uses the Atmega16U2
(Atmega8U2 up to version R2) programmed as a USB-to-serial converter.
Background:
The Arduino project started at the Interaction Design Institute Ivrea (IDII) in Ivrea, Italy.
At that time, the students used a Stamp microcontroller at a cost of $100, a considerable
expense for many students. In 2003 Hernando Barraging created the development
platform Wiring as a Master's thesis project at IDII, under the supervision of Massimo
Banzi and Casey Reas, who are known for work on the Processing language. The project
goal was to create simple, low-cost tools for creating digital projects by non-engineers.
The Wiring platform consisted of a printed circuit board (PCB) with an ATmega168
microcontroller, an IDE based on Processing and library functions to easily program the
microcontroller. In 2003, Massimo Banzi, with David Mellis, another IDII student, and
David Cuartielles, added support for the cheaper ATmega8 microcontroller to Wiring.
But instead of continuing the work on Wiring, they forked the project and renamed
it Arduino. Early arduino boards used the FTDI USB-to-serial driver chip and
an ATmega168. The Uno differed from all preceding boards by featuring the
ATmega328P microcontroller and an ATmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter.
Technical specifications:

 Microcontroller: Microchip ATmega328P 
 Operating Voltage: 5 Volts
 Input Voltage: 7 to 20 Volts
 Digital I/O Pins: 14 (of which 6 provide PWM output)
 Analog Input Pins: 6
 DC Current per I/O Pin: 20 mA
 DC Current for 3.3V Pin: 50 mA
 Flash Memory: 32 KB of which 0.5 KB used by bootloader
 SRAM: 2 KB
 EEPROM: 1 KB
 Clock Speed: 16 MHz
 Length: 68.6 mm
 Width: 53.4 mm
 Weight: 25 g
PINS:

General Pin functions:

 LED: There is a built-in LED driven by digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
 VIN: The input voltage to the Arduino/Genuine board when it's using an external
power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage via
the power jack, access it through this pin.
 5V: This pin outputs a regulated 5V from the regulator on the board. The board
can be supplied with power either from the DC power jack (7 - 20V), the USB
connector (5V), or the VIN pin of the board (7-20V). Supplying voltage via the 5V or
3.3V pins bypasses the regulator, and can damage the board.
 3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
 GND: Ground pins.
 IOREF: This pin on the Arduino/Genuine board provides the voltage reference
with which the microcontroller operates. A properly configured shield can read the
IOREF pin voltage and select the appropriate power source or enable voltage
translators on the outputs to work with the 5V or 3.3V.
 Reset: Typically used to add a reset button to shields which block the one on the
board.

Special Pin Functions:

Each of the 14 digital pins and 6 Analog pins on the Uno can be used as an input or
output, using pinMode(),digitalWrite(), and digitalRead() functions. They operate at 5
volts. Each pin can provide or receive 20 mA as recommended operating condition and
has an internal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of
40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage
to the microcontroller.The Uno has 6 analog inputs, labeled A0 through A5, each of
which provide 10 bits of resolution (i.e. 1024 different values). By default they measure
from ground to 5 volts, though is it possible to change the upper end of their range using
the AREF pin and the analog Reference() function.

In addition, some pins have specialized functions:

 Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX)
TTL serial data. These pins are connected to the corresponding pins of the
ATmega8U2 USB-to-TTL Serial chip.
 External Interrupts: pins 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value.
 PWM (Pulse Width Modulation): 3, 5, 6, 9, 10, and 11 Can provide 8-bit PWM
output with the analog Write() function.
 SPI (Serial Peripheral Interface): 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).
These pins support SPI communication using the SPI library.
 TWI (Two Wire Interface) / I²C: A4 or SDA pin and A5 or SCL pin. Support
TWI communication using the Wire library.
 AREF (Analog Reference): Reference voltage for the analog inputs.

Communication:

The Arduino/Genuino Uno has a number of facilities for communicating with a


computer, another Arduino/Genuino board, or other microcontrollers. The ATmega328
provides UART TTL (5V) serial communication, which is available on digital pins 0
(RX) and 1 (TX). An ATmega16U2 on the board channels this serial communication
over USB and appears as a virtual com port to software on the computer. The 16U2
firmware uses the standard USB COM drivers, and no external driver is needed.
However, on Windows, a .inf file is required. The Arduino Software (IDE) includes a
serial monitor which allows simple textual data to be sent to and from the board. The RX
and TX LEDs on the board will flash when data is being transmitted via the USB-to-
serial chip and USB connection to the computer (but not for serial communication on
pins 0 and 1). A SoftwareSerial library allows serial communication on any of the Uno's
digital pins.

Automatic (Software) Reset:

Rather than requiring a physical press of the reset button before an upload, the
Arduino/Genuino Uno board is designed in a way that allows it to be reset by software
running on a connected computer. One of the hardware flow control lines (DTR) of the
ATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100 nanofarad
capacitor. When this line is asserted (taken low), the reset line drops long enough to reset
the chip.

This setup has other implications. When the Uno is connected to a computer running Mac
OS X or Linux, it resets each time a connection is made to it from software (via USB).
For the following half-second or so, the bootloader is running on the Uno. While it is
programmed to ignore malformed data (i.e. anything besides an upload of new code), it
will intercept the first few bytes of data sent to the board after a connection is opened.
Pin Description:

Pin Category Pin Name Details

Power Vin, 3.3V, Vin: Input voltage to Arduino when using an


5V, GND external power source.

5V: Regulated power supply used to power


microcontroller and other components on the board.

3.3V: 3.3V supply generated by on-board voltage


regulator. Maximum current draw is 50mA.

GND: ground pins.

Reset Reset Resets the microcontroller.

Analog Pins A0 – A5 Used to provide analog input in the range of 0-5V

Input/Output Digital Pins 0 Can be used as input or output pins.


Pins - 13

Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.

External 2, 3 To trigger an interrupt.


Interrupts

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.


SPI 10 (SS), 11 Used for SPI communication.
(MOSI), 12
(MISO) and
13 (SCK)

Inbuilt LED 13 To turn on the inbuilt LED.

TWI A4 (SDA), A5 Used for TWI communication.


(SCA)

AREF AREF To provide reference voltage for input voltage.

Arduino Uno Technical Specifications

Microcontroller ATmega328P – 8 bit AVR family microcontroller

Operating Voltage 5V

Recommended Input 7-12V


Voltage

Input Voltage Limits 6-20V

Analog Input Pins 6 (A0 – A5)


Digital I/O Pins 14 (Out of which 6 provide PWM output)

DC Current on I/O 40 mA
Pins

DC Current on 3.3V 50 mA
Pin

Flash Memory 32 KB (0.5 KB is used for Bootloader)

SRAM 2 KB

EEPROM 1 KB

Frequency (Clock 16 MHz


Speed)

Other Arduino Boards

Arduino Nano, Arduino Pro Mini, Arduino Mega, Arduino Due, Arduino Leonardo

Overview

Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller.


Along with ATmega328P, it consists other components such as crystal oscillator, serial
communication, voltage regulator, etc. to support the microcontroller. Arduino Uno has
14 digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog input
pins, a USB connection, A Power barrel jack, an ICSP header and a reset button.

 
How to use Arduino Board

The 14 digital input/output pins can be used as input or output pins by using pinMode(),
digitalRead() and digitalWrite() functions in arduino programming. Each pin operate at
5V and can provide or receive a maximum of 40mA current, and has an internal pull-up
resistor of 20-50 KOhms which are disconnected by default.  Out of these 14 pins, some
pins have specific functions as listed below:

 Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit
TTL
 serial data. They are connected with the corresponding ATmega328P USB to TTL
serial chip.
 External Interrupt Pins 2 and 3: These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value.
 PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using
analogWrite() function.
 SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for
SPI communication.
 In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is
HIGH – LED is on and when pin 13 is LOW, its off.

Along with 14 Digital pins, there are 6 analog input pins, each of which provide 10 bits
of resolution, i.e. 1024 different values. They measure from 0 to 5 volts but this limit can
be increased by using AREF pin with analog Reference() function.  

 Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using
Wire library.

Arduino Uno has a couple of other pins as explained below:

 AREF: Used to provide reference voltage for analog inputs with analog


Reference() function.
 Reset Pin: Making this pin LOW, resets the microcontroller.
 

Communication

Arduino can be used to communicate with a computer, another Arduino board or other
microcontrollers. The ATmega328P microcontroller provides UART TTL (5V) serial
communication which can be done using digital pin 0 (Rx) and digital pin 1 (Tx). An
ATmega16U2 on the board channels this serial communication over USB and appears as
a virtual com port to software on the computer. The ATmega16U2 firmware uses the
standard USB COM drivers, and no external driver is needed. However, on Windows, a
.inf file is required. The Arduino software includes a serial monitor which allows simple
textual data to be sent to and from the Arduino board. There are two RX and TX LEDs
on the arduino board which will flash when data is being transmitted via the USB-to-
serial chip and USB connection to the computer (not for serial communication on pins 0
and 1). A SoftwareSerial library allows for serial communication on any of the Uno's
digital pins. The ATmega328P also supports I2C (TWI) and SPI communication. The
Arduino software includes a Wire library to simplify use of the I2C bus.

Arduino Uno to ATmega328 Pin Mapping

When ATmega328 chip is used in place of Arduino Uno, or vice versa, the image below
shows the pin mapping between the two.
RELAY:

A relay is an electrically activated switch. It consists of an internal coil which creates a


magnetic field that attracts a movable lever and then changes switch contacts when a
current flows through it. The typical usage of relay is to allow a low DC voltage circuit
(circuit #1) to switch on or off a high voltage (DC or AC) circuit (circuit #2) without
direct electrical connection between them. This means circuit #1 and circuit #2 are
magnetically and mechanically linked but not electrically connected. There are some
designations normally used in describing a relay based on its internal structure and pins
distribution as shown in the following:

i) Single Pole Single Throw (SPST) – Such relay has 4 terminal pins which consists of a
pair of coil pins and a pair of pins which can be made connected or disconnected by
activating or deactivating the relay. Such relay can categorized into normally open or
normally closed type.
ii) Single Pole Double Throw (SPST) – Such relay has 5 terminal pins which consists of a
pair of coil pins, a common pin, a normally open (NO) pin and a normally closed (NC)
pin. When the relay is not activated, the common pin is in contact with the NC pin and
when it is activated, the common pin will break away from contact with the NC pin and
subsequently makes contact with the NO pin. Also, when the relay is deactivated (from
activated state), the common pin will conversely break away from contact with the NO
pin and return back in contact with the NC pin.

iii) Double Pole Single Throw (DPST) – Such relay has 6 terminal pins which consist of
a pair of coil pins and two pairs of pins, where pins in each pair can be made connected
or disconnected by activating or deactivating the relay. Such relay is actually a
combination of two SPST relay structures with only one coil pin pair.

iv) Double Pole Double Throw (DPDT) – Such relay has 8 terminal pins which consist of
a pair of coil pins, two 3 pins group for each group consists of a common pin, normally
open (NO) pin and normally (NC) pin. Such relay is actually a combination of two SPDT
relay structures with only one coil pin pair.
Figure 1: Various normal designations of relay

Relays that are normally used in electronic circuits are SPDT and DPDT types due to
their flexibility in controlling circuit switching. In the next section, a demonstration on
identifying the pins of a relay from SPDT or DPDT type without referring to its datasheet
will be illustrated. A 5-pins type relay, a 6-pins type relay and an 8-pins type relay will be
used in this demonstration.

HARDWARE REQUIRED:

 A 5 pins type relay (SRD-05VDC-SL-C) – 1


 A 6 pins type relay (TRB-12VDC-SB-CL) – 1
 An 8 pins type relay (SRC-05VDC-SH) – 1
 Multi meter
 DC Power supply
SOFTWARE REQUIRED:

 None

RELATED REFERENCE:

PART 1: 5 PINS RELAY (SRD-05VDC-SL-C)

1. Let’s start with determining the relay coil pins using a multimeter. Set the multimeter
to resistance measuring mode with a scale of 1000 ohm since the coil resistance normally
ranges between 50 ohm and 1000 ohm.

2. Turn back the relay to see pins located at its bottom part. Try to touch the probes of
multimeter on a pair of pins of the relay until the touched pair shows a resistance value
(but not zero).

**Only the relay coil pin pairs will show non-zero resistance value.

**Other pin pairs will show either zero resistance or infinite resistance.

**There is only 1 pair of coil pins  found in this case

   

a) Top view                                                b ) Bottom view

Figure 2: Overview of the relay (SRD-05VDC-SL-C)


Figure 3: Coil pins of the relay is determined (in this case, the coil resistance is 70 ohm)

3. Since the coil pin pair is found. There is only 3 remaining pins to determine which are
the NC pin, NO pin and common pin. Set your multimeter to continuity test mode. Try to
touch the probes of multimeter on remaining pins to determine which are the pins
actually connected with each other.These pins actually consist of normally closed (NC)
pin/pins and common pin/pins. Based on this finding, the remaining pins must be
normally open (NO) pins.

**In this case, there is only 1 pair of pins found connected. Hence, the 3rd pin must be
the normally open (NO) pin.

**Since there is only 1 NO pin, there will be only 1 NC pin in the connected pair. The
other 1 remaining pin in the connected pair must be a common pin.

4. To differentiate NC pin and common pin from the connected pins, there is a need to
apply voltage across the relay coil so as to activate it. The required activation voltage for
the relay can be determined from its product code in the section of code enclosed with a
dash which contains a number suffixed with VDC as shown below.
Figure 4: The part of product code indicates relay activation voltage

**05VDC indicates that the activation voltage is DC 5V.

**Then, hinging on this basis, 03VDC would indicate that the activation voltage is DC
3V, 12VDC means an activation voltage of DC 12V and so on.

**More often that not, the activation voltage relay may be less than what is stated in the
product code during the real test as long the voltage applied is sufficient to establish a
magnetic field that is able to attract movable lever to normally open (NO) pin so that a
connection between a normally open (NO) pin and common pin is established. 

**Application of the stated activation voltage to a relay can makes it less sensitive to
voltage fluctuation especially in power control due to the power or voltage dip
phenomenon. 

5. Turn on the DC power supply.  Without connecting its output terminal to coil pins of
the relay, please turn the voltage adjusting knobs until the voltage reading reaches the
zero value.
Figure 5: Zero-ing the output voltage of power supply

6. Then, connect the output terminal of DC power supply across the coil pins of the relay
using crocodile clips

**Some relays may have internal suppressing diode installed across its coils  for
protection purpose. Normally, for this kind of relays, the location of the coil pins will be
marked as well as their polarity to prevent any mistaken connection that could destroy the
relays that have been made.

**In this part, the coil  pins of the relay (SRD-05VDC-SL-C) have no polarity marked on
them since the internal suppressing diode is not available. Hence, the positive output of
DC power supply can be connected to any one of the coil pins while negative output of
DC power supply will be connected to another pin of  the coil or vice versa.

7. Next, increase the output voltage by slowly turning the voltage adjusting coarse knob
only in clockwise direction until a “click” sound emitted by the relay is heard ( this
means that the relay is activated). In this case, although the activation voltage stated is
DC 5V, the activation voltage recorded is about 3.3V which is lower.
   

a) Connection of crocodile clips at the relay coil pins   b) Connection of crocodile clips at
the DC power supply

Figure 6: Connect the output terminal of power supply across the coil pins of relay using
crocodile clips

Figure 7: Activation voltage of the relay during this demonstration

8. Then, with the multimeter set to continuity test mode, check which pin is now
connected to the normally open (NO) pin in this moment. That pin would be the common
pin.
Figure 8: Determine the common pin of the relay when the relay is activated

9. Since the common pin is determined, thus another one remaining pin in the connected
pins detected in step 3 must be the normally closed (NC) pin.

10. Now, all the pins of relay have been determined as in Figure 9 below.

Figure 9: The distribution of terminal pins of


relay (SRD-05VDC-SL-C) as determined

**The relay (SRD-05VDC-SL-C) is a single pole double throw (SPDT) type relay.
PART 2: 6 PINS RELAY (TRB-12VDC-SB-CL)

1. Same as previous parts, let’s start with determining the relay coil pins using a
multimeter. Set the multimeter to resistance measuring mode with a scale of 1000 ohm
since the coil resistance normally ranges between 50 ohm and 1000 ohm.

2. Turn back the relay to see pins located at its bottom part. Try to touch the probes of
multimeter on a pair of pins of relay until the touched pair shows a resistance value (but
not zero).

**Only the relay coil pin pairs will show non-zero resistance value.

**Other pin pairs will show either zero resistance or infinite resistance.

**There is only 1 pair of coil pins  found in this case

   

a) Top view                                                      b ) Bottom view

Figure 10: Overview of the relay (TRB-12VDC-SB-CL)

OPTO COUPLER:

An OPTO coupler is an electronic component that interconnects two separate electrical


circuits by means of a light sensitive optical interface.

We know from our tutorials about Transformers that they can not only provide a step-
down (or step-up) voltage, but they also provide “electrical isolation” between the higher
voltage on the primary side and the lower voltage on the secondary side.
In other words, transformers isolate the primary input voltage from the secondary output
voltage using electromagnetic coupling and this is achieved using the magnetic flux
circulating within their laminated iron core.

But we can also provide electrical isolation between an input source and an output load
using just light by using a very common and valuable electronic component called
an Optocoupler.

The basic design of an optocoupler, also known as an Opto-isolator, consists of an LED


that produces infra-red light and a semiconductor photo-sensitive device that is used to
detect the emitted infra-red beam. Both the LED and photo-sensitive device are enclosed
in a light-tight body or package with metal legs for the electrical connections as shown.

An optocoupler or opto-isolator consists of a light emitter, the LED and a light sensitive
receiver which can be a single photo-diode, photo-transistor, photo-resistor, photo-SCR,
or a photo-TRIAC with the basic operation of an optocoupler being very simple to
understand.
Phototransistor Opto coupler:

Assume a photo-transistor device as shown. Current from the source signal passes
through the input LED which emits an infra-red light whose intensity is proportional to
the electrical signal.

This emitted light falls upon the base of the photo-transistor, causing it to switch-ON and
conduct in a similar way to a normal bipolar transistor.

The base connection of the photo-transistor can be left open (unconnected) for maximum
sensitivity to the LEDs infra-red light energy or connected to ground via a suitable
external high value resistor to control the switching sensitivity making it more stable and
resistant to false triggering by external electrical noise or voltage transients.

When the current flowing through the LED is interrupted, the infra-red emitted light is
cut-off, causing the photo-transistor to cease conducting. The photo-transistor can be
used to switch current in the output circuit. The spectral response of the LED and the
photo-sensitive device are closely matched being separated by a transparent medium such
as glass, plastic or air. Since there is no direct electrical connection between the input and
output of an optocoupler, electrical isolation up to 10kV is achieved.

Optocouplers are available in four general types, each one having an infra-red LED
source but with different photo-sensitive devices. The four optocouplers are called
the: Photo-transistor, Photo-darlington, Photo-SCR and Photo-triac as shown below.
Optocoupler Types:

The photo-transistor and photo-darlington devices are mainly for use in DC circuits while
the photo-SCR and photo-triac allow AC powered circuits to be controlled. There are
many other kinds of source-sensor combinations, such as LED-photodiode, LED-
LASER, lamp-photoresistor pairs, reflective and slotted optocouplers.

Simple home made opto-couplers can be constructed by using individual components. An


Led and a photo-transistor are inserted into a rigid plastic tube or encased in heat-
shrinkable tubing as shown. The advantage of this home-made optocoupler is that tubing
can be cut to any length you want and even bent around corners. Obviously, tubing with a
reflective inner would be more efficient than dark black tubing.

Home-made Optocoupler:
Optocoupler Applications:

Optocouplers and opto-isolators can be used on their own, or to switch a range of other
larger electronic devices such as transistors and triacs providing the required electrical
isolation between a lower voltage control signal, for example one from an Arduino or
micro-controller, and a much higher voltage or mains current output signal.

Common applications for opto-couplers include microprocessor input/output switching,


DC and AC power control, PC communications, signal isolation and power supply
regulation which suffer from current ground loops, etc. The electrical signal being
transmitted can be either analogue (linear) or digital (pulses).

In this application, the optocoupler is used to detect the operation of the switch or another
type of digital input signal. This is useful if the switch or signal being detected is within
an electrically noisy environment. The output can be used to operate an external circuit,
light or as an input to a PC or microprocessor.

An Optotransistor DC Switch:

 
Here in this example, the externally connected 270kΩ resistor is used to control the
sensitivity of the photo-transistors base region. The value of the resistor can be chosen to
suit the selected photo-coupler device and the amount of switching sensitivity required.
The capacitor stops any unwanted spikes or transients from false triggering the opto-
transistors base.

As well as detecting DC signals and data, Opto-triac isolators are also available which
allow AC powered equipment and mains lamps to be controlled. Opto-coupled triacs
such as the MOC 3020, have voltage ratings of about 400 volts making them ideal for
direct mains connection and a maximum current of about 100mA. For higher powered
loads, the opto-triac may be used to provide the gate pulse to another larger triac via a
current limiting resistor as shown.

Triac Optocoupler Application:

 This type of optocoupler configuration forms the basis of a very simple solid state relay
application which can be used to control any AC mains powered load such as lamps and
motors. Also unlike a thyristor (SCR), a triac is capable of conducting in both halves of
the mains AC cycle with zero-crossing detection allowing the load to receive full power
without the heavy inrush currents when switching inductive loads.
Optocouplers and Opto-isolators are great electronic devices that allow devices such as
power transistors and triacs to be controlled from a PC’s output port, digital switch or
from a low voltage data signal such as that from a logic gate. The main advantage of
opto-couplers is their high electrical isolation between the input and output terminals
allowing relatively small digital signals to control much large AC voltages, currents and
power.

An optocoupler can be used with both DC and AC signals with optocouplers utilizing a
SCR (thyristor) or triac as the photo-detecting device are primarily designed for AC
power-control applications. The main advantage of photo-SCRs and photo-triacs is the
complete isolation from any noise or voltage spikes present on the AC power supply line
as well as zero-crossing detection of the sinusoidal waveform which reduces switching
and inrush currents protecting any power semiconductors used from thermal stress and
shock.

ENERGY METER:

An electricity meter, electric meter, electrical meter, or energy meter is a device that


measures the amount of electric energy consumed by a residence, a business, or an
electrically powered device.

Electric utilities use electric meters installed at customers' premises for billing purposes.


They are typically calibrated in billing units, the most common one being the kilowatt
hour (kWh). They are usually read once each billing period.

When energy savings during certain periods are desired, some meters may measure
demand, the maximum use of power in some interval. "Time of day" metering allows
electric rates to be changed during a day, to record usage during peak high-cost periods
and off-peak, lower-cost, periods. Also, in some areas meters have relays for demand
response load shedding during peak load periods.
Alternating current (AC):

It is an electric current which periodically reverses direction, in contrast to direct


current (DC) which flows only in one direction. Alternating current is the form in
which electric power is delivered to businesses and residences, and it is the form
of electrical energy that consumers typically use when they plug kitchen appliances,
televisions, fans and electric lamps into a wall socket. A common source of DC power is
a battery cell in a flashlight. The abbreviations AC and DC are often used to mean
simply alternating and direct, as when they modify current or voltage.

The usual waveform of alternating current in most electric power circuits is a sine wave,
whose positive half-period corresponds with positive direction of the current and vice
versa. In certain applications, different waveforms are used, such as triangular or square
waves. Audio and radio signals carried on electrical wires are also examples of
alternating current. These types of alternating current carry information such as sound
(audio) or images (video) sometimes carried by modulation of an AC carrier signal.
These currents typically alternate at higher frequencies than those used in power
transmission.

EQUATIONS AND MATHEMATICAL CALCULATION:

Our system does not contain very vast and difficult calculations. Usually different meters
have different readings.

Some have,

1500 blinks = 1 unit


Mostly, 3200 blinks = 1 unit depends on manufacturer. In our case 3200 blinks of LED is
1 unit. But for practical purpose, Assumption we made in our system,

5 blinks = 1 unit of power consumption.

Let,

X = number of blinks of LED

Y = number of units of electricity.

Z = cost of consumption.

Basically,

No. of units (Y) = (X/3200)

But in our case,

Y = (X/5)

Assume that 1 unit cost = 5rs.

Z = Y * 5rs

For Threshold,

Assumed threshold set value will be = 5 units for practical.

If units reach,

Threshold value – 1 unit = 5-1 = 4 units,

Notification will be send to consumer, if consumer doesn’t react and increase the
threshold value then meter will automatically get OFF.

Again to turn it ON consumer has to visit webpage again to increase threshold value.

For practical purpose increment and decrement of threshold can be done by +5units or
-5units.

UNIT:

Normally, basic unit of electricity is Kilowatt hour (KWh).

1kWh = 1000 watt for 1 hour.


Example,

Ten 100watt bulbs used for 1 hour gives 1kWh

Direct current (DC):

It is the unidirectional flow of electric charge. A battery is a good example of a DC power


supply. Direct current may flow in a conductor such as a wire, but can also flow
through semiconductors, insulators, or even through a vacuum as in electron or ion
beams. The electric current flows in a constant direction, distinguishing it
from alternating current (AC). A term formerly used for this type of current was galvanic
current.

The abbreviations AC and DC are often used to mean simply alternating and direct, as


when they modify current or voltage.

Direct current may be obtained from an alternating current supply by use of a rectifier,
which contains electronic elements (usually) or electromechanical elements (historically)
that allow current to flow only in one direction. Direct current may be converted into
alternating current with an inverter or a motor-generator set.

Direct current is used to charge batteries and as a power supply for electronic systems.
Very large quantities of direct-current power are used in production of aluminum and
other electrochemical processes. It is also used for some railways, especially in urban
areas. High-voltage direct current is used to transmit large amounts of power from remote
generation sites or to interconnect alternating current power grids.
Difference between AC and DC current in tabular form:

Alternating Current (A.C)  Direct Current (D.C)

                                                                     Definition

Alternating current is the type of current Direct current is the type of current which
which changes its direction after 1800. does not change its direction periodicity. It
remains constant.

                                                   Amount of energy which can be carried

A.C current travel safely at a long distance D.C current does not travel safely over a long
without losing much energy. distance because D.C current loss much
energy as compared to A.C.

Frequency

The frequency of A.C current is not zero. The frequency of D.C current remains zero.

Magnitude

The magnitude of alternating current varies The magnitude of D.C current does not vary
with time. with time.

Sources
A.C current is produced mainly by D.C current is produced from battery or cell
Generators. etc.

Power factor

In A.C current power factor always lies In D.C current power factor always remains
between  0 to 1. 1.

Types of Waveforms

Waveforms of A.C current are a sinusoidal, Waveforms of DC current are pulsating and
triangular, square, quasi-square wave. pure.

Passive Parameters

Impedence Resistance only

Applications

It is used in homes, industries etc It is used in refrigerators, TV etc

LCD DISPLAY:

A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated


optical device that uses the light-modulating properties of liquid crystals. Liquid crystals
do not emit light directly, instead using a backlight or reflector to produce images in color
or monochrome. LCDs are available to display arbitrary images (as in a general-purpose
computer display) or fixed images with low information content, which can be displayed
or hidden, such as preset words, digits, and seven-segment displays, as in a digital clock.
They use the same basic technology, except that arbitrary images are made up of a large
number of small pixels, while other displays have larger elements. LCDs can either be
normally on (positive) or off (negative), depending on the polarizer arrangement. For
example, a character positive LCD with a backlight will have black lettering on a
background that is the color of the backlight, and a character negative LCD will have a
black background with the letters being of the same color as the backlight. Optical filters
are added to white on blue LCDs to give them their characteristic appearance.

LCDs are used in a wide range of applications, including LCD televisions, computer


monitors, instrument panels, aircraft cockpit displays, and indoor and outdoor signage.
Small LCD screens are common in portable consumer devices such as digital
cameras, watches, calculators, and mobile telephones, including smart phones. LCD
screens are also used on consumer electronics products such as DVD players, video game
devices and clocks. LCD screens have replaced heavy, bulky cathode ray tube (CRT)
displays in nearly all applications. LCD screens are available in a wider range of screen
sizes than CRT and plasma displays, with LCD screens available in sizes ranging from
tiny digital watches to very large television receivers. LCDs are slowly being replaced
by OLEDs, which can be easily made into different shapes, and have a lower response
time, wider color gamut, virtually infinite color contrast and viewing angles, lower
weight for a given display size and a slimmer profile (because OLEDs use a single glass
or plastic panel whereas LCDs use two glass panels; the thickness of the panels increases
with size but the increase is more noticeable on LCDs) and potentially lower power
consumption (as the display is only "on" where needed and there is no backlight).

OLEDs, however, are more expensive for a given display size due to the very expensive
electroluminescent materials or phosphors that they use. Also due to the use of
phosphors, OLEDs suffer from screen burn-in and there is currently no way to recycle
OLED displays, whereas LCD panels can be recycled, although the technology required
to recycle LCDs is not yet widespread. Attempts to increase the lifespan of LCDs
are quantum dot displays, which offer similar performance as an OLED display, but the
Quantum dot sheet that gives these displays their characteristics can not yet be recycled.

Since LCD screens do not use phosphors, they rarely suffer image burn-in when a static
image is displayed on a screen for a long time, e.g., the table frame for an airline flight
schedule on an indoor sign. LCDs are, however, susceptible to image persistence.[2] The
LCD screen is more energy-efficient and can be disposed of more safely than a CRT can.
Its low electrical power consumption enables it to be used in battery-
powered electronic equipment more efficiently than CRTs can be. By 2008, annual sales
of televisions with LCD screens exceeded sales of CRT units worldwide, and the CRT
became obsolete for most purposes.

LCD operation:

In recent years the LCD is finding widespread use


replacing LED s (seven-segment LED s or other multi-segment LED s).This is due to the
following reasons:

1. The declining prices of LCDs.


2. The ability to display numbers, characters and graphics. This is in contrast to LED
which is limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, there by relieving the CPU
of the task of refreshing the LCD. In the case of LED s, they must be refreshed by
the CPU to keep on displaying the data.
4. Ease of programming for characters and graphics.

LCD pin description:

The LCD discussed in this section has 14 pins. The function of


each pin is given in table.
TABLE 1: Pin description for LCD

Pin symbol I/O Description

1 Vss -- Ground

2 Vcc -- +5V power supply

3 VEE -- Power supply to


control contrast

4 RS I RS=0 to select
command register

RS=1 to select

data register

5 R/W I R/W=0 for write

R/W=1 for read


6 E I/O Enable

7 DB0 I/O The 8-bit data bus

8 DB1 I/O The 8-bit data bus

9 DB2 I/O The 8-bit data bus

10 DB3 I/O The 8-bit data bus

11 DB4 I/O The 8-bit data bus

12 DB5 I/O The 8-bit data bus

13 DB6 I/O The 8-bit data bus

14 DB7 I/O The 8-bit data bus

The LCD can display a character successfully by placing the

1. Data in Data Register


2. Command in Command Register of LCD

1. Data corresponds to the ASCII value of the character to be printed. This can be
done by placing the ASCII value on the LCD Data lines and selecting the Data
Register of the LCD by selecting the RS (Register Select) pin.
2. Each and every display location is accessed and controlled by placing respective
command on the data lines and selecting the Command Register of LCD by
selecting the (Register Select) RS pin.

The commonly used commands are shown below with their operations.

TABLE 2: LCD Command Codes

Code (hex) Command to LCD Instruction Register

1 Clear display screen

2 Return home
4 Decrement cursor

6 Increment cursor

5 Shift display right

7 Shift display left

8 Display off, cursor off

A Display off, cursor on

C Display on, cursor off

E Display on, cursor on

F Display on, cursor blinking

10 Shift cursor position to left

14 Shift cursor position to right

18 Shift the entire display to the left

1C Shift the entire display to the right

80 Force cursor to beginning of 1st line

C0 Force cursor to beginning of 2nd line

38 2 lines and 5x7 matrix

HARDWARE DIAGRAM:
16 x 2 Char LCD

D0 EN RW RS Vf GND
A K D7

ACK
Vcc
D0 – D7

R1

R2

RS (Command / Data):

This bit is to specify weather received byte is command or data. So that LCD can
recognize the operation to be performed based on the bit status.

RS = 0 => Command

RS = 1 => Data

RW (Read / Write):-

RW bit is to specify weather controller wants READ from LCD or WRITE to


LCD. The READ operation here is just ACK bit to know weather LCD is free or not.

RW = 0 => Write

RW = 1 => Read

EN (Enable LCD):-
EN bit is to ENABLE or DISABLE the LCD. When ever controller wants to write
some thing into LCD or READ acknowledgment from LCD it needs to enable the LCD.

EN = 0 => High Impedance

EN = 1 => Low Impedance

ACK (LCD Ready):-

ACK bit is to acknowledge the MCU that LCD is free so that it can send new
command or data to be stored in its internal Ram locations

ACK = 1 => Not ACK

ACK = 0 => ACK

FLOWCHART:
1

Copy Data in to Accumulator

Wait
Yes
Is LCD Free
No

Set RS Bit

Enable LCD

Send Data

Disable LCD

Is Data
Count Zero
No

STOP

Uses:

The LCDs used exclusively in watches, calculators and measuring instruments


are the simple seven-segment displays, having a limited amount of numeric data. The
recent advances in technology have resulted in better legibility, more information
displaying capability and a wider temperature range. These have resulted in the LCDs
being extensively used in telecommunications and entertainment electronics.

So in this project, the LCD is used to display the instantaneous


information. The information may be prompting or alerting or instructing the user.

GSM TECHNOLOGY
Global System for Mobile Communication (GSM) is a set of ETSI standards specifying
the infrastructure for a digital cellular service. The standard is used in approx. 85
countries in the world including such locations as Europe, Japan and Australia1.

GSM Call Routing

Mobile Subscriber Roaming

When a mobile subscriber roams into a new location area (new VLR), the VLR
automatically determines that it must update the HLR with the new location information,
which it does using an SS7 Location Update Request Message. The Location Update
Message is routed to the HLR through the SS7 network, based on the global title
translation of the IMSI that is stored within the SCCP Called Party Address portion of the
message. The HLR responds with a message that informs the VLR whether the subscriber
should be provided service in the new location.

Mobile Subscriber ISDN Number (MSISDN) Call Routing

When a user dials a GSM mobile subscriber's MSISDN, the PSTN routes the call to the
Home MSC based on the dialed telephone number. The MSC must then query the HLR
based on the MSISDN, to attain routing information required to route the call to the
subscribers' current location.

The MSC stores global title translation tables that are used to determine the HLR
associated with the MSISDN. When only one HLR exists, the translation tables are
trivial. When more than one HLR is used however, the translations become extremely
challenging; with one translation record per subscriber (see the example below). Having
determined the appropriate HLR address, the MSC sends a Routing Information Request
to it.

When the HLR receives the Routing Information Request, it maps the MSISDN to the
IMSI, and ascertains the subscribers' profile including the current VLR at which the
subscriber is registered. The HLR then queries the VLR for a Mobile Station Roaming
Number (MSRN). The MSRN is essentially an ISDN telephone number at which the
mobile subscriber can currently be reached. The MSRN is a temporary number that is
valid only for the duration of a single call.

The HLR generates a response message, which includes the MSRN, and sends it
back across the SS7 network to the MSC. Finally, the MSC attempts to complete the call
using the MSRN provided

GSM (Global System for Mobile communication) is a digital mobile telephone


system that is widely used in many parts of the world. GSM uses a variation of Time
Division Multiple Access (TDMA) and is the most widely used of the three digital
wireless telephone technologies (TDMA, GSM, and CDMA). GSM digitizes and
compresses data, then sends it down a channel with two other streams of user data, each
in its own time slot. GSM operates in the 900MHz, 1800MHz, or 1900 MHz frequency
bands.
GSM has been the backbone of the phenomenal success in mobile telecoms over the last
decade. Now, at the dawn of the era of true broadband services, GSM continues to evolve
to meet new demands. One of GSM's great strengths is its international roaming
capability, giving consumers a seamless service. This has been a vital driver in growth,
with around 300 million. In the Americas, today's 7 million subscribers are set to grow
rapidly, with market potential of 500 million in population, due to the introduction of
GSM 800, which allows operators using the 800 MHz band to have access to GSM
technology too.
GSM security issues such as theft of service, privacy, and legal interception continue to
raise significant interest in the GSM community. The purpose of this portal is to raise
awareness of these issues with GSM security.

The mobile communications has become one of the driving forces of the digital
revolution. Everyday, millions of people are making phone calls by pressing a few
buttons. Little is known about how one person's voice reaches the other person's phone
that is thousands of miles away. Even less is known about the security measures and
protection behind the system. The complexity of the cell phone is increasing as people
begin sending text messages and digital pictures to their friends and family. The cell
phone is slowly turning into a handheld computer. All the features and advancements in
cell phone technology require a backbone to support it. The system has to provide
security and the capability for growth to accommodate future enhancements. General
System for Mobile Communications, GSM, is one of the many solutions out there. GSM
has been dubbed the "Wireless Revolution" and it doesn't take much to realize why GSM
provides a secure and confidential method of communication.
Digital containers offer an alternative way of securely delivering content to consumers.
They can offer many advantages, particularly for content delivery over mobile phone
networks:
Scalability
Micro transactions/Micro payments compatibility
Content channel neutrality (heterogeneous networks, unicast /multicast/broadcast etc)
Possibility of DRM
Consumer anonymity
Etc.
GSM Modems
A GSM modem can be an external modem device, such as the Wavecom FASTRACK
Modem. Insert a GSM SIM card into this modem, and connect the modem to an
available serial port on your computer.

A GSM modem can be a PC Card installed in a notebook computer, such as the Nokia
Card Phone.

A GSM modem could also be a standard GSM mobile phone with the appropriate cable
and software driver to connect to a serial port on your computer. Phones such as the
Nokia 7110 with a DLR-3 cable, or various Ericsson phones, are often used for this
purpose.

A dedicated GSM modem (external or PC Card) is usually preferable to a GSM mobile


phone. This is because of some compatibility issues that can exist with mobile phones.
For example, if you wish to be able to receive inbound MMS messages with your
gateway, and you are using a mobile phone as your modem, you must utilize a mobile
phone that does not support WAP push or MMS. This is because the mobile phone
automatically processes these messages, without forwarding them via the modem
interface. Similarly some mobile phones will not allow you to correctly receive SMS text
messages longer than 160 bytes (known as “concatenated SMS” or “long SMS”). This is
because these long messages are actually sent as separate SMS messages, and the phone
attempts to reassemble the message before forwarding via the modem interface. (We’ve
observed this latter problem utilizing the Ericsson R380, while it does not appear to be a
problem with many other Ericsson models.)

When you install your GSM modem, or connect your GSM mobile phone to the
computer, be sure to install the appropriate Windows modem driver from the device
manufacturer. To simplify configuration, the Now SMS/MMS Gateway will
communicate with the device via this driver. An additional benefit of utilizing this driver
is that you can use Windows diagnostics to ensure that the modem is communicating
properly with the computer.
The Now SMS/MMS gateway can simultaneously support multiple modems, provided
that your computer hardware has the available communications port resources.

Fig:16 GSM smart modem


SMART MODEM (GSM/GPRS)
INTRODUCTION :

Analogic’s GSM Smart Modem is a multi-functional, ready to use, rugged and versatile
modem that can be embedded or plugged into any application. The Smart Modem can be
customized to various applications by using the standard AT commands. The modem is
fully type-approved and can directly be integrated into your projects with any or all the
features of Voice, Data, Fax, SMS, and Internet etc.

Smart Modem kit contain the following items:

Analogic’s GSM/GPRS Smart Modem

SMPS based power supply adapter.

3 dBi antenna with cable (optional: other types)

Data cable (RS232)

User Manual

PRODUCT DESCRIPTION:
The connectors integrated to the body, guarantee the reliable output and input
connections. An extractible holder is used to insert the SIM card (Micro-SIM type).
Status LED indicates the operating mode.

Fig 17: Block diagram of modem with key connections


Physical Characteristics
Dimensions 100 x 78 x 32 mm (excluding connectors)
Weight 125 grams
Housing Aluminum Profiled

Temperature Range:
Operating temperature: from -200C to +550C
Storage temperature: from -250C to +700C

Fig 18: Internal diagram of GSM modem

Installing the modem:


To install the modem, plug the device on to the supplied SMPS Adapter. For Automotive
applications fix the modem permanently using the mounting slots (optional as per your
requirement dimensions).

Inserting/ Removing the SIM Card:

To insert or Remove the SIM Card, it is necessary to press the SIM holder ejector button
with Sharp edged object like a pen or a needle. With this, the SIM holder comes out a
little, then pulls it out and insert or remove the SIM Card

Fig 19: Inserting/Removing the sim card into the modem

Make sure that the ejector is pushed out completely before accessing the SIM Card holder
do not remove the SIM card holder by force or tamper it (it may permanently damage).
Place the SIM Card Properly as per the direction of the installation. It is very important
that the SIM is placed in the right direction for its proper working condition

Connecting External Antenna:

Connect GSM Smart Modem to the external antenna with cable end with SMA male. The
Frequency of the antenna may be GSM 900/1800 MHz. The antenna may be ( 0 dbi, 3
dbi or short length L-type antenna) as per the field conditions and signal conditions.

DC Supply Connection

The Modem will automatically turn ON when connection is given to it. The following is
the Power Supply Requirement:
Parameters MIN Avg Max
Supply Voltage 5V 9V 12 V
Peak Current at 5 V supply 1.8 A (during
transmission)
Average Current at 5 V supply in idle 35 mA
Mode
Average Current at 5 V supply in idle 13 mA
Mode and RS232 Power Saving
Activated

Connecting Modem to external devices:

RS232 can be used to connect to the external device through the D-SUB/ USB (for USB
model only) device that is provided in the modem.

Connectors:

Connector Function
SMA RF Antenna connector
15 pin or 9 pin D-SUB USB (optional) RS232 link Audio link (only for 15 D-
SUB) Reset (only for 15 D-SUB) USB
communication port (optional)
2 pin Phoenix tm Power Supply Connector
SIM Connector SIM Card Connection
RJ11 (For 9 D-SUB and USB only) Audio link Simple hand set connection
(4 wire) 2 wire desktop phone
connection

Description of the interfaces:

The modem comprises several interfaces:

LED Function including operating Status


External antenna (via SMA)

Serial and control link

Power Supply (Via 2 pin Phoenix tmcontact)

SIM card holder

LED Status Indicator:

The LED will indicate different status of the modem:

OFF Modem Switched off

ON Modem is connecting to the network

Flashing Slowly Modem is in idle mode

Flashing rapidly Modem is in transmission/communication (GSM only)

9 - PIN D-SUB Female Connector


PIN NAME Designation Type
1 X None NC NC
2 TX Transmit Data Input
3 Rx Receive Data Output
4 DSR Data Set Ready Output
5 GND Ground Ground
6 DTR Data Terminal Ready Input
7 CTS Clear to send Output
8 RTS Request to send Input
9 X None NC NC
Protecting Modem:
Do not expose to the modem to extreme conditions such as High temperatures, direct
sunlight, High Humidity, Rain, Chemicals, Water, Dust etc. For these details see the
specifications given.
Do not drop, Shake or hit the Modem. (Warranty may void)
The Modem should not be used in extreme vibrating conditions
Handle the Antenna and cable with care.
AT commands features:
Line settings:
A serial link handler is set with the following default values Autobaud, 8 bits data, 1 stop
bit, no parity, flow control.
Command line
Commands always start with AT (which means attention) and finish with a <CR>
character.
Information responses and result codes
Responses start and end with <CR><LF>,.
If command syntax is incorrect, an ERROR string is returned.
If command syntax is correct but with some incorrect parameters, the +CME ERROR:
<Err> or +CMS ERROR: <SmsErr> strings are returned with different error codes.
If the command line has been performed successfully, an OK string is returned.
In some cases, such as “AT+CPIN?” or (unsolicited) incoming events, the product does
not return the OK string as a response.

Services provided by GSM

GSM was designed having interoperability with ISDN in mind, and the services provided
by GSM are a subset of the standard ISDN services. Speech is the most basic, and most
important, teleservice provided by GSM.
In addition, various data services are supported, with user bit rates up to 9600 bps.
Specially equipped GSM terminals can connect with PSTN, ISDN, Packet Switched and
Circuit Switched Public Data Networks, through several possible methods, using
synchronous or asynchronous transmission. Also supported are Group 3 facsimile
service, videotex, and teletex. Other GSM services include a cell broadcast service, where
messages such as traffic reports, are broadcast to users in particular cells.
A service unique to GSM, the Short Message Service, allows users to send and receive
point-to-point alphanumeric messages up to a few tens of bytes. It is similar to paging
services, but much more comprehensive, allowing bi-directional messages, store-and-
forward delivery, and acknowledgement of successful delivery.
Supplementary services enhance the set of basic teleservices. In the Phase I
specifications, supplementary services include variations of call forwarding and call
barring, such as Call Forward on Busy or Barring of Outgoing International Calls. Many
more supplementary services, including multiparty calls, advice of charge, call waiting,
and calling line identification presentation will be offered in the Phase 2 specifications.
Architecture of the GSM network
A GSM network is composed of several functional entities, whose functions and
interfaces are specified. Figure 1 shows the layout of a generic GSM network. The GSM
network can be divided into three broad parts. The Mobile Station is carried by the
subscriber. The Base Station Subsystem controls the radio link with the Mobile Station.
The Network Subsystem, the main part of which is the Mobile services Switching Center
(MSC), performs the switching of calls between the mobile users, and between mobile
and fixed network users. The MSC also handles the mobility management operations.
Not shown are the Operations
A GSM network is composed of several functional entities, whose functions and
interfaces are specified. Figure 1 shows the layout of a generic GSM network. The GSM
network can be divided into three broad parts. Subscriber carries the Mobile Station. The
Base Station Subsystem controls the radio link with the Mobile Station. The Network
Subsystem, the main part of which is the Mobile services Switching Center (MSC),
performs the switching of calls between the mobile users, and between mobile and fixed
network users. The MSC also handles the mobility management operations. Not shown is
the Operations intendance Center, which oversees the proper operation and setup of the
network. The Mobile Station and the Base Station Subsystem communicate across the
Um interface, also known as the air interface or radio link. The Base Station Subsystem
communicates with the Mobile services Switching Center across the A interface.
Fig 20: General architecture of a GSM network
Mobile Station:
The mobile station (MS) consists of the mobile equipment (the terminal) and a smart card
called the Subscriber Identity Module (SIM). The SIM provides personal mobility, so that
the user can have access to subscribed services irrespective of a specific terminal. By
inserting the SIM card into another GSM terminal, the user is able to receive calls at that
terminal, make calls from that terminal, and receive other subscribed services.
The mobile equipment is uniquely identified by the International Mobile Equipment
Identity (IMEI). The SIM card contains the International Mobile Subscriber Identity
(IMSI) used to identify the subscriber to the system, a secret key for authentication, and
other information. The IMEI and the IMSI are independent, thereby allowing personal
mobility. The SIM card may be protected against unauthorized use by a password or
personal identity number.
Base Station Subsystem:
The Base Station Subsystem is composed of two parts, the Base Transceiver Station
(BTS) and the Base Station Controller (BSC). These communicate across the
standardized Abis interface, allowing (as in the rest of the system) operation between
components made by different suppliers.
The Base Transceiver Station houses the radio transceivers that define a cell and handles
the radio-link protocols with the Mobile Station. In a large urban area, there will
potentially be a large number of BTSs deployed, thus the requirements for a BTS are
ruggedness, reliability, portability, and minimum cost.
The Base Station Controller manages the radio resources for one or more BTSs. It
handles radio-channel setup, frequency hopping, and handovers, as described below. The
BSC is the connection between the mobile station and the Mobile service Switching
Center (MSC).
Network Subsystem
The central component of the Network Subsystem is the Mobile services Switching
Center (MSC). It acts like a normal switching node of the PSTN or ISDN, and
additionally provides all the functionality needed to handle a mobile subscriber, such as
registration, authentication, location updating, handovers, and call routing to a roaming
subscriber. These services are provided in conjunction with several functional entities,
which together form the Network Subsystem. The MSC provides the connection to the
fixed networks (such as the PSTN or ISDN). Signalling between functional entities in the
Network Subsystem uses Signalling System Number 7 (SS7), used for trunk signalling in
ISDN and widely used in current public networks.
The Home Location Register (HLR) and Visitor Location Register (VLR), together with
the MSC, provide the call-routing and roaming capabilities of GSM. The HLR contains
all the administrative information of each subscriber registered in the corresponding
GSM network, along with the current location of the mobile. The location of the mobile
is typically in the form of the signaling address of the VLR associated with the mobile as
a distributed database station. The actual routing procedure will be described later. There
is logically one HLR per GSM network, although it may be implemented
The Visitor Location Register (VLR) contains selected administrative information from
the HLR, necessary for call control and provision of the subscribed services, for each
mobile currently located in the geographical area controlled by the VLR. Although each
functional entity can be implemented as an independent unit, all manufacturers of
switching equipment to date implement the VLR together with the MSC, so that the
geographical area controlled by the MSC corresponds to that controlled by the VLR, thus
simplifying the signalling required. Note that the MSC contains no information about
particular mobile stations --- this information is stored in the location registers.
The other two registers are used for authentication and security purposes. The Equipment
Identity Register (EIR) is a database that contains a list of all valid mobile equipment on
the network, where each mobile station is identified by its International Mobile
Equipment Identity (IMEI). An IMEI is marked as invalid if it has been reported stolen or
is not type approved. The Authentication Center (AuC) is a protected database that stores
a copy of the secret key stored in each subscriber's SIM card, which is used for
authentication and encryption over the radio channel.

SOFTWARE DISCRIPTION
The Arduino Integrated Development Environment - or Arduino Software (IDE) -

contains a text editor for writing code, a message area, a text console, a toolbar with

buttons for common functions and a series of menus. It connects to the Arduino and

Genuino hardware to upload programs and communicate with them.

Writing Sketches:
Programs written using Arduino Software (IDE) are called sketches. These sketches are
written in the text editor and are saved with the file extension .ino. The editor has features
for cutting/pasting and for searching/replacing text. The message area gives feedback
while saving and exporting and also displays errors. The console displays text output by
the Arduino Software (IDE), including complete error messages and other information.
The bottom righthand corner of the window displays the configured board and serial port.
The toolbar buttons allow you to verify and upload programs, create, open, and save
sketches, and open the serial monitor.

NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches with the
extension .pde. It is possible to open these files with version 1.0, you will be prompted to
save the sketch with the .ino extension on save.

Verify 
Checks your code for errors compiling it.

Upload 
Compiles your code and uploads it to the configured board.
See uploading below for details.

Note: If you are using an external programmer with your board, you can
hold down the "shift" key on your computer when using this icon. The text
will change to "Upload using Programmer"

New 
Creates a new sketch.

Open 
Presents a menu of all the sketches in your sketchbook. Clicking one will
open it within the current window overwriting its content.

Note: due to a bug in Java, this menu doesn't scroll; if you need to open a
sketch late in the list, use the File | Sketchbookmenu instead.

Save 
Saves your sketch.

Serial Monitor 
Opens the serial monitor.
Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help.
The menus are context sensitive, which means only those items relevant to the work
currently being carried out are available.

File

 New 
Creates a new instance of the editor, with the bare minimum structure of a sketch already
in place.
 Open 
Allows to load a sketch file browsing through the computer drives and folders.
 Open Recent 
Provides a short list of the most recent sketches, ready to be opened.
 Sketchbook 
Shows the current sketches within the sketchbook folder structure; clicking on any name
opens the corresponding sketch in a new editor instance.
 Examples 
Any example provided by the Arduino Software (IDE) or library shows up in this menu
item. All the examples are structured in a tree that allows easy access by topic or library.
 Close 
Closes the instance of the Arduino Software from which it is clicked.
 Save 
Saves the sketch with the current name. If the file hasn't been named before, a name will
be provided in a "Save as.." window.
 Save as... 
Allows to save the current sketch with a different name.
 Page Setup 
It shows the Page Setup window for printing.
 Print 
Sends the current sketch to the printer according to the settings defined in Page Setup.
 Preferences 
Opens the Preferences window where some settings of the IDE may be customized, as
the language of the IDE interface.
 Quit 
Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.

Edit

 Undo/Redo 
Goes back of one or more steps you did while editing; when you go back, you may go
forward with Redo.
 Cut 
Removes the selected text from the editor and places it into the clipboard.
 Copy 
Duplicates the selected text in the editor and places it into the clipboard.
 Copy for Forum 
Copies the code of your sketch to the clipboard in a form suitable for posting to the
forum, complete with syntax coloring.
 Copy as HTML 
Copies the code of your sketch to the clipboard as HTML, suitable for embedding in web
pages.
 Paste 
Puts the contents of the clipboard at the cursor position, in the editor.
 Select All 
Selects and highlights the whole content of the editor.
 Comment/Uncomment 
Puts or removes the // comment marker at the beginning of each selected line.
 Increase/Decrease Indent 
Adds or subtracts a space at the beginning of each selected line, moving the text one
space on the right or eliminating a space at the beginning.
 Find 
Opens the Find and Replace window where you can specify text to search inside the
current sketch according to several options.
 Find Next 
Highlights the next occurrence - if any - of the string specified as the search item in the
Find window, relative to the cursor position.
 Find Previous 
Highlights the previous occurrence - if any - of the string specified as the search item in
the Find window relative to the cursor position.

Sketch

 Verify/Compile 
Checks your sketch for errors compiling it; it will report memory usage for code and
variables in the console area.
 Upload 
Compiles and loads the binary file onto the configured board through the configured Port.
 Upload Using Programmer 
This will overwrite the bootloader on the board; you will need to use Tools > Burn
Bootloader to restore it and be able to Upload to USB serial port again. However, it
allows you to use the full capacity of the Flash memory for your sketch. Please note that
this command will NOT burn the fuses. To do so a Tools -> Burn Bootloader command
must be executed.
 Export Compiled Binary 
Saves a .hex file that may be kept as archive or sent to the board using other tools.
 Show Sketch Folder 
Opens the current sketch folder.
 Include Library 
Adds a library to your sketch by inserting #include statements at the start of your code.
For more details, see libraries below. Additionally, from this menu item you can access
the Library Manager and import new libraries from .zip files.
 Add File... 
Adds a source file to the sketch (it will be copied from its current location). The new file
appears in a new tab in the sketch window. Files can be removed from the sketch using
the tab menu accessible clicking on the small triangle icon below the serial monitor one
on the right side o the toolbar.

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. This usually resets the board, if the board supports
Reset over serial port opening.
 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 harware programmer when programming a board or chip and not using
the onboard USB-serial connection. Normally you won't need this, but if you're burning a
bootloader to a new microcontroller, you will use this.
 Burn Bootloader 
The items in this menu allow you to burn a bootloader onto the microcontroller on an
Arduino board. This is not required for normal use of an Arduino or Genuino board but is
useful if you purchase a new ATmega microcontroller (which normally come without a
bootloader). Ensure that you've selected the correct board from the Boards menu before
burning the bootloader on the target board. This command also set the right fuses.

Help

Here you find easy access to a number of documents that come with the Arduino
Software (IDE). You have access to Getting Started, Reference, this guide to the IDE and
other documents locally, without an internet connection. The documents are a local copy
of the online ones and may link back to our online website.
 Find in Reference 
This is the only interactive function of the Help menu: it directly selects the relevant page
in the local copy of the Reference for the function or command under the cursor.

Sketchbook
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store
your programs (or sketches). The sketches in your sketchbook can be opened from
the File > Sketchbook menu or from the Open button on the toolbar. The first time you
run the Arduino software, it will automatically create a directory for your sketchbook.
You can view or change the location of the sketchbook location from with
the Preferences dialog.

Beginning with version 1.0, files are saved with a .ino file extension. Previous versions
use the .pde extension. You may still open .pde named files in version 1.0 and later, the
software will automatically rename the extension to .ino.

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).

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. On the Mac, the serial
port is probably something like /dev/tty.usbmodem241 (for an Uno or Mega2560 or
Leonardo) or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier USB board),
or /dev/tty.USA19QW1b1P1.1 (for a serial board connected with a Keyspan USB-to-
Serial adapter). On Windows, it's probably COM1 or COM2 (for a serial board)
or COM4, COM5, COM7, or higher (for a USB board) - to find out, you look for USB
serial device in the ports section of the Windows Device Manager. On Linux, it should
be /dev/ttyACMx , /dev/ttyUSBx or similar. Once you've selected the correct serial port
and board, press the upload button in the toolbar or select the Upload item from
the Sketch 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).

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 #includestatements 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.

To write your own library, see this tutorial.

Third-Party Hardware
Support for third-party hardware can be added to the hardware directory of your
sketchbook directory. Platforms installed there may include board definitions (which
appear in the board menu), core libraries, bootloaders, and programmer definitions. To
install, create the hardware directory, then unzip the third-party platform into its own sub-
directory. (Don't use "arduino" as the sub-directory name or you'll override the built-in
Arduino platform.) To uninstall, simply delete its directory.

For details on creating packages for third-party hardware, see the Arduino IDE 1.5 3rd
party Hardware specification.

Serial Monitor
This displays serial sent from the Arduino or Genuino board over USB or serial
connector. 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 menu that matches the rate passed
to Serial.begin in your sketch. Note that on Windows, Mac or Linux the board will reset
(it will rerun your sketch) when you connect with the serial monitor. Please note that the
Serial Monitor does not process control characters; if your sketch needs a complete
management of the serial communication with control characters, you can use an external
terminal program and connect it to the COM port assigned to your Arduino board.

You can also talk to the board from Processing, Flash, MaxMSP, etc (see the interfacing
page for details).

Preferences
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.
Language Support

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.
(Note: on Windows and possibly Linux, this is determined by the locale setting which
controls currency and date formats, not by the language the operating system is displayed
in.)

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.

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 bootloader 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 bootloader. 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 Manager 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.

 Arduino Yùn 
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital I/O and 7
PWM.
 Arduino/Genuino Uno 
An ATmega328P running at 16 MHz with auto-reset, 6 Analog In, 14 Digital I/O and 6
PWM.
 Arduino Diecimila or Duemilanove w/ ATmega168 
An ATmega168 running at 16 MHz with auto-reset.
 Arduino Nano w/ ATmega328P 
An ATmega328P running at 16 MHz with auto-reset. Has eight analog inputs.
 Arduino/Genuino Mega 2560 
An ATmega2560 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital I/O and 15
PWM.
 Arduino Mega 
An ATmega1280 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital I/O and 15
PWM.
 Arduino Mega ADK 
An ATmega2560 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital I/O and 15
PWM.
 Arduino Leonardo 
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital I/O and 7
PWM.
 Arduino/Genuino Micro 
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital I/O and 7
PWM.
 Arduino Esplora 
An ATmega32u4 running at 16 MHz with auto-reset.
 Arduino Mini w/ ATmega328P
An ATmega328P running at 16 MHz with auto-reset, 8 Analog In, 14 Digital I/O and 6
PWM.
 Arduino Ethernet 
Equivalent to Arduino UNO with an Ethernet shield: An ATmega328P running at
16 MHz with auto-reset, 6 Analog In, 14 Digital I/O and 6 PWM.
 Arduino Fio 
An ATmega328P running at 8 MHz with auto-reset. Equivalent to Arduino Pro or Pro
Mini (3.3V, 8 MHz) w/ ATmega328P, 6 Analog In, 14 Digital I/O and 6 PWM.
 Arduino BT w/ ATmega328P 
ATmega328P running at 16 MHz. The bootloader burned (4 KB) includes codes to
initialize the on-board bluetooth module, 6 Analog In, 14 Digital I/O and 6 PWM..
 LilyPad Arduino USB 
An ATmega32u4 running at 8 MHz with auto-reset, 4 Analog In, 9 Digital I/O and 4
PWM.
 LilyPad Arduino 
An ATmega168 or ATmega132 running at 8 MHz with auto-reset, 6 Analog In, 14
Digital I/O and 6 PWM.
 Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328P 
An ATmega328P running at 16 MHz with auto-reset. Equivalent to Arduino
Duemilanove or Nano w/ ATmega328P; 6 Analog In, 14 Digital I/O and 6 PWM.
 Arduino NG or older w/ ATmega168 
An ATmega168 running at 16 MHz without auto-reset. Compilation and upload is
equivalent to Arduino Diecimila or Duemilanove w/ ATmega168, but the bootloader
burned has a slower timeout (and blinks the pin 13 LED three times on reset); 6 Analog
In, 14 Digital I/O and 6 PWM.
 Arduino Robot Control 
An ATmega328P running at 16 MHz with auto-reset.
 Arduino Robot Motor 
An ATmega328P running at 16 MHz with auto-reset.
 Arduino Gemma 
An ATtiny85 running at 8 MHz with auto-reset, 1 Analog In, 3 Digital I/O and 2 PWM.

APPLICATIONS:

1. Mainly used to save power.

2. Security.
CONCLUSIONS

Putting a full stop at the wastage of electricity, the problem of load shedding can be dealt
with ease. It is being said that half of India still don’t get electricity which no longer will
be true. Man power will be limited as there won’t be any need of personally visiting each
and every electricity meter as it was in the earlier days. The monopolistic power
distribution market in asia is gradually transforming into a competitive marketplace.
Differentiation in service is going to be the key competitive factor to the improve market
share in the deregulated power markets prepaid meters with their advantages over
conventional ones are likely to help power distributors to differentiate and offer value –
added services to consumers. Encourage consumers to opt for prepaid meters on a
voluntary basis and offering tariff or non-tariff incentives to those consumers who
prepaid their power changes would help the utilities to implement this system
REFERENCES

[1]. Mei-Sung Kang, et.al,“ Implementation of Smart Loading monitoring and Control
System with ZigBee Wireless Network, IEEE Conference on Industrial Electronics and
Applications,pp.907-912,2011-
[2]. Khusvinder Gill, et.al, “ A ZigBee-Based Home Automation System”,IEEE
Transactions on Consumer Electrionics, Vol, 55,No. 2, pp. 422-430 MAY 2009
[3]. N. Sriskanthan, et.al, “ Bluetooth based Home Automation System”, Microprocessors
and Microsystems, Vol. 26,no.6,pp.281-289,2002-
[4]. M. Zeghdoud, et.al, “Impact of Clear Channel Assessment Mode on the Performance
of ZigBee Operating in a WiFi Environment”, IEEE Workshop on Operator-assisted
Community Networks, Berlin, pp. 1-8,September 2006

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