Вы находитесь на странице: 1из 62


With the electric industry undergoing change, increased attention is being

focused on power supply reliability and power quality. Power providers and users
alike are concerned about reliable power, whether the focus is on interruptions and
disturbances or extended outages. Monitoring can provide information about
power flow and demand and help to identify the cause of power system
disturbances. The proposal in this paper is to monitor the power consumed by a
model organization such a household consumers from a centrally located point.
Monitoring the power means calculating the power consumed exactly by the user
at a given time.
The power consumed by the user is measured and communicated to the
controlling substation whenever needed by the person at the substation. The
feedback from the user helps in identifying usages between authorized and
unauthorized users which helps in controlling the power theft, one of the major
challenges in current scenarios. Communication between user/household and
substation can be of wired and wireless. This project discusses in detail the steps
undergone in realizing the work including the design calculations, implementation
and testing. The design was made with reliable and readily available components
in the market. The system was tested and the operations were found satisfactory.


Generation, transmission and distribution of electrical energy involve many

operational losses. Whereas, losses implicated in generation can be technically
defined, but transmission and distribution losses cannot be precisely quantified
with the sending end information. This illustrates the involvement of nontechnical
parameter in transmission and distribution of electricity. Overall technical losses
occur naturally and are caused because of power dissipation in transmission lines,
transformers, and other power system components.
Technical losses in T&D are computed with the information about total load
and the total energy bill. While technology in on the raising slopes, we should also
note the increasing immoral activities. With a technical view, Power Theft is a non
ignorable crime and at the same time it directly affected the economy of a nation.
Electricity theft a social evil, so it has to be completely eliminated. Power
consumption and losses have to be closely monitored so that the generated power
is utilized in a most efficient manner. The system prevents the illegal usage of
electricity. At this point of technological development the problem of illegal usage
of electricity can be solved electronically without any human control .The
implementation of this system will save large amount of electricity, and there by
electricity will be available for more number of consumer then earlier, in highly
populated country such as INDIA.

The theft of the electricity is the major concern of the transmission and
distribution losses in the supply of the electricity worldwide. Mainly the electricity
is being stolen via bypassing the energy meter therefore this wireless system is
utilizes to overcome this type of the theft of the electricity and is very beneficial
for the authorized agency to control its revenue loss as all of us know that the cost
of fuel is increasing day by day hence the intensity of stealing the electricity and
using it as a substitute is also increasing therefore it is needed much to design a
system that can detect the theft of the electricity.
This system would provide a simple way to detect an electrical power theft
without any human interface. It would indicate exact zone and distribution line on
which unauthorized taping is done in real time. It would be time saving if
distribution company personnel take reading by this wireless technique.It would
provide a digital record in case of any judicial dispute. To maximize the profit
margin of power utility company
In the existing methods wireless communication system of energy meter
used with Zigbee, relay control and GPRS. The cryptographic method is used to
secure the communication channel and Zigbee for the transmission of data in a
serial process.
Bandim C.J. et al. proposed utilization of a central observer meter at
secondary terminals of distribution transformer. Vigilant energy metering system
(VEMS) is an advanced energy metering system that can fight against electricity
theft Nagi J. et al. proposed a novel approach of using geneticalgorithm- support
vector machines (GA-SVM) in detecting electricity theft. Modern detecting tools .

Researchers have proposed and developed several techniques for detection

and estimation of electricity theft. Of which, a few methods are illustrated in this
section. Total phase currents at all the distribution transformers and feeder lines
over a period of time are collected. These two values of the current are compared
to estimate the total electricity being lost by the utility company in the form of
theft. Bandim C.J. et al. proposed utilization of a central observer meter at
secondary terminals of distribution transformer.
Value of energy read by the central observer meter is compared with the sum
of energy consumption values read by all energy meters in range. These two values
of the current are compared to estimate the total electricity that is being consumed
illegally. Vigilant energy metering system (VEMS) is an advanced energy metering
system that can fight against electricity theft. It has the ability to collect, transfer
and process data between other energy meters, local station and base station. It also
identifies probable locations of theft and helps the utility companies to control
A remote billing system can also be developed modifying this model. Illegal
consumption of electricity can be detected using a remote check meter based on the
amount of losses and the time stamp of the check meter. This method is
implemented before inspecting the illegal consumers personally by the vigilance
officials, based on the data at proper frequency of the consumer measurements.
This paper undertakes the Check meter and remote meter readers for power theft
identification. In our case, the consumption recurred by the check meter is
compared with the revenue meters consumption.

If there is a difference, then it indicates either there is a theft or revenue

meter malfunction. The check meter can also be used to monitor the energy used
on the secondary of a distribution transformer serving several customers and
compared to the sum of all the meter usage.
Besides spotting out the line where power theft is suspected to occur, it also
detects the amount of energy stolen. Compact size, lightweight for quick and high
accuracy make the system more effective. Power theft identification, in this paper,
is done by converting the disc revolutions of each consumer's energy meter and
distribution transformer into pulses. These pulses are frequency division
multiplexed and transmitted through power line. These signals are individually
picked and counted at the receiver end. If the difference of the sum of the
consumer's readings and that of distribution transformer exceeds the preset value,
which is set by considering transmission loss, the power theft is said to occur.

In this project you start or stop the meter by a unique number sms via gsm
system. This PIN number is sent to microcontroller. Here the microcontroller is the
flash type re programmable microcontroller which we have already programmed
with PIN number. So the typed PIN number is compared with stored number if the
PIN number is valid the microcontroller activates the relay driver circuit. Relay
output is directly given to meter system. Now we can start the meter. This is for the
purpose of theft identification and prevention. The microcontroller is also
programmed to limit the power consumption to a certain limit for particular
periods of time. The microcontroller will switch off the lights and fans if the
consumption limit is exceeded for a particular time of the day.

The Wilson WCS2720 has precise solutions for AC or DC current sensing in
industrial, commercial, and communications systems. The device package allows
for easy implementation by the customer. Typical load detection and management,
switch mode power supplies, and over current fault protection. The device is not
intended for automotive applications. The device consists of a precise, low-offset,
linear Hall circuit with a copper conduction path located near the surface of the die.
Applied current flowing through this copper conduction path generates a magnetic
field which the close proximity of the magnetic signal to the Hall transducer. A
precise, proportional voltage is provided by the low-offset, chopper-stabilized
BiCMOS Hall IC, which is programmed for accuracy after packaging.
The output of the device has a positive slope (>VIOUT (Q)) when an
increasing current flows through the primary copper conduction path (from pins 1
and 2, to pins 3 and 4), which is the path used for current sampling. The internal
resistance of this conductive path is 1.2 m typical, providing low power loss

The diagram below shows the flow of the data via a GSM module. The first
embedded device is the microcontroller which sends the data to the module. The
module then via wireless link will send the data to the GSM receiver in mobile
phone. The mobile phone here acts as a second embedded device which reads the

More and more applications emerged with the rapid development of wireless
data services, such as meter navigation, remote monitoring, wireless Internet
access, wireless POS, etc. Thus, more and more devices need to be able to do
wireless communication.
GSM/GPRS Modem-RS232 is built with Dual Band GSM/GPRS engineSIM900A, works on frequencies 900/ 1800 MHz. The Modem is coming with
RS232 interface, which allows you connect PC as well as microcontroller with
RS232 Chip(MAX232). The baud rate is configurable from 9600-115200 through
AT command. The GSM/GPRS Modem is having internal TCP/IP stack to enable
you to connect with internet via GPRS. It is suitable for SMS, Voice as well as
DATA transfer application in M2M interface.

The onboard Regulated Power supply allows you to connect wide range
unregulated power supply. Using this modem, you can make audio calls, SMS,
Read SMS, attend the incoming calls and internet act through simple AT
This GSM Modem can accept any GSM network operator SIM card and act
just like a mobile phone with its own unique phone number. Advantage of using
this modem will be that you can use its RS232 port to communicate and develop
embedded applications. Applications like SMS Control, data transfer, remote
control and logging can be developed easily.
The modem can either be connected to PC serial port directly or to any
microcontroller through MAX232. It can be used to send and receive SMS or
make/receive voice calls. It can also be used in GPRS mode to connect to internet
and do many applications for data logging and control. In GPRS mode you can
also connect to any remote FTP server and upload files for data logging.










band SIM900A GSM modem for direct and easy integration to RS232
applications. Supports features like Voice, SMS, Data/Fax, GPRS and integrated
TCP/IP stack.
The SIM900 is a complete Quad-band GSM/GPRS solution in a SMT
module which can be embedded in the customer applications. Featuring an






850/900/1800/1900MHz performance for voice, SMS, Data, and Fax in a small

form factor and with low power consumption.

With a tiny configuration of 24mm x 24mm x 3 mm, SIM900 can fit almost
all the space requirements in your M2M application, especially for slim and
compact demand of design. SIM900 is designed with a very powerful single-chip
processor integrating AMR926EJ-S core Quad - band GSM/GPRS module with a
size of 24mmx24mmx3mm SMT type suit for customer application An
embedded Powerful TCP/IP protocol stack Based upon mature and field-proven
platform, backed up by our support service, from definition to design and

This is a GSM/GPRS-compatible Quad-band cell phone, which works on a

frequency of 850/900/1800/1900MHz and which can be used not only to access the
Internet, but also for oral communication (provided that it is connected to a
microphone and a small loud speaker) and for SMSs.

Externally, it looks like a big package (0.94 inches x 0.94 inches x 0.12
inches) with L-shaped contacts on four sides so that they can be soldered both on
the side and at the bottom. Internally, the module is managed by an AMR926EJ-S
processor, which controls phone communication, data communication (through an
integrated TCP/IP stack), and (through an UART and a TTL serial interface) the
communication with the circuit interfaced with the cell phone itself.
In addition, the GSM900 device integrates an analog interface, an A/D
converter, an RTC, an SPI bus, an IC, and a PWM module. The radio section is
GSM phase 2/2+ compatible and is either class 4 (2 W) at 850/ 900 MHz or class





The TTL serial interface is in charge not only of communicating all the data
relative to the SMS already received and those that come in during TCP/IP sessions
in GPRS (the data-rate is determined by GPRS class 10: max. 85,6 kbps), but also
of receiving the circuit commands (in our case, coming from the PIC governing the
remote control) that can be either AT standard or AT-enhanced SIMCom. The
module is supplied with continuous energy (between 3.4 and 4.5 V) and absorbs a
maximum of 0.8 A during transmission.

SMS based Remote Control & Alerts
Security Applications
Sensor Monitoring
GPRS Mode Remote Data Logging

GSM/GPRS Modem Fetures

High Quality Product (Not hobby grade)

Dual-Band GSM/GPRS 900/ 1800 MHz

RS232 interface for direct communication with computer or MCU kit

Configurable baud rate

Wire Amntenna ( SMA connector with GSM Antenna Optional )

SIM Card holder.

Built in Network Status LED

Inbuilt Powerful TCP/IP protocol stack for internet data transfer over GPRS.

Normal operation temperature: -20 C to +55 C

Input Voltage: 12V DC

More and more applications emerged with the rapid development of wireless
data services, such as meter navigation, remote monitoring, wireless Internet
access, wireless POS, etc. Thus, more and more devices need to be able to do
wireless communication.With this background, Sky microwave Corp. develops its
MOD 9001 BENQ GSM/GPRS Modem. Users of this product can add wireless
communication capability easily to their own products, and then, develop many
The MOD 9001 BENQ GSM/GPRS Modem mostly fits the need of data
transfer, with SMS data communication, GPRS data navigation, Circuit Switch /
Data Connectivity, TCP/IP protocol etc. Because the easy setting up in SCM
(Single Chip Micyoco), it is convenient for network data communication. The
MOD 9001 BENQ GSM/GPRS Modem with small size, which fits both embedded
application and external peripheral equipment.

The AT command set and RS232 interface will offer easy data connection
without any extra circuit control. Traditionally, the above applications use digital
cellular, CDPD or other wire-line modem to do communication, and these
technologies are of the disadvantages of high communication expense, limited
communication range, dial before communications, etc. When we begin to use
MOD 9001 BENQ GSM/GPRS Modem, all these problems disappeared
Power Measurement And Theft Detection
Aim of the Remote power monitoring is to measure the exact amount of
power that is consumed by the user at a given instant of time so the power
measurement unit is essential and is connected on the consumer side. The power is
measured by using the instrument transformers. Instrument transformers are used
for measurement and protective application, together with equipment such as
meters and relays. Their role in electrical systems is of primary importance as they
are a means of "stepping down" the current or voltage of a system to measurable
values, such as 5A or 1A in the case of a current transformers or 110V or 100V in
the case of a voltage transformer. This offers the advantage that measurement and
protective equipment can be standardized on a few values of current and voltage.
The types of instrument transformers available are
Voltage transformers
Current transformers.

The voltage transformer is one in which "the secondary voltage is
substantially proportional to the primary voltage and differs in phase from it by an
angle which is approximately zero for an appropriate direction of the connections."
In an "ideal" transformer, the secondary voltage vector is exactly opposite and
equal to the primary voltage vector, when multiplied by the turns ratio.
In a "practical" transformer, errors are introduced because some current is
drawn for the magnetization of the core and because of drops in the primary and
secondary windings due to leakage reactance and winding resistance. One can thus
talk of a voltage error, which is the amount by which the voltage is less than the
applied primary voltage, and the phase error, which is the phase angle by which the
reversed secondary voltage vector is displaced from the primary voltage vector.
A current transformer is defined as "as an instrument transformer in which
the secondary current is substantially proportional to the primary current (under
normal conditions of operation) and differs in phase from it by an angle which is
approximately zero for an appropriate direction of the connections."
This highlights the accuracy requirement of the current transformer but also
important is the isolating function, which means no matter what the system voltage
the secondary circuit need be insulated only for a low voltage. The current
transformer works on the principle of variable flux. In the "ideal" current
transformer, secondary current would be exactly equal (when multiplied by the
turns ratio) and opposite of the primary current. But, as in the voltage transformer,
some of the primary current or the primary ampere-turns are utilized for
magnetizing the core, thus leaving less than the actual primary ampere turns to be
"transformed" into the secondary ampere-turns.

This naturally introduces an error in the transformation. The error is

classified into two-the current or ratio error and the phase error. Thus by
considering all these parameters we program micro controllers to calculate the
amount of power actually consumed.
Theft detection method
The simple formula behind theft detection is whenever input power is
passing from supplier to the receiver, at that time if the total amount of power is
not received by the receiver then there is possibility of theftof energy.
Psent = Pconsumed + Loss ..No Theft
Psent Pconsumed + Loss ..Theft Occur
Here, Psent = Power measured by pole side energy meter
Pconsumed = Power measured by load side energy meter
There are many factors that encourage people to steal electricity. Of which
socio-economic factors influences people to a great extent in stealing electricity. A
common notion in many people is that, it is dishonest to steal something from their
neighbor but not from the state or public owned utility company. In addition, other
factors that influence illegal consumers are:
Higher energy prices deject consumers from buying electricity. Table II illustrates
energy prices in different countries. In light of this, rich and highly educated
communities also steal electricity to escape from hugeutility bills.

Growing unemployment rate show severe effect on the customers economic

situation. Lower illiteracy rate in under developed communities has greater impact
on illegal consumers, as they might not be aware of the issues, laws and offenses
related to the theft.
Weak economic situation in many countries has implied its effect directly on
common man.
In view of socio economic conditions of the customer, electricity theft is
proportional to the tariff of electricity utilization.
Countries with weak enforcement of law against electricity theft have recorded
high proportion of theft.
Corrupt political leaders and employees of the utility company are responsible for
billing irregularities
A. Financial Rewards
Utility companies encourage consumers to report electricity theft, sometimes
offering big rewards for information leading to conviction of anyone stealing
electricity. Unfortunately, most cases are never identified in the apartment industry
due to lack of timely information.
B. Periodic Checks
Electricity theft frequently takes place after service has been disconnected.
Some utility companies periodically check disconnected meters if the customer has
not contacted them to reconnect service. This labor-intensive, manual process has
little chance of success given that the apartment industry averages 70% turnover of
tenants annually.

C. Meter Readers
Utility meter readers typically suspect that electricity theft is taking place
when they find a broken meter tag or other signs of tampering. But as more utility
companies outsource the meter reading function to third parties, training meter
readers to detect theft is becoming more difficult and less efficient. In addition,
third party meter readers do not read disconnected meters.
In most of our electronic products or projects we need a power supply for
converting mains AC voltage to a regulated DC voltage. For making a power
supply designing of each and every component is essential. Here Im going to
discuss the designing of regulated 5V Power Supply.
Lets start with very basic things the choosing of components
Component List :
1. Step down transformer
2. Voltage regulator
3. Capacitors
4. Diodes
Voltage regulator :
As we require a 5V we need LM7805 Voltage Regulator IC.
7805 IC Rating :
Input voltage range 7V- 35V

Current rating Ic = 1A
Output voltage range VMax=5.2V ,VMin=4.8V

LM7805 Pin Diagram

Operation of Regulated Power Supply
Step Down Transformer
A step down transformer will step down the voltage from the ac mains to the
required voltage level. The turns ratio of the transformer is so adjusted such as to
obtain the required voltage value. The output of the transformer is given as an
input to the rectifier circuit.
Rectifier is an electronic circuit consisting of diodes which carries out the
rectification process. Rectification is the process of converting an alternating
voltage or current into corresponding direct (dc) quantity. The input to a rectifier is
ac whereas its output is unidirectional pulsating dc. Usually a full wave rectifier or
a bridge rectifier is used to rectify both the half cycles of the ac supply (full wave
rectification). Figure below shows a full wave bridge rectifier.

A bridge rectifier consists of four p-n junction diodes connected in the above
shown manner. In the positive half cycle of the supply the voltage induced across
the secondary of the electrical transformer i.e. VMN is positive. Therefore point E
is positive with respect to F. Hence, diodes D 3 and D2 are reversed biased and
diodes D1 and D4 are forward biased. The diode D3 and D2 will act as open
switches (practically there is some voltage drop) and diodes D1 andD4 will act as
closed switches and will start conducting. Hence a rectified waveform appears at
the output of the rectifier as shown in the first figure. When voltage induced in
secondary i.e. VMN is negative than D 3 and D2 are forward biased with the other
two reversed biased and a positive voltage appears at the input of the filter.
DC Filteration
The rectified voltage from the rectifier is a pulsating dc voltage having very high
ripple content. But this is not we want, we want a pure ripple free dc waveform.
Hence a filter is used. Different types of filters are used such as capacitor filter, LC
filter, Choke input filter, type filter. Figure below shows a capacitor filter
connected along the output of the rectifier and the resultant output waveform.



instantaneous voltage starts increasing the capacitor charges, it charges till the
waveform reaches its peak value. When the instantaneous value starts reducing the
capacitor starts discharging exponentially and slowly through the load (input of the
regulator in this case). Hence, an almost constant dc value having very less ripple
content is obtained.
This is the last block in a regulated DC power supply. The output voltage or
current will change or fluctuate when there is change in the input from ac mains or
due to change in load current at the output of the regulated power supply or due to
other factors like temperature changes. This problem can be eliminated by using a
regulator. A regulator will maintain the output constant even when changes at the
input or any other changes occur.

Transistor series regulator, Fixed and variable IC regulators or a zener diode

operated in the zener region can be used depending on their applications. ICs like
78XX and 79XX are used to obtained fixed values of voltages at the output. With
ICs like LM 317 and 723 etc we can adjust the output voltage to a required
constant value. Figure below shows the LM317 voltage regulator.
The output voltage can be adjusted with adjusting the values of resistances
R1 and R2. Usually coupling capacitors of values about 0.01F to 10F needs to be
connected at the output and input to address input noise and output transients.








Figure below shows the complete circuit of a regulated +5V DC power

supply using transformer, bridge rectifier, filter (smoothing) and a fixed +5 V
voltage regulator. Here we can use IC 7803(for 3V),7809(for 9 V),7812(for 12V)

Application of Regulated Power Supply









electrical,electronics and as well as automation equipment.

Mobile phone charger, oscilator, amplifier are needed the
regulated power supply
Understanding 7805 IC Voltage Regulator
A regulated power supply is very much essential for several electronic
devices due to the semiconductor material employed in them have a fixed rate of
current as well as voltage. The device may get damaged if there is any deviation
from the fixed rate. The AC power supply gets converted into constant DC by this
circuit. By the help of a voltage regulator DC, unregulated output will be fixed to a
constant voltage.

The circuit is made up of linear voltage regulator 7805 along with capacitors
and resistors with bridge rectifier made up from diodes. From giving an
unchanging voltage supply to building confident that output reaches uninterrupted
to the appliance, the diodes along with capacitors handle elevated efficient signal
As we have previously talked about that regulated power supply is a device
that mechanized on DC voltages and also it can uphold its output accurately at a
fixed voltage all the time although if there is a significant alteration in the DC
input voltage. ICs regulator is mainly used in the circuit to maintain the exact
voltage which is followed by the power supply.
A regulator is mainly employed with the capacitor connected in parallel to
the input terminal and the output terminal of the IC regulator. For the checking of
gigantic alterations in the input as well as in the output filter, capacitors are used.
While the bypass capacitors are used to check the small period spikes on the input
and output level. Bypass capacitors are mainly of small values that are used to
bypass the small period pulses straightly into the Earth. A circuit diagram having
regulator IC and all the above discussed components arrangement revealed in the
figure below.

As we have made the whole circuit till now to be operated on the 5V DC

supply, so we have to use an IC regulator for 5V DC. And the most generally used
IC regulators get into the market for 5V DC regulation use is 7805. So we are
connecting the similar IC in the circuit as U1. IC 7805 is a DC regulated IC of 5V.
This IC is very flexible and is widely employed in all types of circuit like a voltage
regulator. It is a three terminal device and mainly called input , output and ground.
Pin diagram of the IC 7805 is shown in the diagram below.

The output generated from the unregulated DC output is susceptible to the

fluctuations of the input signal. IC voltage regulator is connected with bridge
rectifier in series in these project so to steady the DC output against the variations
in the input DC voltage.

To obtain a stable output of 5V, IC 7805 is attached with 6-0-6V along with
500mA step down transformer as well as with rectifier. To suppress the oscillation
which might generate in the regulator IC, C2 capacitor of 0.1 uF value is used.
When the power supply filter is far away from the regulated IC capacitor C2 is
used. Ripple rejection in the regulator is been improved by C4 capacitor(35uf) by
avoiding the ripple voltage to be amplified at the regulator output.
The output voltage is strengthen and deduction of the output voltage is done
capacitor C3(0.1uF). To avoid the chance of the input get shorted D5 diode is used
to save the regulator. If D5 is not presented in the circuit, the output capacitor can
leave its charge immediately during low impedance course inside the regulators.
The Arduino microcontroller is an easy to use yet powerful single board
computer that has gained considerable traction in the hobby and professional
market. The Arduino is open-source, which means hardware is reasonably priced
and development software is free. This guide is for students in ME 2011, or
students anywhere who are confronting the Arduino for the first time. For
advanced Arduino users, prowl the web; there are lots of resources.
The Arduino project was started in Italy to develop low cost hardware for
interaction design. An overview is on the Wikipedia entry for Arduino. The
Arduino hardware comes in several flavors. In the United States, Sparkfun

(www.sparkfun.com) is a good source for Arduino hardware. The Arduino board,

you can write programs and create interface circuits to read switches and other
sensors, and to control motors and lights with very little effort.
Many of the pictures and drawings in this guide were taken from the
documentation on the Arduino site, the place to turn if you need more information.
The Arduino section covers more on interfacing the Arduino to the real
world. The Duemilanove board features an Atmel ATmega328 microcontroller
operating at 5 V with 2 Kb of RAM, 32 Kb of flash memory for storing programs
and 1 Kb of EEPROM for storing parameters. The clock speed is 16 MHz, which
translates to about executing about 300,000 lines of C source code per second. The
board has 14 digital I/O pins and 6 analog input pins. There is a USB connector for
talking to the host computer and a DC power jack for connecting an external 6-20
V power source, for example a 9 V battery, when running a program while not
connected to the host computer. Headers are provided for interfacing to the I/O
pins using 22 g solid wire or header connectors.
An Arduino board historically consists of an Atmel 8-, 16- or 32bit AVR microcontroller (although since 2015 other makers' microcontrollers have
been used) with complementary components that facilitate programming and
incorporation into other circuits. An important aspect of the Arduino is its standard
connectors, which lets users connect the CPU board to a variety of interchangeable
add-on modules known as shields.
Some shields communicate with the Arduino board directly over various pins,
but many shields are individually addressable via an IC serial busso many shields
can be stacked and used in parallel. Prior to 2015 Official Arduinos had used the
AtMel megaAVR series




the ATmega8, ATmega168, ATmega328, ATmega1280, and ATmega2560 and in 2015

units by other manufacturers were added. A handful of other processors have also
been used by Arduino compatibles. Most boards include a 5 V linear regulator and a
16 MHz crystal oscillator (or ceramic resonator in some variants), although some
designs such as the LilyPad run at 8 MHz and dispense with the onboard voltage
regulator due to specific form-factor restrictions.
An Arduino's microcontroller is also pre-programmed with a boot loader that
simplifies uploading of programs to the on-chip flash memory, compared with other
devices that typically need an external programmer. This makes using an Arduino
more straightforward by allowing the use of an ordinary computer as the programmer.
Currently, optiboot bootloader is the default bootloader installed on Arduino UNO.
At a conceptual level, when using the Arduino integrated development
environment, all boards are programmed over a serial connection. Its implementation
varies with the hardware version. Some serial Arduino boards contain a level shifter
circuit to convert between RS-232 logic levels and TTL-level signals. Current
Arduino boards are programmed via Universal Serial Bus (USB), implemented using
USB-to-serial adapter chips such as the FTDI FT232.
Some boards, such as later-model Uno boards, substitute the FTDI chip with a
separate AVR chip containing USB-to-serial firmware, which is reprogrammable via
its own ICSP header. Other variants, such as the Arduino Mini and the unofficial
Boarduino, use a detachable USB-to-serial adapter board or cable, Bluetooth or other
methods, when used with traditional microcontroller tools instead of the Arduino IDE,
standard AVR ISP programming is used.

The Arduino board exposes most of the microcontroller's I/O pins for use by
other circuits. The Diecimila, Duemilanove, and current Uno provide 14 digital I/O
pins, six of which can produce pulse-width modulated signals, and six analog inputs,
which can also be used as six digital I/O pins. These pins are on the top of the board,
via female 0.10-inch (2.5 mm) headers. Several plug-in application shields are also
commercially available.
The Arduino Nano, and Arduino-compatible Bare Bones Board [9] and Boarduino
boards may provide male header pins on the underside of the board that can plug
into solderless breadboards.
There are many Arduino-compatible and Arduino-derived boards. Some are
functionally equivalent to an Arduino and can be used interchangeably. Many enhance
the basic Arduino by adding output drivers, often for use in school-level education to
simplify the construction of buggies and small robots. Others are electrically
equivalent but change the form factor, sometimes retaining compatibility with shields,
sometimes not. Some variants use completely different processors, with varying levels
of compatibility.

Digital Pins
In addition to the specific functions listed below, the digital pins on an
Arduino board can be used for general purpose input and output via the pinMode(),
digitalRead(), and digitalWrite() commands. Each pin has an internal pull-up
resistor which can be turned on and off using digitalWrite() (w/ a value of HIGH or
LOW, respectively) when the pin is configured as an input. The maximum current
per pin is 40 mA.
Serial: 0 (RX) and 1 (TX).
Used to receive (RX) and transmit (TX) TTL serial data. On the Arduino
Diecimila, these pins are connected to the corresponding pins of the FTDI USB-toTTL Serial chip. On the Arduino BT, they are connected to the corresponding pins
of the WT11 Bluetooth module. On the Arduino Mini and LilyPad Arduino, they
are intended for use with an external TTL serial module (e.g. the Mini-USB
Adapter). External Interrupts: 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. See the
attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function. On boards with an ATmega8, PWM output is available only on pins 9,
10, and 11.
BT Reset: 7. (Arduino BT-only) Connected to the reset line of the bluetooth
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which, although provided by the underlying hardware, is not
currently included in the Arduino language.
LED: 13. On the Diecimila and LilyPad, there is a built-in LED connected to
digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW,
it's off.
Analog Pins
In addition to the specific functions listed below, the analog input pins
support 10-bit analog-to-digital conversion (ADC) using the analogRead()
function. Most of the analog inputs can also be used as digital pins: analog input 0
as digital pin 14 through analog input 5 as digital pin 19. Analog inputs 6 and 7
(present on the Mini and BT) cannot be used as digital pins.
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire
library .
Power Pins
VIN (sometimes labelled "9V"). The input voltage to the Arduino 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.

Note that different boards accept different input voltages ranges, please see
the documentation for your board. Also note that the LilyPad has no VIN pin and
accepts only a regulated input. 5V. The regulated power supply used to power the
microcontroller and other components on the board. This can come either from
VIN via an on-board regulator, or be supplied by USB or another regulated 5V
supply. 3V3. (Diecimila-only) A 3.3 volt supply generated by the on-board FTDI
chip. GND. Ground pins.
Other Pins
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. (Diecimila-only) Bring this line LOW to reset the microcontroller.Typically
used to add a reset button to shields which block the one on the board.

A relay is an electrically operated switch. Many relays use an electromagnet
to operate a switching mechanism mechanically, but other operating principles are
also used. Relays are used where it is necessary to control a circuit by a low-power
signal (with complete electrical isolation between control and controlled circuits),
or where several circuits must be controlled by one signal. The first relays were
used in long distance telegraph circuits, repeating the signal coming in from one
circuit and re-transmitting it to another. Relays were used extensively in telephone
exchanges and early computers to perform logical operations.
A type of relay that can handle the high power required to directly control an
electric motor or other loads is called a contactor. Solid-state relays control power
circuits with no moving parts, instead using a semiconductor device to perform

switching. Relays with calibrated operating characteristics and sometimes multiple

operating coils are used to protect electrical circuits from overload or faults; in
modern electric power systems these functions are performed by digital
instruments still called "protective relays".

Basic Design and Operation:

A simple electromagnetic relay consists of a coil of wire wrapped around a
soft iron core, an iron yoke which provides a low reluctance path for magnetic
flux, a movable iron armature, and one or more sets of contacts (there are two in
the relay pictured). The armature is hinged to the yoke and mechanically linked to
one or more sets of moving contacts.
It is held in place by a spring so that when the relay is de-energized there is
an air gap in the magnetic circuit. In this condition, one of the two sets of contacts
in the relay pictured is closed, and the other set is open. Other relays may have
more or fewer sets of contacts depending on their function. The relay in the picture
also has a wire connecting the armature to the yoke. This ensures continuity of the
circuit between the moving contacts on the armature, and the circuit track on the
printed circuit board (PCB) via the yoke, which is soldered to the PCB.

When an electric current is passed through the coil it generates a magnetic

field that activates the armature and the consequent movement of the movable
contact either makes or breaks (depending upon construction) a connection with a
fixed contact. If the set of contacts was closed when the relay was de-energized,
then the movement opens the contacts and breaks the connection, and vice versa if
the contacts were open. When the current to the coil is switched off, the armature is
returned by a force, approximately half as strong as the magnetic force, to its
relaxed position. Usually this force is provided by a spring, but gravity is also used
commonly in industrial motor starters. Most relays are manufactured to operate
quickly. In a low-voltage application this reduces noise; in a high voltage or
current application it reduces arcing.
When the coil is energized with direct current, a diode is often placed across
the coil to dissipate the energy from the collapsing magnetic field at deactivation,
which would otherwise generate a voltage spike dangerous to semiconductor
circuit components. Some automotive relays include a diode inside the relay case.
Alternatively, a contact protection network consisting of a capacitor and
resistor in series (snubber circuit) may absorb the surge. If the coil is designed to
be energized with alternating current (AC), a small copper "shading ring" can be

crimped to the end of the solenoid, creating a small out-of-phase current which
increases the minimum pull on the armature during the AC cycle.[1]
A solid-state relay uses a thyristor or other solid-state switching device,
activated by the control signal, to switch the controlled load, instead of a solenoid.
An optocoupler (a light-emitting diode (LED) coupled with a photo transistor) can
be used to isolate control and controlled circuits.
Types of Relay:

Latching relay
Read relay
Mercury-wetted relay
Mercury relay
Polarized relay
Machine tool relay

Ratchet relay

Coaxial relay
Solid state relay
Solid state contactor relay
Overload protection relay
Vacuum relay

Pole and Throw:

Since relays are switches, the terminology applied to switches is also applied to
relays; a relay switches one or more poles, each of whose contacts can be thrown
by energizing the coil in one of three ways:

Normally-open (NO) contacts connect the circuit when the relay is

activated; the circuit is disconnected when the relay is inactive. It is also
called a Form A contact or "make" contact. NO contacts may also be
distinguished as "early-make" or NOEM, which means that the contacts
close before the button or switch is fully engaged.
Normally-closed (NC) contacts disconnect the circuit when the relay is
activated; the circuit is connected when the relay is inactive. It is also called
a Form B contact or "break" contact. NC contacts may also be distinguished
as "late-break" or NCLB, which means that the contacts stay closed until the
button or switch is fully disengaged.
Change-over (CO), or double-throw (DT), contacts control two circuits: one
normally-open contact and one normally-closed contact with a common
terminal. It is also called a Form C contact or "transfer" contact ("break
before make"). If this type of contact utilizes a "make before break"
functionality, then it is called a Form D contact.

The following designations are commonly encountered:

SPST Single Pole Single Throw. These have two terminals which can be
connected or disconnected. Including two for the coil, such a relay has four
terminals in total. It is ambiguous whether the pole is normally open or

normally closed. The terminology "SPNO" and "SPNC" is sometimes used

to resolve the ambiguity.
SPDT Single Pole Double Throw. A common terminal connects to either
of two others. Including two for the coil, such a relay has five terminals in
DPST Double Pole Single Throw. These have two pairs of terminals.
Equivalent to two SPST switches or relays actuated by a single coil.
Including two for the coil, such a relay has six terminals in total. The poles
may be Form A or Form B (or one of each).
DPDT Double Pole Double Throw. These have two rows of change-over
terminals. Equivalent to two SPDT switches or relays actuated by a single
coil. Such a relay has eight terminals, including the coil.


Relays are used for:

Amplifying a digital signal, switching a large amount of power with a small
operating power. Some special cases are:
o A telegraph relay, repeating a weak signal received at the end of a
long wire
o Controlling a high-voltage circuit with a low-voltage signal, as in
some types of modems or audio amplifiers,
o Controlling a high-current circuit with a low-current signal, as in the
starter solenoid of an automobile.
Detecting and isolating faults on transmission and distribution lines by
opening and closing circuit breakers (protection relays),Switching to a
standby power supply.

Analog to Digital Convertor:

An analog-to-digital converter (abbreviated ADC, A/D or A to D) is a device
that converts a continuous physical quantity (usually voltage) to a digital number
that represents the quantity's amplitude.
The conversion involves quantization of the input, so it necessarily
introduces a small amount of error. Instead of doing a single conversion, an ADC
often performs the conversions ("samples" the input) periodically. The result is a
sequence of digital values that have converted a continuous-time and continuousamplitude analog signal to a discrete-time and discrete-amplitude digital signal.
An ADC is defined by its bandwidth (the range of frequencies it can
measure) and its signal to noise ratio (how accurately it can measure a signal

relative to the noise it introduces). The actual bandwidth of an ADC is

characterized primarily by its sampling rate, and to a lesser extent by how it
handles errors such as aliasing. The dynamic range of an ADC is influenced by
many factors, including the resolution (the number of output levels it can quantize
a signal to), linearity and accuracy (how well the quantization levels match the true
analog signal) and jitter (small timing errors that introduce additional noise).
The dynamic range of an ADC is often summarized in terms of its effective
number of bits (ENOB), the number of bits of each measure it returns that are on
average not noise. An ideal ADC has an ENOB equal to its resolution. ADCs are
chosen to match the bandwidth and required signal to noise ratio of the signal to be
quantized. If an ADC operates at a sampling rate greater than twice the bandwidth
of the signal, then perfect reconstruction is possible given an ideal ADC and
neglecting quantization error. The presence of quantization error limits the
dynamic range of even an ideal ADC, however, if the dynamic range of the ADC
exceeds that of the input signal, its effects may be neglected resulting in an
essentially perfect digital representation of the input signal.
An ADC may also provide an isolated measurement such as an electronic
device that converts an input analog voltage or current to a digital number
proportional to the magnitude of the voltage or current. However, some nonelectronic or only partially electronic devices, such as rotary encoders, can also be
considered ADCs. The digital output may use different coding schemes. Typically
the digital output will be a two's complement binary number that is proportional to
the input, but there are other possibilities. An encoder, for example, might output a
Gray code.

Electrical Symbol:

Commercial analog-to-digital converters

Most converters sample with 6 to 24 bits of resolution, and produce fewer
than 1 megasample per second. Thermal noise generated by passive components
such as resistors masks the measurement when higher resolution is desired. For
audio applications and in room temperatures, such noise is usually a little less than
1 V (microvolt) of white noise.

If the MSB corresponds to a standard 2 V of output signal, this translates to

a noise-limited performance that is less than 20~21 bits, and obviates the need for
any dithering. As of February 2002, Mega- and giga-sample per second converters
are available. Mega-sample converters are required in digital video cameras, video
capture cards, and TV tuner cards to convert full-speed analog video to digital
video files.
Commercial converters usually have 0.5 to 1.5 LSB error in their output.
In many cases, the most expensive part of an integrated circuit is the pins,
because they make the package larger, and each pin has to be connected to the
integrated circuit's silicon. To save pins, it is common for slow ADCs to send their
data one bit at a time over a serial interface to the computer, with the next bit
coming out when a clock signal changes state, say from 0 to 5 V. This saves quite a
few pins on the ADC package, and in many cases, does not make the overall design
any more complex (even microprocessors which use memory-mapped I/O only
need a few bits of a port to implement a serial bus to an ADC).
Commercial ADCs often have several inputs that feed the same converter,
usually through an analog multiplexer. Different models of ADC may include
sample and hold circuits, instrumentation amplifiers or differential inputs, where
the quantity measured is the difference between two voltages.

1. Music recording:
Analog-to-digital converters are integral to current music reproduction technology.
People produce much music on computers using an analog recording and therefore

need analog-to-digital converters to create the pulse-code modulation (PCM) data

streams that go onto compact discs and digital music files.
The current crop of analog-to-digital converters utilized in music can sample
at rates up to 192 kilohertz. Considerable literature exists on these matters, but
commercial considerations often play a significant role. Most [citation



profile recording studios record in 24-bit/192-176.4 kHz pulse-code modulation

(PCM) or in Direct Stream Digital (DSD) formats, and then down sample or
decimate the signal for Red-Book CD production (44.1 kHz) or to 48 kHz for
commonly used for radio and television broadcast applications.
2. Digital signal processing:
People must use ADCs to process, store, or transport virtually any analog signal in
digital form. TV tuner cards, for example, use fast video analog-to-digital
converters. Slow on-chip 8, 10, 12, or 16 bit analog-to-digital converters are
common in microcontrollers. Digital storage oscilloscopes need very fast analogto-digital converters, also crucial for software defined radio and their new
3. Scientific instruments:
Digital imaging systems commonly use analog-to-digital converters in
digitizing pixels. Some radar systems commonly use analog-to-digital converters
to convert signal strength to digital values for subsequent signal processing. Many
other in situ and remote sensing systems commonly use analogous technology
The number of binary bits in the resulting digitized numeric values reflects
the resolution, the number of unique discrete levels of quantization (signal
processing). The correspondence between the analog signal and the digital signal

depends on the quantization error. The quantization process must occur at an

adequate speed, a constraint that may limit the resolution of the digital signal.
Many sensors produce an analog signal; temperature, pressure, pH, light
intensity etc. All these signals can be amplified and fed to an ADC to produce a
digital number proportional to the input signal.
Future Electronics has a wide range of UART and USART devices,
including single UARTs, DUARTs, quad UARTs and octal UARTs from several
manufacturers. Simply choose from the UART technical attributes below and your
search results will quickly be narrowed to match your specific universal
asynchronous receiver and transmitter needs.
We deal








Semiconductor, Microchip, NXP and Silicon Labs. You can easily refine your
UART product search results by clicking your preferred UART brand from the list
of manufacturers below.
Applications for UARTs:
Universal Asynchronous Receiver / Transmitters are commonly included in
microcontrollers and are designed to be used for several applications. UARTs are
used for devices including GPS units, modems, wireless communication and
Bluetooth modules, amongst many other applications.
The MAX232 is an IC, first created in 1987 by Maxim Integrated Products,
that converts signals from an RS-232 serial port to signals suitable for use

in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver and
typically converts the RX, TX, CTS and RTS signals.
The drivers provide RS-232 voltage level outputs (approx. 7.5 V) from a
single + 5 V supply via on-chip charge pumps and external capacitors. This makes
it useful for implementing RS-232 in devices that otherwise do not need any
voltages outside the 0 V to + 5 V range, as power supplydesign does not need to be
made more complicated just for driving the RS-232 in this case.
The receivers reduce RS-232 inputs (which may be as high as 25 V), to
standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a
typical hysteresis of 0.5 V.
The MAX232(A) has two receivers (converts from RS-232 to TTL voltage
levels), and two drivers (converts from TTL logic to RS-232 voltage levels). This
means only two of the RS-232 signals can be converted in each direction.
Typically, a pair of a driver/receiver of the MAX232 is used for TX and RX
signals, and the second one for CTS and RTS signals.

There are not enough drivers/receivers in the MAX232 to also connect the
DTR, DSR, and DCD signals. Usually these signals can be omitted when e.g.
communicating with a PC's serial interface. If the DTE really requires these
signals, either a second MAX232 is needed, or some other IC from the MAX232
family can be used. Also, it is possible to directly wire DTR (DB9 pin #4) to DSR

(DB9 pin #6) without going through any circuitry. This gives automatic (brain
dead) DSR acknowledgment of an incoming DTR signal.

LCD (liquid crystal display):

LCD stands for liquid crystal display. They come in many sizes 8x1 , 8x2 ,
10x2 , 16x1 , 16x2 , 16x4 , 20x2 , 20x4 ,24x2 , 30x2 , 32x2 , 40x2 etc. Many
multinational companies like Philips Hitachi Panasonic make their own special
kind of LCDs to be used in their products. All the LCDs performs the same
functions (display

characters numbers special

characters ASCII characters

etc).Their programming is also same and they all have same 14 pins (0-13) or 16
pins (0 to 15). Eight (8) of them all are data pins that takes data from the external
unit and display it on the screen. One vcc takes 5 volts to turn on the LCD and
GND a ground and one is contrast (we use it to set the contract colour of
the alphabets (with respect to LCD) that appears on the LCD).
LCD (Liquid Crystal Display) screen is an electronic display module and
find a wide range of applications. A 16x2 LCD display is very basic module and is
very commonly used in various devices and circuits. These modules are preferred
over seven segments and other multi segment LEDs.

A 16x2 LCD means it can display 16 characters per line and there are 2 such
lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command and Data.
The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The data
register stores the data to be displayed on the LCD. The data is the ASCII value of
the character to be displayed on the LCD. Click to learn more about internal
structure of a LCD.


Circuit diagram:

The renaming three are very important pins RS (register set), RW(read write), and
RS(register set):


Is used to distinguish between commands and data. When it is 1 it means

that some

data is coming to LCD (by data

i mean



or ASCII characters) and when it is 0 it means that some command is approaching

to LCD from external unit (usually a micro controller) by commands i mean that a
instruction for LCD is coming for example move cursor one step back or forward






This pin most often remains 0 because when it is 0 it means we
are writing to LCD module writing anything data or command. When it is 1 it






This enable signal is very important. When it is 1 it provides an extra beem
to LCD to display the character that the data pins are caring. After displaying the
character it then comes back to normal state 0. Two extra pins on some LCD are
for background display one pin represents background display apply 5 volts
to turn on background display or 0 volts to turn off background display.

The data which we send to our LCD can be any alphabet (small or big), digit
or ASCII character.
We cannot send an integer,float,long,double type data to LCD because LCD
is designed to display a character only. The 8 data pins on LCD carries only
ASCII 8-bit code of the character to LCD. However we can convert our data
in character type array and send one by one our data to LCD. Data can be sent
using 8-bit 0r 4-bit mode. If 4-bit mode is used, two nibbles of data (First high four
bits and then low four bits with an E Clock pulse with each nibble) are sent to
complete a full eight-bit transfer.8-bit mode is best used when speed is required in
an application and at least ten I/O pins are available. 4-bit mode requires a
minimum of six bits. In 4-bit mode, only the top 4 data bits (DB4-7) are used.

LCD Commands:
The command 0x30 means we are setting 8-bit mode LCD having 1 line and
we are initializing it to be 5x7 character display. Now this 5x7 is something which
everyone should know what it stands for. Usually the characters are displayed on
LCD in 5x8 matrices form. Where 5 is total number of coulombs and is number of
rows. Thus the above 0x30 command initializes the LCD to display character in
5 coulombs and 7 rows the last row we usually leave for our cursor to move or
blink etc.

The command 0x38 means we are setting 8-bit mode LCD having two
lines and character shape between 5x7 matrixes.
The command 0x20 means we are setting 4-bit mode LCD having 1 line
and character shape between 5x7 matrixes.

The command 0x28 means we are setting 4-bit mode LCD having 2 lines
and character shape
between 5x7 matrixes.
The command 0x06 is entry mode it tells the LCD that we are going to
use you.
The command 0x08 display cursor off and display off but without
clearing DDRAM contents.
The command 0x0E displays cursor on and dispaly on.
The command 0x0c display on cursor off(displays cursor off but the text
will appear on LCD)
The command 0x0F dispaly on cursor blink (text will appear on screen
and cursor will blink).
The command 0x18 shift entire dispaly left (shift whole off the text on
the particular line to its left).
The command 0x1C shift entire dispaly right (shift whole off the text on
the particular line to its right).
The command 0x10 Moves cursor one step left or move cursor on step
ahead to left whenever new character is displayed on the screen.
The command 0x14 Moves cursor one step right or move cursor on step
ahead to right whenever new character is displayed on the screen.
The command 0x01 clear all the contents of the DDRAM and also clear
the LCD removes all the text from the screen.
The command 0x80 initialize the cursor to the first position means first
line first matrix (start point) now if we add 1 in 0x80+1=0x81 the cursor
moves to second matrix for example 16x1 LCD displays 16 characters
only the first will appear on 0x80 second 0x81 third 0x82 and so on until
last the 16 once on address 0xFF.

Arduino is a cross-platform IDE that works in conjunction with an Arduino

controller in order to write, compile and upload code to the board.The software
provides support for a wide array of Arduino boards, including Arduino Uno,
Nano, Mega, Esplora, Ethernet, Fio, Pro or Pro Mini, as well as LilyPad Arduino.
The universal languages for Arduino are C and C++, thus the software is fit for
professionals who are familiar with these two. Features such as syntax
highlighting, automatic indentation and brace matching makes it a modern
alternative to other IDEs.Wrapped inside a streamlined interface, the software
features both the looks and the functionality that appeal to Arduino developers,
paving the way to a successful output via the debugging modules.
All of its features are hosted inside a few buttons and menus that are easy to
navigate and understand, especially for professional programmers. Also, the builtin collection of examples might be of great help for Arduino first timers.Provided
that youve connected the Arduino board to the computer and installed all the
necessary drivers, one of the first steps we see fit is to choose the model youll be
working with using the Tools menu of the application.
Then, you can start writing the programs using the comfortable environment
that Arduino offers. The program includes a rich array of built-in libraries such as
EEPROM, Firmata, GSM, Servo, TFT, WiFI, etc, but adding your own is also
possible. Designs can be verified and compiled, with an error log displayed in the
lower part of the UI that allows you to review the code.
If the debugging process returns no errors, you can start the upload process
and have your program delivered to the board so you can proceed with further

testing.All in all, Arduino comes across as an extremely useful asset, providing the
essentials that Arduino developers need in order to streamline the testing process.
Arduino is an open-source computer hardware and software company,
project and user community that designs and manufacturesmicrocontroller-based
kits for building digital devices and interactive objects that can sense and control
objects in the physical world. The project is based on microcontroller board
designs, manufactured by several vendors, using various microcontrollers. These
systems provide sets of digital and analog I/O pins that can be interfaced to various
expansion boards ("shields") and other circuits.
The boards feature serial communications interfaces, including USB on
some models, for loading programs from personal computers. For programming
the microcontrollers, the Arduino project provides an integrated development
environment (IDE) based on the Processing project, which includes support for
the C and C++ programming languages.
The first Arduino was introduced in 2005, aiming to provide an inexpensive
and easy way for novices and professionals to create devices that interact with their
environment using sensors and actuators. Common examples of such devices
intended for beginner hobbyists include simple robots, thermostats, and motion
detectors. Arduino boards are available commercially in preassembled form, or
as do-it-yourself kits. The hardware design specifications are openly available,
allowing the Arduino boards to be manufactured by anyone.

Arduino programs may be written in any programming language with a

compiler that produces binary machine code. Atmel provides a development

environment for their microcontrollers, AVR Studio and the newer Atmel Studio.
The Arduino project provides the Arduino integrated development
environment (IDE), which is a cross-platform application written inJava. It
originated from the IDE for the Processing programming language project and
the Wiring project. It is designed to introduce programming to artists and other
newcomers unfamiliar with software development. It includes a code editor with
features such assyntax highlighting, brace matching, and automatic indentation,
and provides simple one-click mechanism for compiling and loading programs to
an Arduino board. A program written with the IDE for Arduino is called a "sketch".
The Arduino IDE supports the C and C++ programming languages using
special rules of code organization. The Arduino IDE supplies a software
library called "Wiring" from the Wiring project, which provides many common
input and output procedures. A typical Arduino C/C++ sketch consists of two
functions that are compiled and linked with a program stub main () into an
executable cyclic program:

setup(): a function that runs once at the start of a program and that can
initialize settings.

loop(): a function called repeatedly until the board powers off.

After compilation and linking with the GNU tool chain, also included with

the IDE distribution, the Arduino IDE employs the programavrdude to convert the
executable code into a text file in hexadecimal coding that is loaded into the
Arduino board by a loader program in the board's firmware


A number of things have to happen for your Arduino code to get onto the
Arduino board.


the Arduino





transformations to make sure that the code is correct C or C++ (two common
programming languages). It then gets passed to a compiler (avr-gcc), which turns
the human readable code into machine readable instructions (or object files). Then,
your code gets combined with (linked against), the standard Arduino libraries that
provide basic functions like digitalWrite() or Serial.print().
The result is a single Intel hex file, which contains the specific bytes that
need to be written to the program memory of the chip on the Arduino board. This
file is then uploaded to the board: transmitted over the USB or serial connection
via the bootloader already on the chip or with external programming hardware.
Multi-file sketches
A sketch can contain multiple files (tabs). To manage them, click on the
right-facing arrow just above the scroll bar near the top of the environment. Tabs
have one of four extensions: no extension, .c, .cpp, or .h (if you provide any other
extension, the period will be converted to an underscore). When your sketch is
compiled, all tabs with no extension are concatenated together to form the "main
sketch file". Tabs with .c or .cpp extensions are compiled separately. To use tabs
with a .h extension, you need to #include it (using "double quotes" not <angle

The Arduino environment performs a few transformations to your main

sketch file (the concatenation of all the tabs in the sketch without extensions)
before passing it to the avr-gcc compiler.First, #include "Arduino.h", or for
versions less than 1.0, #include "WProgram.h" is added to the top of your sketch.
This header file (found in <ARDUINO>/hardware/cores/<CORE>/) includes all
the defintions needed for the standard Arduino core.
Next, the environment searches for function definitions within your main
sketch file and creates declarations (prototypes) for them. These are inserted after
any comments or pre-processor statements (#includes or #defines), but before any
other statements (including type declarations). This means that if you want to use a
custom type as a function argument, you should declare it within a separate header
file. Also, this generation isn't perfect: it won't create prototypes for functions that
have default argument values, or which are declared within a namespace or class.
The Arduino environment supports multiple target boards with different
chips (currently, only AVRs), CPU speeds, or bootloaders. These are defined in a
board preferences file. Relevant variables include:
<BOARD>.name: the name to display in the Boards menu
<BOARD>.build.mcu: the microcontroller on the board (normally "atmega8" or
<BOARD>.f_cpu: the clock speed at which the microcontroller operates (normally
"16000000L", or, for an ATmega168running on its internal clock, "8000000L").

<BOARD>.core: which sub-directory of the hardware/cores/ directory to link

sketches against (normally "arduino").
Also useful is this setting in the main preferences.txt file:
build.verbose: whether or not to print debugging messages while building a sketch
(e.g. "false"). If true, will print the complete command line of each external
command executed as part of the build process.
Note: that in Arduino 0004 and later, build.extension is unused - the main sketch
file is always treated as a .cpp file.
Build process
Sketches are compiled by avr-gcc.
The include path includes the sketch's directory, the target directory






(<ARDUINO>/hardware/tools/avr/avr/include/), as well as any library directories

(in <ARDUINO>/hardware/libraries/) which contain a header file which is
included by the main sketch file.
When you verify a sketch, it is built in a temporary directory in the system temp
directory (e.g. /tmp on the Mac). When you upload it, it is built in the applet/
subdirectory of the sketch's directory (which you can access with the "Show Sketch
Folder" item in the "Sketch" menu).

The .c and .cpp files of the target are compiled and output with .o extensions
to this directory, as is the main sketch file and any other .c or .cpp files in the
sketch and any .c or .cpp files in any libraries which are #included in the sketch.
These .o files are then linked together into a static library and the main sketch file
is linked against this library. Only the parts of the library needed for your sketch
are included in the final .hex file, reducing the size of most sketches.
The .hex file is the final output of the compilation which is then uploaded to
the board. During a "Verify" the .hex file is written to /tmp (on Mac and Linux)
or \Documents and Settings\<USER>\Local Settings\Temp (on Windows). During
upload, it's written to the applet sub-directory of the sketch directory (which you
can open with the "Show Sketch Folder" item in the Sketch menu).
Upload process
Sketches are uploaded by avrdude. The upload process is also controlled by
variables in the boards and main preferences files. Those in the boards file include:
<BOARD>.upload. Protocol: the protocol that avrdude should use to talk to the
board (typically "stk500").
<BOARD>.upload. Speed: the speed (baud rate) avrdude should use when
uploading sketches (typically "19200").
<BOARD>.upload.maximum_size: the maximum size for a sketch on the board
(dependent on the chip and the size of the boot loader).

This paper defines electricity theft in social, economical, regional, political,
infrastructural, literacy, criminal and corruption points of view. This paper
illustrates various cases, issues and setbacks in the design, development,
deployment, operation, and maintenance of electricity theft controlling devices. In
addition, various factors that influence people to steal electricity are discussed.
This paper illustrates the effect of NTL on quality of supply, burden on the
generating station and tariff imposed on genuine customer.
The progress in technology about electrical distribution network is a nonstop process. New things and new technology are being invented. The proposed
system found to be little bit complex as far as distribution network is concerned,
but its an automated system of theft detection. It saves time as well as help to
maximize profit margin for utility company working in electrical distribution
network. Utility company can keep a constant eye on its costumer.
The project model reduces the manual manipulation work and theft .Use of
GSM in our system provides the numerous advantages of wireless network
systems. The government saves money by the control of theft in energy meter and
also more beneficial for customer side and the government side. The metering IC
ensures the accurate and reliable measurement of power consumed. Cost wise low
when compared to other energy meter without automatic meter reading and theft
control. The project better suits for displaying information in long distances, and
the information can be send, alter any time according to user requirement.

[1] Muhammad Ali Mazidi and Janice Gillespe, The 8051 Microcontroller and
Embedded Systems, I/O Programming, Printice Hall
[2] Kenneth J. Ayala, The 8051 Microcontroller: Architecture, Programming, and
Applications, 8051 Architecture, Penram International Publications, 1997
[3] Rangan C S, Sharma G R, Mani V S V, Instrumentation Devices and Systems,
Instrumentation Amplifiers and Signal Conditioning, Tata-McGraw-Hill Ltd