SlideShare a Scribd company logo
1 of 92
Download to read offline
P a g e 1 | 92
ABSTRACT
Home security system is needed for convenience and safety. This system invented to keep home
safe from intruder. In this work, we present the design and implementation of a GSM & PIR sensor
based home security system using ARDUINO-UNO board. Which take a very less power. The
system is a arduino-uno based home security system which contains a GSM modem and PIR sensor
with servo-motor and a camera which provides a better security. The system can response rapidly
as intruder enters into the trigged zone, PIR sensor sense the object and GSM module will send a
notification as a SMS to the registered number of the home owner, and can also give a snapshot of
that object. This security system for alerting a house owner wherever he will. In this system as a
object enters into the zone GSM module produce a signal through a public telecom network and
sends a message or redirect a call that that tells about your home update or predefined message
which is embedded in arduino-uno board. Suspected activities are conveyed to remote user through
SMS or Call using GSM technology.
KEYWORDS: GSM (Global System for Mobile Communications), ARDUINO-UNO, PIR, SMS.
P a g e 2 | 92
INDEX
Page No.
CHAPTER (1) INTRODUCTION OF PROJECT…………….…...(8)
1.1Aim of project……………………………………………………………….....(8)
1.2 Outlines of project…………………………………………………….………(8)
1.3 Methodology……………………………………………………………...…..(9)
CHAPTER (2) LITRETURE REVIEW………….…………….....(11)
2.1 Embedded system…………………………………………………………...(11)
2.1.1 Introduction…………………………………………………………………....…(11)
2.1.2 Major building blocks of embedded system………………………………………(13)
2.1.3 Example of embedded system…………………………………………………….(14)
2.1.4 Characteristics of embedded system……………………………………………...(15)
2.1.5 Comparison…………………………………………………………………….…(16)
2.1.6 Embedded system hardware ……………………………………………………...(16)
2.1.7 Typical architecture ………………………………………………………….......(18)
2.1.8 Element of embedded system design……………………………………....……..(19)
2.2 Arduino……………………………………………………………..........…(20)
2.2.1 Introduction………………………………………………………………........…(20)
2.2.2 Who created Arduino……………………………………………………………..(21)
2.2.3 Why Arduino…………………………………………………………………......(22)
2.2.4 Working in Arduino………………………………………………………………(23)
CHAPTER (3) ARDUINO-UNO……………………………..........(27)
3.1 Overview……………………………………………………………..….….(27)
3.2 Pin diagram……………………………………………………………....…(28)
3.3 ATMega328……………………………………………………………...…(29)
3.3.1 Introduction………………………………………………………………...…...(29)
3.3.2 Features……………………………………………………………………....….(29)
3.3.3 Pin description…………………………………………………………………..(30)
P a g e 3 | 92
3.3.4 Comparison among ATmega48PA, ATmega88PA, ATmega168PA and
ATmega328P…………………………………………………………………………...(33)
3.3.5 Internal Description……………………………………………………….…..….(33)
3.3.6 Communication…………………………………………………………….........(35)
3.3.7 Processor architecture…………………………………………………….….…...(36)
3.3.8 Pin description………………………………………………….……...................(40)
3.3.9 Things to remember about ATMEGA328 controllers…………………....………(40)
CHAPTER (4) ARDUINO SOFTWARE……………………………...(41)
4.1 Arduino IDE……………………………………………………………..…..(41)
4.1.1 What is IDE? …………………………………………………….….....................(42)
4.2 Serial Communication…………………………………………………….....(42)
CHAPTER (5) GSM TECHNOLOGY AND MODEM……...........(44)
5.1 Introduction………………………………………………………………….(44)
5.2 Cellular mobile system………………………………………....................…(45)
5.3 GSM technology……………………………………………………………..(46)
5.4 System architecture………………………………………………….………(48)
5.4.1 Mobile Station…………………………………………………………………....(48)
5.4.2 Base Station Subsystem……………………………………………………….….(48)
5.4.3 Base Transceiver Station…………………………………………….....................(48)
5.4.4 Base Station Controller…………………………………………………………...(48)
5.4.5 Trans-coder and Rate Adaptation Unit……………………………….…………...(49)
5.5 Network and switching sub system…………………………………….…….(49)
5.5.1 Mobile Service Switching Center………………………………………………...(50)
5.5.2 Inter Working Function, (IWF) …………………………………………………..(50)
5.5.3 Home Location Register, (HLR) …………………………………………………(50)
5.5.4 Visitor Location Register, (VLR) ……………………………………...................(50)
5.5.5 Gateway MSC (GMSC) …………………………………………...……………..(50)
5.5.6 Signaling Transfer Point………………………………………….........................(50)
5.6 More points…………………………………………………………………..(50)
5.6.1 Operating subsystem……………………………………………………………...(50)
P a g e 4 | 92
5.6.2 Layer modeling…………………………………………………...……………...(51)
5.6.3 Radio link aspects……………………………………………...…………………(51)
5.6.4 Multiple access and channel structure……………………………….…………...(51)
5.6.5 Traffic channels………………………………………………. …………………(51)
5.6.6 Cell selection……………………………………………………………………..(51)
CHAPTER (6) SERVO MOTOR………………………………….(53)
6.1 Introduction………………………………………………………………….(53)
6.2 Commercial application……………………………………………………..(54)
6.3 Types…………………………………………………………………...........(54)
6.4 Principle of operation………………………………………………………..(54)
6.5 Application…………………………………………………………………..(56)
CHAPTER (7) PIR SENSOR………………………………………(57)
7.1 Introduction…………………………………………………………….……(57)
7.2 How it works………………………………………………. ……………….(58)
7.3 Technical data……………………………………………………. …….......(58)
7.4 Application……………………………………………………. ……………(59)
CHAPTER (8) COMPONENTS…………………………………(60)
8.1 Capacitor…………………………………………………………………….(60)
8.1.1 Introduction………………………………………………………………………(60)
8.1.2 Actual Capacitance………………………………………………..……………...(60)
8.1.3 Breakdown voltage………………………………………………..……………...(61)
8.1.4 Types of Capacitors……………………………………………….……………...(61)
8.1.5 Variable Capacitors……………………………………………….……………...(62)
8.1.6 Methods of Making Capacitors…………………………………………………..(62)
8.2 LCD……………………………………………………………………….…(62)
8.2.1 Introduction………………………………………………………………………(62)
8.2.2 Pin description……………………………………………………………………(63)
8.2.3 Sequence of writing to the LCD………………………………………………….(63)
8.2.4 LCD interface diagram…………………………………………….……………..(64)
P a g e 5 | 92
8.3 LED………………………………………………….………………………(65)
8.3.1 Introduction………………………………………………………………………(65)
8.3.2 Applications……………………………………………………...........................(66)
8.3.3 LED specifications……………………………………………..………………...(66)
CHAPTER (9) ACCESSORIES…………………………………...(68)
9.1 Adapters………………………………………………………………..……(68)
9.2 Dip Bases……………………………………………………………………(68)
9.3 Power Jack…………………………………………………………..………(68)
9.4 Switches……………………………………………………………..………(68)
9.5 Connectors……………………………………………………………..……(70)
9.6 Berge Strip…………………………………………………………..………(70)
9.7 DC connectors…………………………………………………….…………(70)
CHAPTER (10) SOURCE CODE…………………………………(71)
CHAPTER (11) RESULTS AND DISCUSSIONS………...……...(89)
11.1 Results and Conclusions…………………………………………...………(89)
11.2 Uses and further scope………………………………………………..……(90)
CHAPTER (12) REFERENCES…………………………...………(92)
P a g e 6 | 92
LIST OF FIGURES
Figure No. Description Page No.
2.1.1 Components of embedded system 12
2.1.3 Examples of embedded system 14
2.1.6(a) Embedded system hardware (in loop) 16
2.1.6(b) Circuit diagram of embedded system hardware 17
2.1.7 Typical architecture of embedded system 18
3.2 Pin diagram OF Arduino UNO 28
3.3.3(a) Pin description of ATmega 328 31
3.3.3(b) Pin diagram of ATmega328 32
3.3.7(a) Process architecture of microcontroller 37
3.3.7(b) Variation of input and output voltage of microcontroller 39
3.3.8 Pin diagram of ATmega 328 40
5.4.4(a) Block diagram of BSC 49
5.4.4(b) Block diagram of GSM technology 49
6.1 Block diagram of servo motor 53
6.4(a) Principle of operation of servo motor 55
6.4(b) Principle of operation sending of high pulse at every 20 ms 55
7.1(a) PIR sensor 57
7.1(b) Pcb of PIR sensor 57
7.2 Working of PIR sensor 58
8.2.4 LCD interfacing diagram 65
8.3.1(a) Schematics diagram of LED 66
8.3.1(b) LED 66
11.1 GOOGLE trends comparing ARDUINO with its biggest
competitors
89
P a g e 7 | 92
LIST OF IMAGES
Image No. Description Page No.
2.2.1 Picture of Arduino board 20
2.2.3(a) Working step1 23
2.2.3(b) Working step2 24
2.2.3(c) Showing the basic syntax of the programm 46
4.2 Transmission and reception of Arduino board 43
6.1 Block diagram of BSC 53
8.1.4(a) Picture of polarize capacitors 61
8.1.4(b) Picture of un-polarize capacitors 62
8.1.5 Picture of variable capacitors 62
8.3.1 Picture of LED 65
8.3.3 Identification of LED terminals 67
LIST OF TABLE
Table No. Description Page No.
2.1.5 Comparison between embedded system and general purpose
computing
16
3.3.4 Memory summary of different ATmega microcontroller 33
3.3.6 Arduino specification 36
5.2 Cellular mobile system 45
8.2.2 Pin description of 16x2 LCD display 63
8.3.3 Specification of LED 66
P a g e 8 | 92
CHAPTER (1) INTRODUCTION OF PROJECT
1.1 Aim of Project
From last few year home security is an essential requirement of households to keep home safe
from intruders to get rob. So the researchers and companies tries to implement an algorithms and
make some gradates that keep your home safe from intruders. This leads to advance technology
that make your home intelligent or modern this called as home automation & security system also.
With this technology house owner can control other appliances as well like lighting system,
dimming, electrical appliances and many more.
Now a day's wireless technology is used to control home appliances instead of wired
topological connection. GSM (Global System for Mobile Communication) technology makes used
to communicate input signal from appliances to output message on device. That means after
detection of any intrusion GSM Modem sends the appropriate message to house owner's phone.
The signals or data which is comes from sensors or other equipment digitize it by GSM module
and send it to receiver. So that better security is provided by the user.
Home automation or home security system offers many benefits. After so many research I
gave a mainly focused on GSM based home security. It is very easy to install and having a very
less cost. Basically it installed over the entry that front door where a matrix keypad and 16x2 LCD
display is installed which is connected to the arduino-uno board and the coding is done in such
manner so that “ENTER PASSWORD” is display on the LCD screen we enters the password to
activate the system, once the system is activated the PIR sensor sense the objects and the camera
which is mounted on the servo-motor, moves to the location of the object, signals will generate via
PIR sensor and sends it to ATMEGA 328microcontroller of the arduino-uno board and action takes
place according to piece of code written in the chip and GSM module sends the message to owner's
phone.
There has been much research done on various type of home security systems like Sensor
based Home security System, Figure print, Palm print and keypad activation for authentication and
so much. All type of Security system uses only a technique of GSM module. In this project the
work mainly focuses on the security of home when the user is out from the place. GSM based
technology proposed to keep updated owner about house security. In this security system is SMS
based and uses GSM technology to send SMS to the owner. Normally the aim of this type of
system is to keep secure home from intruders.
To increase the performances of a smart automated house, lots of research is going on. For
an example; The Aware Home Research Initiative (AHRI) at Georgia Institute of Technology
is an interdisciplinary research endeavor aimed at addressing the fundamental technical, design,
and social challenges for people in a home setting.
1.2 Outlines of Report
P a g e 9 | 92
This report contains a detailed information about all the components used in this project. The
components used are:
Arduino-uno
PIR sensor
GSM module
Servo-motor
LCD
LED
Keypad interfacing
A detailed report about each and every component is described in separate chapter.
Chapter 2 contains information about Embedded System & Arduino board.
Chapter 3 contains information about Arduino-uno.
Chapter 4 contains information about Arduino software.
Chapter 5 contains information about GSM technology and MODEM
Chapter 6 contains information about Servo motor
Chapter 7 contains information about PIR sensor
Chapter 8 contains information about all the components
Chapter 9 contains information about Accessories used in the project
Chapter 10 contains Source code
Chapter 11 contains Result and descriptions
Chapter 12 contains Reference
1.3 Methodologies
The idea of this project is to give information about the perpetrator to the victim of stolen car,
confidential data from any organization, presence of unauthorized person in the home etc. So we
have chosen GSM technology to give the information by sending SMS.
P a g e 10 | 92
Sending SMS alone can’t help to the victim, if we send and an SMS with the snapshot of
the perpetrator or able to take a video of that incident. So we include a camera which is mounted
on the servo-motor which provides motion covered to the trigged zone when the incident has
occurred.
To run the CAMERA/WEBCAM and GSM module we use Arduino UNO board which
has ATmega328 microcontroller. The Arduino is a very user friendly device which can be easily
interfaced with any sensors or modules and is very compact in size.
Also we can make RFID card detector using Arduino-uno using which one can make detect
his own RFID card if available like if one wants to check balance in metro card, attendance record
in office, and many more.
Finally we can sense the room temperature and distance of any object. One can also glow
LED’s in some beautiful dancing patterns and display them on LCD.
P a g e 11 | 92
CHAPTER (2) LITERATURE REVIEW
A literature review is collection of a critical, unbiased, and comprehensive evaluation of published
information in a chosen and specific area of study of interest. It gives a general understanding of
findings of the research work, conclusions, and recommendations and thereby brings out their
strengths and weaknesses. This helps in identifying gaps, scope for further work and generalized
concepts in the existing body of knowledge.
2.1 Embedded System
2.1.1 Introduction
Embedded system are components integrating software and hardware jointly and specifically
designed to provide given functionalities. A combination of computer hardware and software, and
perhaps additional mechanical or other parts, designed to perform a dedicated function. In some
cases, embedded system are part of a larger system or product, as in the cases of an antilock braking
system in a car. Such equipment is electrical or battery powered. The chip controls one or more
functions of the equipment, such as remembering how long it has-been since the device last
received maintenance.
An Embedded System is a special-purpose computer system designed to
perform one or a few dedicated functions, often with real- time computing constraints. “An
embedded system is an application that contains at least one programmable computer (typically in
the form of a microcontroller, a microprocessor or digital signal processor chip) and which is used
by individuals who are, in the main, unaware that the system is computer-based.” Embedded
systems are designed to do some specific task, rather than be a general-purpose computer for
multiple tasks. Some also have real time performance constraints that must be met, for reason such
as safety and usability; others may have low or no performance requirements, allowing the system
hardware to be simplified to reduce costs. An embedded system is not always a separate block -
very often it is physically built-in to the device it is controlling. The software written for embedded
systems is often called firmware, and is stored in read-only memory or flash convector chips rather
than a disk drive. It often runs with limited computer hardware resources: small or no keyboard,
screen, and little memory.
An embedded system is some combination of hardware and software, either fixed in capability or
programmable, that is specifically designed for a particular function. Industrial machines,
automobiles, medical equipment, cameras, household appliances, airplanes, vending machines and
toys (as well as the more obvious cellular phone and PDA) are among the myriad possible hosts
of an embedded system.
In embedded systems, software commonly known as firmware is hidden
inside the same hardware rather than in some other hardware. Basically embedded systems are
P a g e 12 | 92
task specific devices. One of its most important characteristic is gives the output within the time
constraints or you can say they are time bound systems.
Figure no-2.1.1Components of embedded system
These embedded systems help to make the work more convenient and accurate. So, we
often use these embedded systems in simple and complicated devices too. We use these embedded
systems in our real life for many devices and applications such as Calculators, microwave,
television remote control, home security and neighborhood traffic control systems, etc.
Modern embedded systems are often based on microcontrollers (i.e. CPUs with integrated
memory or peripheral interfaces) but ordinary microprocessors (using external chips for memory
and peripheral interface circuits) are also still common, especially in more complex systems. In
either case, the processor(s) used may be types ranging from general purpose to those specialized
in certain class of computations or even custom designed for the application at hand.
A common standard class of dedicated processors is the digital signal processor (DSP).
Since the embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.
P a g e 13 | 92
Embedded systems range from portable devices such as digital watches and MP3 players,
to large stationary installations like traffic lights, factory controllers, and largely complex systems
like hybrid vehicles, MRI, and avionics. Complexity varies from low, with a
single microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large or enclosure.
2.1.2 Major building blocks of embedded system
The major building blocks of an embedded system are listed below:
 Microcontrollers / digital signal processors (DSP)
 Integrated chips
 Real time operating system (RTOS) - including board support package and device drivers
 Industry-specific protocols and interfaces
 Printed circuit board assembly
Usually, an embedded system requires mechanical assembly to accommodate all the above
components and create a product or a complete embedded device.
A controller is used to control some process. At one time, controllers were built exclusively from
logic components, and were usually large, heavy boxes. Later on, microprocessors were used and
the entire controller could fit on a small circuit board.
Real time system: A system where correctness depends not only on the correctness of the logical
result of the computation, but also on the result delivery time. It responds in a timely, predictable
way to unpredictable external stimuli arrivals.
The real Time Systems can be further divided into two types:
 Soft Real-Time System: Compute output response as fast as possible, but no specific
deadlines that must be met.
 Hard Real-Time System: Output response must be computed by specified deadline or
system.
P a g e 14 | 92
2.1.3 Example of embedded system
Figure no- 2.1.3 examples of embedded system
P a g e 15 | 92
2.1.4 Characteristics of embedded system
 Must be dependable:
 Reliability (t) = probability of system working correctly provided that is was working at
t=0
 Maintainability (d) = probability of system working correctly d time units after error
occurred.
 Availability: probability of system working at time t
 Safety: no harm to be caused
 Security: confidential and authentic communication
Even perfectly designed systems can fail if the assumptions about the workload and possible errors
turn out to be wrong. Making the system dependable must not be an after-thought, it must be
considered from the very beginning.
1. Must be Efficient
a) Energy efficient.
b) Code-size efficient (especially for systems on a chip)
c) Run-time efficient
d) Weight efficient
2. Dedicated user interface & Dedicated towards a certain application: Knowledge about behavior
at design time can be used to minimize resources and to maximize robustness.
3. Many ES must meet real-time constraints:
a) A real-time system must react to stimuli from the controlled object (or the operator) within
the time interval dictated by the environment.
b) For real-time systems, right answers arriving too late (or even too early) are wrong.
4. Frequently connected to physical environment through sensors and actuators
5. Hybrid systems (analog + digital parts).
6. Typically, ES are reactive systems: A reactive system is one which is in continual interaction
with is environment and executes at a pace determined by that environment“
P a g e 16 | 92
2.1.5 Comparison
Table no-2.1.5 comparison between embedded system and general purpose computing
2.1.6 Embedded system hardware
Figure no- 2.1.6(a) embedded system hardware (in loop)
We learnt that the hardware elements:
a) Processor and
b) Basic circuit elements: power source, clock, reset, timers, memory, glue circuit for the
elements linking and interfaces.
c) Keypad, LCD display matrix or touch screen
Embedded Systems General Purpose Computing
Few applications that are known at design-time. Broad class of applications.
Not programmable by end user Programmable by end user.
Fixed run-time requirement (additional
computing power not useful).
Faster is better.
Criteria:
1. Cost
2. Power consumption
3. Predictability
Criteria:
1. Cost
2. Average speed
P a g e 17 | 92
d) IO communication elements: buses (serial and parallel), interfaces for network interface,
ADC, DAC, pulse dialer, modem, Bluetooth, 802.11, as per the application
e) Interrupt handler
Embedded system hardware basically consists of three main elements:
 Input System: Input system is the basically used to interact with external environment or
type of input the user want to give. There can be various type of the input system depending
upon the user or system need. Some of the examples are sensor interfaces (IR, LDR etc.),
UART interface (for communication with PC), Wireless interfaces for various type of
wireless communication etc. These interfaces have also a good circuit design and should
be properly designed so that it can easily interact with the next unit.
 Processing Unit: The next unit is the processing unit that consist either analog circuit to
process the input or to make the system perform good and user dependant (as per program)
uses the microcontroller interface circuit. The main function of this unit is to take the input,
process it and generate the desired output as per the program (done by user) to control the
output unit.
 Output unit: The output unit consists of the circuit interface to generate and control the
desired output. For example the relay driving unit, motor driver unit, alarm systems,
Display units etc.
Figure no- 2.1.6(b) circuit diagram of embedded system hardware
P a g e 18 | 92
2.1.7 Typical Architecture of embedded system
Figure no-2.1.7 typical architecture of embedded system
P a g e 19 | 92
2.1.8 Element of embedded system design
The design of embedded system includes three things:
1. Hardware: Embedded system hardware basically consists of three main elements:
 Input System: Input system is the basically used to interact with external environment
or type of input the user want to give. There can be various type of the input system
depending upon the user or system need. Some of the examples are sensor interfaces
(IR, LDR etc.), UART interface (for communication with PC), Wireless interfaces for
various type of wireless communication etc. These interfaces have also a good circuit
design and should be properly designed so that it can easily interact with the next unit.
 Processing Unit: The next unit is the processing unit that consist either analog circuit
to process the input or to make the system perform good and user dependent (as per
program) uses the microcontroller interface circuit.
 Output unit: The output unit consists of the circuit interface to generate and control
the desired output. For example the relay driving unit, motor driver unit, alarm systems,
Display units etc.
2. Embedded Software (Compilers): Embedded software is computer software that plays
an integral role in the electronics it is supplied with. Embedded software's principal role is
not information technology (i.e. it is not about information and the technologies related to
providing information services), but rather the interaction with the physical world. It's
written for machines that are not, first and foremost, computers. Manufacturers 'build in'
embedded software in the electronics in cars, telephones, audio equipment, robots,
appliances, toys, security systems, pacemakers, televisions and digital watches, for
example. This software can become very sophisticated in applications such
as airplanes, missiles, and process control systems.
Varying hardware requires different embedded system depending upon the architecture.
Linker Program (software): In computer science, a linker or link editor is a program that
takes one or more objects generated by a compiler and combines them into a
single executable program (hex code). These are inter-linked with the compilers
3. These are the Flash program that is capable of reading from the controllers writing to the
hardware controllers to the HEX code.
P a g e 20 | 92
2.2 Arduino
2.2.1 Introduction
Arduino is a tool for making computers that can sense and control more of the physical world than
your desktop computer. It's an open-source physical computing platform based on a simple
microcontroller board, and a development environment for writing software for the board.
Image no-2.2.1 picture of Arduino board
Arduino can be used to develop interactive objects, taking inputs from a variety of switches or
sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects
can be stand-alone, or they can be communicating with software running on your computer (e.g.
Flash, Processing, MAX-MSP.) The boards can be assembled by hand or purchased preassembled;
the open-source IDE can be downloaded for free.
The Arduino programming language is an implementation of Wiring, a similar physical computing
platform, which is based on the Processing multimedia programming environment. Arduino is a
popular open-source single-board microcontroller, descendant of the open-source Wiring platform
designed to make the process of using electronics in multidisciplinary projects more accessible.
The hardware consists of a simple open hardware design for the Arduino board with an Atmel
AVR processor and on-board input/output support. The software consists of a standard
programming language compiler and the boot loader that runs on the board.
Arduino hardware is programmed using a Wiring-based language (syntax and libraries), similar
to C++ with some slight simplifications and modifications, and a Processing-based integrated
development environment. Arduino is an open-source electronics platform based on easy-to-use
hardware and software. It's intended for anyone making interactive projects. Arduino can take the
P a g e 21 | 92
input from many sensors attached to it & can give the output to many lights, motors etc. There is
no prerequisite knowledge of Advance electronics for operating Arduino. All you should know is
basic electronics and C programming language.
Arduino platform mainly contains a Hardware Board called Arduino Board & software Arduino
IDE to program it. Other external hardware like Sensor Modules, Motors, lights etc. could be
attached with the board.
ARDUINO BOARDS:-
Arduino UNO. Arduino MEGA.
Arduino MINI. Arduino DUE.
Arduino YUN. Arduino Lily pad.
The most common Board used is Arduino UNO. “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.
2.2.2 Who created Arduino?
Author Steve Heath
There are many definitions for this but the best way to define it is to describe it in terms of what it
is not and with examples of how it is used. An embedded system is a microprocessor-based system
that is built to control a function or range of functions and is not designed to be programmed by
the end user in the same way that a PC is. Yes, a user can make choices concerning functionality
but cannot change the functionality of the system by adding/replacing software. With a PC, this is
exactly what a user can do: one minute the PC is a word processor and the next it’s a games
machine simply by changing the software. An embedded system is designed to perform one
particular task albeit with choices and different options. The last point is important because it
differentiates itself from the world of the PC where the end user does reprogram it whenever a
different software package is bought and run. However, PCs have provided an easily accessible
source of hardware and software for embedded systems and it should be no surprise that they form
the basis of many embedded systems. To reflect this, a very detailed design example is included
at the end of this book that uses a PC in this way to build a sophisticated data logging system for
P a g e 22 | 92
a race car. If this need to control the physical world is so great, what is so special about embedded
systems that has led to the widespread use of microprocessors? There are several major reasons
and these have increased over the years as the technology has progressed and developed.
Replacement for discrete logic-based circuits. The microprocessor came about almost by accident.
Arduino started in 2005 as a project for students at the Interaction Design Institute Ivrea in Ivrea,
Italy. At that time program students used a "BASIC Stamp" at a cost of $100, considered expensive
for students. Massimo Banzi, one of the founders, taught at Ivrea.
The name "Arduino" comes from a bar in Ivrea, where some of the founders of the project used to
meet. The bar, in turn, has been named after Arduin of Ivrea, who was the margrave of
Ivrea and king of Italy from 1002 to 1014. Colombian student Hernando Barragan created
the Wiring development platform which served as the basis for Arduino. Following the completion
of the Wiring platform, its lighter, less expensive versions were created and made available to the
open-source community; associated researchers, including David Cuartielles, promoted the idea.
The Arduino's initial core team consisted of Massimo Banzi, David Cuartielles, Tom Igoe,
Gianluca Martino, and David Mellis.
2.2.3 Why Arduino?
There are many other microcontrollers and microcontroller platforms available for physical
computing. Parallax Basic Stamp, and many others offer similar functionality. All of these tools
take the messy details of microcontroller programming and wrap it up in an easy-to-use package.
Arduino also simplifies the process of working with microcontrollers, but it offers some advantage
for teachers, students, and interested amateurs over other systems:
Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller
platforms. The least expensive version of the Arduino module can be assembled by hand, and even
the pre-assembled Arduino modules cost less than $50
Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating
systems. Most microcontroller systems are limited to Windows.
Simple, clear programming environment - The Arduino programming environment is easy-to-
use for beginners, yet flexible enough for advanced users to take advantage of as well. For teachers,
it's conveniently based on the Processing programming environment, so students learning to
program in that environment will be familiar with the look and feel of Arduino
Open source and extensible software- The Arduino software and is published as open source
tools, available for extension by experienced programmers. The language can be expanded through
C++ libraries, and people wanting to understand the technical details can make the leap from
P a g e 23 | 92
Arduino to the AVR C programming language on which it's based. Similarly, you can add AVR-
C code directly into your Arduino programs if you want to.
Open source and extensible hardware - The Arduino is based on Atmel's ATMEGA8 and
ATMEGA168microcontrollers. The plans for the modules are published under a Creative
Commons license, so experienced circuit designers can make their own version of the module,
extending it and improving it. Even relatively inexperienced users can build the breadboard version
of the module in order to understand how it works and save money.
2.2.4 Working in Arduino
The Arduino development environment 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. Software written
using Arduino is called sketches. It 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 environment including complete error messages and
other information. Now let us install the Arduino into our system and start working with it.
Follow the following steps to install the Arduino in your computer/laptop:
Step1. Install the FTDI driver provided in the CD given to you. To install it simply, unzip the FTDI
file and install the driver. It may take from few seconds to even minutes to install depending on
the computer and operating systems.
Image no-2.2.3(a) working step1
P a g e 24 | 92
Step2. Open the “Arduino-022” folder and click on the Arduino icon. A window will appear as
shown here.
Image no-2.2.3(b) working step2
Step3. Click on Tools from menu bar and select the board, and then select the board as “Arduino
NG or older / ATMEGA 168”.
Note: Please note that this option can be changed depending on the hardware used by the user.
This is just an example of the board which is based on Arduino NG based on ATMEGA 168; hence
we have selected this option.
Step4. Connect the device with the computer using USB cable. Now we have to select the serial
port on which the board will communicate with the computer. Go to Tools->Serial Port->COM X.
Here the ‘x, varies from computer to computer. See the image.
Note: It is very confusing to select the proper com port. We can check it by inserting and removing
the USB cable, the new com generated by inserting the cable should be selected. Although, the
Arduino selects the com port automatically, but sometimes we have to select the ports manually.
The proper board has to be selected manually only.
The code which goes inside the microcontroller is known as ‘HEX’ code. This code is
generated by compilers.
P a g e 25 | 92
The process of loading the code into the (flash memory of) microcontrollers is known as ‘Burning’
the microcontroller. There are several methods of burning microcontroller like using ‘ISP’ method,
using ‘High Voltage Programming’ using ‘Boot-loaders’ etc. Each method has its own merits and
demerits.
The easiest way of programming is by using ‘Boot-loaders’. Boot-loaders are small programs
residing inside the flash of the microcontrollers. For example in our system, the Boot-loader is
there to program the device using serial port (UART).
To program using UART interface make sure the device is Boot loaded. The Arduino works on
UART interfaced programming. Let us explain more about environment of Arduino. There is a
menu bar on the top of the window. All the lists in here are self-explanatory. We will seldom use
these lists. Below menu bar, there is a tool bar frequently used in the environment. The icons of
tool bar are explained here.
Verify: It is used to verify the code, if there is any syntax error then it gets highlighted. If there is
no error, then compilation is done.
Stop: It is used to stop the verification at any time.
New: Used to create a new workspace, but current workspace will be closed.
Open: It is used to save any saved sketch.
Save: Use to save the current sketch.
Upload: Used to upload the sketch into the microcontroller.
Any error, warning or notification can be shown in dark black window of the IDE.
The development board provided contains all these connections. Hence we never need to make
any such connections unless otherwise stated. For each program described further may have
different circuit. The circuits are shown if necessary. Now let us start programming. Open the
Arduino environment; select the proper com port and board as described earlier. Now, try to
compile this code given in figure, it will produce no error. Because it is complete.
There are two functions here:
1. void setup()
2. void loop()
Before discussing about these, let us know what the ‘function’ is. Function is nothing but a group
of statements under a single name.
P a g e 26 | 92
Image
no-2.2.3(c) showing the basic syntax of the programm
All these statements are assumed to be executed at once. All the functions start with an opening
parentheses (‘{‘) and terminates closing parentheses (‘}’). With and More discussion about
‘function’ is described later in the tutorial.
All the lines written under void setup () function will execute only once as the program starts.
Hence everything written under this function will execute only once.
All the programs written under void loop () function will keep on executing as long as the system
is kept on as this function keeps on executing continuously.
P a g e 27 | 92
CHAPTER (3) ARDUINO UNO
3.1 Overview
Arduino is an open-source computer hardware and software company, project and user
community that designs and manufactures microcontroller-based kits for building digital devices
and interactive objects that can sense and control the physical world.
The project is based on a family of microcontroller board designs manufactured primarily by Smart
Projects in Italy, and also by several other vendors, using various 8-
bit Atmel AVR microcontrollers or 32-bit Atmel ARM processors. 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
platform provides an integrated development environment (IDE) based on the Processing project,
which includes support for C, C++ and Java 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. Adafruit Industries estimated in mid-2011 that over 300,000 official
Arduinos had been commercially produced, and in 2013 that 700,000 official boards were in users'
hands.
The Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins
(of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP header and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB cable or power it with a
AC-to-DC adapter or battery to get started. You can tinker with your UNO without worrying too
much about doing something wrong, worst case scenario you can replace the chip for a few dollars
and start over again. "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
P a g e 28 | 92
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; for an extensive list of current,
past or outdated boards see the Arduino index of boards.
3.2 Pin Diagram
Figure no-3.2 pin diagram of Arduino UNO
Arduino/Genuino Uno is a microcontroller board based on the ATmega328P. It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz
crystal, a USB connection, a power jack, an ICSP header and a reset button.
It contains everything needed to support the microcontroller; simply connect it to a computer with
a USB cable or power it with a AC-to-DC adapter or battery to get started.
You can tinker with your UNO without worrying too much about doing something wrong, worst
case scenario you can replace the chip for a few dollars and start over again.
P a g e 29 | 92
3.3 ATmega328
3.3.1 Introduction
The computer on one hand is designed to perform all the general purpose tasks on a single machine
like you can use a computer to run a software to perform calculations or you can use a computer
to store some multimedia file or to access internet through the browser, whereas the
microcontrollers are meant to perform only the specific tasks, for e.g., switching the AC off
automatically when room temperature drops to a certain defined limit and again turning it ON
when temperature rises above the defined limit.
There are number of popular families of microcontrollers which are used in different applications
as per their capability and feasibility to perform the desired task, most common of these
are 8051, AVR and PIC microcontrollers. In this we will introduce you with AVR family of
microcontrollers.
History of AVR
AVR was developed in the year 1996 by Atmel Corporation. The architecture of AVR was
developed by Alf-Egil Bogen and Vegard Wollan. AVR derives its name from its developers and
stands for Alf-Egil Bogen Vegard Wollan RISC microcontroller, also known
as Advanced Virtual RISC.
AVR microcontrollers are available in three categories:
 Tiny AVR – Less memory, small size, suitable only for simpler applications
 Mega AVR – These are the most popular ones having good amount of memory (up-to 256
KB), higher number of in-built peripherals and suitable for moderate to complex
applications.
 Xmega AVR – Used commercially for complex applications, which require large program
memory and high speed?
3.3.2 Features
 RISC Architecture with CISC Instruction set
 Powerful C and assembly programming
P a g e 30 | 92
 Scalable
 Same powerful AVR microcontroller core
 Low power consumption
 Both digital and analog input and output interfaces
3.3.3 Pin description
The Atmel ATmega48/88/328 is a low-power CMOS 8-bit microcontroller based on the AVR
enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega48/88/328 achieves throughputs approaching 1 MIPS per MHz allowing the system
designed to optimize power consumption versus processing speed.
The Atmel ATmega48/88/328 provides the following features: 4K/8K/16K bytes of In-System
Programmable Flash with Read-While-Write capabilities, 256/512/512 bytes EEPROM,
512/1K/1K bytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three
flexible Timer/Counters with compare modes, internal and external interrupts, a serial
programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-
bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with
internal Oscillator, and five software selectable power saving modes. The Idle mode stops the CPU
while allowing the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and
interrupt system to continue functioning. The Power-down mode saves the register contents but
freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset.
In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a
timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU
and all I/O modules except asynchronous timer and ADC, to minimize switching noise during
ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of
the device is sleeping. This allows very fast start-up combined with low power consumption.
The ATmega48, ATmega88 and ATmega328 differ only in memory sizes, boot loader support,
and interrupt vector sizes. Table 2-1 summarizes the different memory and interrupts vector sizes
for the three devices.
ATmega88 and ATmega328 support a real Read-While-Write Self-Programming mechanism.
There is a separate Boot Loader Section, and the SPM instruction can only execute from there. In
P a g e 31 | 92
ATmega48, there is no Read-While-Write support and no separate Boot Loader Section. The SPM
instruction can execute from the entire Flash.
Figure no-3.3.3(a) pin description of ATmega 328
The ATmega48PA/88PA/168PA/328P is a low-power CMOS 8-bit microcontroller based on the
AVR enhanced RISC architecture (RISC, or Reduced Instruction Set Computer. is a type of
microprocessor architecture that utilizes a small, highly-optimized set of instructions). By
executing powerful instructions in a single clock cycle, the ATmega48PA/88PA/168PA/328P
achieves throughputs approaching 1 MIPS per MHz allowing the system designed to optimize
power consumption versus processing speed.
The AVR (Advanced Virtual RISC) core combines a rich instruction set with 32 general purpose
working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
P a g e 32 | 92
allowing two independent registers to be accessed in one single instruction executed in one clock
cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times
faster than conventional CISC microcontrollers. The ATmega48PA/88PA/168PA/328P provides
the following features: 4/8/16/32K bytes of In System Programmable Flash with Read-While-
Write capabilities, 256/512/512/1K bytes EEPROM, 512/1K/1K/2K bytes SRAM, 23 general
purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with
compare modes, internal and external interrupts, a serial programmable USART, a byte-oriented
2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC , a programmable Watchdog
Timer with internal Oscillator, and five software selectable power saving modes.
Figure no-3.3.3(b) pin diagram of ATmega328
The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-wire Serial
Interface, SPI port, and interrupt system to continue functioning.
The Power-down mode saves the register contents but freezes the Oscillator, disabling all other
chip functions until the next interrupt or hardware reset. In Power-save mode, the asynchronous
timer continues to run, allowing the user to maintain a timer base while the rest of the device is
sleeping.
The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer
and ADC, to minimize switching noise during ADC conversions. In Standby mode, the
P a g e 33 | 92
crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast
start-up combined with low power consumption.
The device is manufactured using Atmel’s high density non-volatile memory technology. The On-
chip ISP Flash allows the program memory to be reprogrammed In-System through an SPI serial
interface, by a conventional non-volatile memory programmer, or by an On-chip Boot program
running on the AVR core. The Boot program can use any interface to download the application
program in the Application Flash memory.
3.3.4 Comparison among ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P
The ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P differ only in memory
sizes, boot loader support, and interrupt vector sizes. Table summarizes the different memory and
interrupt vector sizes for the three devices.
Table: memory summary
DEVICE FLASH EEPROM RAM INTERRUPT SIZE
ATmega48PA 4K Bytes 256 Bytes 512 Bytes 1 instruction word/vector
ATmega88PA 8K Bytes 512 Bytes 1K Bytes 1 instruction word/vector
ATmega168PA 16K Bytes 512 Bytes 1K Bytes 2 instruction word/vector
ATmega328P 32K Bytes 1K Bytes 2K Bytes 2 instruction word/vector
Table no-3.3.4 memory summary of different ATmega microcontroller
3.3.5 Internal Description
Power
The Arduino/Genuino Uno board can be powered via the USB connection or with an external
power supply. The power source is selected automatically. External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging
a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in
P a g e 34 | 92
the GND and Vin pin headers of the POWER connector. The board can operate on an external
supply from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than
five volts and the board may become unstable. If using more than 12V, the voltage regulator may
overheat and damage the board. The recommended range is 7 to 12 volts.
The power pins are as follows:
 Vin. The input voltage to the Arduino/Genuino 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 - 12V), the USB connector (5V), or
the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.
 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/Genuino 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.
Memory
The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Input and Output
Each of the 14 digital 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.
P a g e 35 | 92
In addition, some pins have specialized functions:
 Serial: 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: 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.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
 LED: 13. 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.
 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
 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
analogReference() function.
 There are a couple of other pins on the board:
 AREF. Reference voltage for the analog inputs. Used with analogReference().
 Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
3.3.6 Communication
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.
P a g e 36 | 92
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).
Table: Arduino Specifications
Microcontroller ATmega328P
Operating Voltage 5V
Input Voltage (recommended) 7-12 V
Input Voltage (limit) 6-20 V
Digital I/O Pins 14 (of which 6 provide PWM Output)
PWM Digital I/O Pins 6
Analog Input Pins 6
DC Current per I/O pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega 328P) of which 0.5 KB used
by bootloader
SRAM 2 KB (ATmega 328P)
EEPROM 1 KB (ATmega328P)
Clock Speed 16 MHz
Length 68.6 mm
Width 53.4 mm
Weight 25 g
Table no-3.3.6 Arduino specification
3.3.7 Processor architecture
AVR follows Harvard Architecture format in which the processor is equipped with separate
memories and buses for Program and the Data information. Here while an instruction is being
executed, the next instruction is pre-fetched from the program memory.
P a g e 37 | 92
Figure no-3.3.7(a) process architecture of microcontroller
ALU: The high-performance AVR ALU operates in direct connection with all the 32 general
purpose working registers. Within a single clock cycle, arithmetic operations between general
purpose registers or between a register and an immediate are executed. The ALU operations are
divided into three main categories – arithmetic, logical, and bit-functions. Some implementations
of the architecture also provide a powerful multiplier supporting both signed/unsigned
multiplication and fractional format.
In-system reprogrammable flash program memory: The ATmega48/88/328 contains
4K/8K/16K bytes On-chip In-System Reprogrammable Flash memory for program storage. Since
all AVR instructions are 16 or 32 bits wide, the Flash is organized as 2K/4K/8K × 16. For software
security, the Flash Program memory space is divided into two sections, Boot Loader Section and
Application Program Section in ATmega88 and ATmega328.
EEPROM data memory: The Atmel ATmega48 /88/328 contains 256/512/512 bytes of data
EEPROM memory. It is organized as a separate data space e, in which single bytes can be read
and written. The EEPROM has an endurance of at least 100,000 write/erase cycles. The access
P a g e 38 | 92
between the EEPROM and the CPU is described in the following, specifying the EEPROM
Address Registers, the EEPROM Data Register, and the EEPROM Control Register.
Program counter: A program counter is a register in a computer processor that contains the
address (location) of the instruction being executed at the current time. As each instruction
gets fetched, the program counter increases its stored value by 1. After each instruction is fetched,
the program counter points to the next instruction in the sequence. When the computer restarts or
is reset, the program counter normally reverts to 0. In computing, a program is a specific set of
ordered operations for a computer to perform. An instruction is an order given to a computer
processor by a program. Within a computer, an address is a specific location in memory or storage.
A register is one of a small set of data holding places that the processor uses. Program counter is
very important feature in the microcontrollers.
RAM: RAM stands for random access memory. This type of memory storage is temporary and
volatile. You might have heard that if your system is working slowly you say that increase the
RAM processing will increase. Let us understand in detail. Let us consider two cases to execute a
task first the complete task is execute at one place(A), second the task is distributed in parts and
the small tasks are executed at different places(A,B C)and finally assembled. It is clear the work
will be finished in second case earlier. The A, B, C basically represent different address allocation
for temporary processing. This is the case with RAM also if you increase the RAM the address
basically increases for temporary processing so that no data has to wait for its turn. On major
importance of the RAM is address allocations. However the storage is temporary every time u boot
your system the data is lost but when you turn on the system The BIOS fetch number of addresses
available in the RAM. This memory supports read as well as write operations both.
Instruction execution section (IES). It has the most important unit—instruction register and
instruction decoder to control the flow of the instruction during the processing’s.
INPUT/OUTPUT Ports: To interact with the physical environment there are different input and
output ports in every system like in PC we have VGA port to connect the monitor, USB port for
flash memory connections and many more ports. Similarly ATMEGA 328 has its input and output
ports with different configurations depending on the architecture like only input, only output and
bi-directional input output ports. The accessing of this port is referred as input output interface
design for microcontrollers. IT has analog input port, analog output port, digital input port ,digital
output port, serial communication pins, timer execution pins etc.
Analog Comparator & A/D converters: The major question is that how a controller manage to
detect variation of voltage in-spite it could not understand the voltage but understand only digital
sequence
Most of the physical quantities around us are continuous. By continuous we mean that the quantity
can take any value between two extreme. For example the atmospheric temperature can take any
value (within certain range). If an electrical quantity is made to vary directly in proportion to this
P a g e 39 | 92
value (temperature etc) then what we have is Analogue signal. Now we have we have brought a
physical quantity into electrical domain.
The electrical quantity in most case is voltage. To bring this quantity into digital domain we have
to convert this into digital form. For this a ADC or analog to digital converter is needed. Most
modern MCU including AVRs has an ADC on chip. An ADC converts an input voltage into a
number. An ADC has a resolution. A 10 Bit ADC has a range of 0-1023. (2^10=1024) The ADC
also has a Reference voltage (ARef). When input voltage is GND the output is 0 and when input
voltage is equal to ARef the output is 1023. So the input range is 0-ARef and digital output is 0-
1023.
Figure no-3.3.7(b) variation of input and output voltage of microcontroller
Inbuilt ADC of AVR Now you know the basics of ADC let us see how we can use the inbuilt
ADC of AVR MCU. The ADC is multiplexed with PORTA that means the ADC channels are
shared with PORTA.
The ADC can be operated in single conversion and free running more. In single conversion mode
the ADC does the conversion and then stop. While in free it is continuously converting. It does a
conversion and then start next conversion immediately after that.
ADC Pre-scalar The ADC needs a clock pulse to do its conversion. This clock generated by
system clock by dividing it to get smaller frequency. As the system frequency can be set to any
value by the user (using internal or externals oscillators) (In board™ a 16MHz crystal is used). So
the Pre-scalar is provided to produces acceptable frequency for ADC from any system clock
frequency. System clock can be divided by 2, 4,16,32,64,128 by setting the Pre-scalar.
ADC Channels The ADC in ATmega328 has 6 channels that mean you can take samples from
eight different terminals. You can connect up to 8 different sensors and get their values separately.
P a g e 40 | 92
3.3.8 Pin description
Figure no-3.3.8 pin diagram of ATmega 328
3.3.9 Things to remember about ATMEGA328 controllers
The ATMEGA controllers are strong controllers but you have to take some small points in mind
always like:
 When you go for the programming of atmega328 consider the pin no. as configures in red
color in Pin diagram shown before (like controllers pin number 2 is digital pin number 0
for input or output ,pin23 is analog pin A0 ). Sao you will address the pin according to that
number.
 Use the proper pin for proper input output interface that analog input should be configured
at analog pin analog output should be configured on PWM pins and likewise the digital
inputs and outputs.
P a g e 41 | 92
CHAPTER (4) ARDUINO SOFTWARE
4.1 Arduino IDE
The Arduino IDE is a cross-platform application written in Java, and is derived from the IDE for
the Processing programming language 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 as syntax highlighting, brace matching, and automatic indentation,
and is also capable of compiling and uploading programs to the board with a single click. Although
building on command-line is possible if required with some third-party tools such as Ino. The
Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same name),
which makes many common input/output operations much easier. Arduino programs are written
in C/C++, although users only need define two functions to make a run-able program:
setup () – a function run once at the start of a program that can initialize settings
loop() – a function called repeatedly until the board powers off
A typical first program for a microcontroller simply blinks an LED on and off.
#define LED_PIN 13
void setup () {
pinMode (LED_PIN, OUTPUT); // enable pin 13 for digital output
}
void loop () {
digitalWrite (LED_PIN, HIGH); // turn on the LED
delay (1000); // wait one second (1000 milliseconds)
digitalWrite (LED_PIN, LOW); // turn off the LED
delay (1000); // wait one second
}
P a g e 42 | 92
4.1.1 What is IDE?
• The Arduino integrated development environment (IDE) is a cross-platform application
written in Java, and derives from the IDE for the Processing programming language and
the Wiring projects.
• It is designed to introduce programming to artists and other newcomers unfamiliar with
software development.
• It includes a code editor with features such as syntax highlighting, brace matching, and
automatic indentation, and is also capable of compiling and uploading programs to the
board with a single click. A program or code written for Arduino is called a "sketch
• Arduino programs are written in C or C++. The Arduino IDE comes with a software library
called "Wiring" from the original Wiring project, which makes many common input/output
operations much easier.
• The source code for the IDE is available and released under the GNU General Public
License, version 2.
4.2 Serial Communication
Used for communication between the Arduino and a computer or other devices. All Arduino
boards have at least one serial port (also known as a UART or USART): Serial. It communicates
on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB. Thus, if one use these
functions, one cannot also use pins 0 and 1 for digital input or output.
One can use the Arduino environment's built-in serial monitor to communicate with an Arduino
board. Click the serial monitor button in the toolbar and select the same baud rate used in the call
to begin().
Information passes between the computer and Arduino through USB cable. Information is
transmitted as 0’s and 1’s, also known as bits.
• Compiling turns your program into binary data (ones and zeros)
P a g e 43 | 92
• Uploading sends the bits through USB cable to the Arduino
• The two LEDs near the USB connector blink when data is transmitted
• RX blinks when the Arduino is receiving data
• TX blinks when the Arduino is transmitting data
Image no-4.2 Transmission and reception of Arduino board
P a g e 44 | 92
CHAPTER (5) GSM TECHNOLOGY AND MODEM
5.1 Introduction
 GSM (Groupe Spéciale Mobile, now named Global System for Mobile Communications)
is a 2nd
Generation cellular mobile system innovated in Europe by ETSI (European
Telecommunications Standardization Institute). It is now a “family name” of a number of
systems including 2.5G and 3G systems such as:
 PCS (Personal Cellular System/Service) – North American GSM
 HSCSD (High-Speed Circuit Switched Data) – GSM with high-speed data by bundling up
to four voice equivalent channels
 GPRS (General Packet Radio Services) – GSM enhancement in cell-phone software and
network hardware and
 software to support packet switching (the one used by the Internet)
 EDGE (Enhanced Data rates for GSM Evolution) – a technique to achieve better
‘compression’ of data on the air interface
 EGPRS (EDGE based GPRS)
 UMTS (Universal Mobile Telecommunications Service) – 3G System based on W-CDMA
(Wideband Code Division Multiple Access)
 HSPA (High Speed Packet Access) – Data speed enhancement for 3G systems
 3GSM (3rd
 Generation GSM) – new name for 3G systems that are based on GSM technologies
The development of GSM started in 1982 when a study group ‘Group Special Mobile’ was formed
during Conference of European Posts and Telegraphs (CEPT) this group was to develop a Pan-
European public cellular system in the 900 MHz range. Some of the basic criteria for their
proposed system were:
 Good subjective speech quality
 ISDN compatibility
 Spectral efficiency
 Support for international roaming
 Support for range of new services and facilities
In 1989, GSM responsibility was transferred to European Telecommunication Standards Institute
(ETSI) and commercial service was started in mid1991. Although GSM was standardized in
P a g e 45 | 92
Europe, now it is operational in other continents also. The acronym GSM now aptly stands for
Global System for Mobile Communication.
5.2 Cellular mobile system
Cellular radio was devised in order to make better use of limited resource of Radio Spectrum. Each
Megahertz of spectrum will only support a comparatively a small number of simultaneous
conversations and the same frequency must be reused many times in order to meet the capacity
needed for national or regional service. So with the development in Political, Commercial and
Industrial areas there arose a necessity for uniformity in cellular communication Cellular mobile
communication has generations:
1. First generation: Analog radio; mostly telephony only, virtually no data capability other
than special device with analog modem.
2. Second Generation: Digital radio and short messaging; this is now the main stream
system. Recently a variety of technique has been innovated and employed to enhance data
capability of 2G systems. The data capability includes Internet access and picture sharing.
These systems are called 2.5G systems.
3. Third Generation: Digital system with multimedia services including video phone and
relatively higher speed (say up to 1 Mbps) Internet access. A slow roll off of 3G system
has been started in advanced networks of developed and rapidly developing countries.
4. Fourth Generation: Digital system with voice-over-IP (VOIP) technology (Note that the
voice for G1, 2 and 3 are circuit-switched). That is, the services are integrated into all IP
network. This is expected to be future network and not coming any time soon.
Table no-5.2 cellular mobile sysytem
P a g e 46 | 92
5.3 GSM technology
One of the most important conclusions from the early tests of the new GSM technology was that
the new standard should employ Time Division Multiple Access (TDMA) technology. This
ensured the support of major corporate players like Nokia, Ericsson and Siemens, and the
flexibility of having access to a broad range of suppliers and the potential to get product faster into
the marketplace. After a series of tests, the GSM digital standard was proven to work in 1988.
With global coverage goals in mind, being compatible with GSM from day one is a prerequisite
for any new system that would add functionality to GSM. As with other 2G systems, GSM handles
voice efficiently, but the support for data and Internet applications is limited. A data connection
is established in just the same way as for a regular voice call; the user dials in and a circuit-switched
connection continues during the entire session. If the user disconnects and wants to re-connect,
the dial-in sequence has to be repeated. This issue, coupled with the limitation that users are billed
for the time that they are connected, creates a need for packet data for GSM.
The digital nature of GSM allows the transmission of data (both synchronous and asynchronous)
to or from ISDN terminals, although the most basic service support by GSM is telephony. Speech,
which is inherently analog, has to be digitized. The method employed by ISDN, and by current
telephone systems for multiplexing voice lines over high-speed trunks and optical fiber lines, is
Pulse Coded Modulation (PCM). From the start, planners of GSM wanted to ensure ISDN
compatibility in services offered, although the attainment of the standard ISDN bit rate of 64 Kbit/s
was difficult to achieve, thereby belying some of the limitations of a radio link. The 64 Kbit/s
signal, although simple to implement, contains significant redundancy.
Since its inception, GSM was destined to employ digital rather than analog technology and operate
in the 900 MHz frequency band. Most GSM systems operate in the 900 MHz and 1.8 GHz
frequency bands, except in North America where they operate in the 1.9 GHz band. GSM divides
up the radio spectrum bandwidth by using a combination of Time- and Frequency Division
Multiple Access (TDMA/FDMA) schemes on its 25 MHz wide frequency spectrum, dividing it
into 124 carrier frequencies (spaced 200 Khz apart). Each frequency is then divided into eight time
slots using TDMA, and one or more carrier frequencies are assigned to each base station. The
fundamental unit of time in this TDMA scheme is called a ‘burst period’ and it lasts 15/26 ms (or
approx. 0.577 ms). Therefore the eight ‘time slots’ are actually ‘burst periods’, which are grouped
into a TDMA frame, which subsequently form the basic unit for the definition of logical channels.
The development of standards and systems spans well beyond the technical realm and often into
P a g e 47 | 92
the political; this is best exemplified by what happened with GSM. Shortly after the suitability of
TDMA for GSM was determined, a political battle erupted over the question of whether to adopt
a wide-band or narrow-band TDMA solution. Whereas France and Germany supported a wide-
band solution, the Scandinavian countries favored a narrow-band alternative. These governmental
preferences were clearly a reflection of the respective countries’ domestic equipment
manufacturers as German and French manufacturers SEL and Alcatel had invested substantially
into wide-band technology, whereas their Scandinavian counterparts Ericsson and Nokia poured
resources into the narrow-band alternative. Italy and the UK, in turn, were the subjects of intense
lobbying on behalf of the two camps with the result of frequently changing coalitions
The culmination of this controversy between the two camps was a CEPT (Conference des
Administrations Europeans des Posts et Telecommunications) Meeting in Madeira in February
1987. The Scandinavian countries finally convinced Italy, the UK and a few smaller states of the
technical superiority of narrow-band technology and left Germany and France as the only
proponents of the wide-band alternative. Since CEPT followed purely intergovernmental
procedures, however, decisions had to be taken unanimously, and Germany and France were able
to veto a decision that would have led to the adoption of narrow-band TDMA as the technology
underlying the GSM project.
A unique feature of GSM is the Short Message Service (SMS), which has achieved wide popularity
as what some have called the unexpected ‘killer application’ of GSM. SMS is a bi-directional
service for sending short alphanumeric message in a store-and-forward process. SMS can be used
both ‘point-to-point’ as well as in cell-broadcast mode. (Further information in Section 3.5)
Supplementary services are provided on top of tele-services or bearer services, and include features
such as, inter alia, call forwarding, call waiting, caller identification, three-way conversations, and
call-barring.
Another of GSM’s most attractive features is the extent to which its network is considered to be
secure. All communications, both speech and data, are encrypted to prevent eavesdropping, and
GSM subscribers are identified by their Subscriber Identity Module (SIM) card (which holds their
identity number and authentication key and algorithm).
While the choice of algorithm is the responsibility of individual GSM operators, they all work
closely together through the Memorandum of Understanding (MOU) (to be described in greater
detail in section 2.2.2) to ensure security of authentication. This smartcard technology minimizes
the necessity for owning terminals - as travelers can simply rent GSM phones at the airport and
P a g e 48 | 92
insert their SIM card. Since it’s the card rather than the terminal that enables network access,
feature access and billing, the user is immediately on-line.
5.4 System architecture
The functional architecture of a GSM system can be broadly classified into
 Mobile Station (MS)
 Base Station Subsystem (BSS)
 Network and Switching Subsystem (NSS)
 Operation Subsystem (OSS)
The MS and the BSS communicate via the Um interface or radio link. The BSS communicates
with Mobile Service Switching Center across the A interface.
5.4.1 Mobile Station
This may be a standalone piece of equipment for certain services or support the connection of
external terminals. The MS consists of the Mobile Equipment (ME) and a Subscriber Identity
Module (SIM).The ME is uniquely identified by the International Mobile Equipment Identity
(IMEI), but it need not be personally assigned to one subscriber, The SIM which is a smart card
provides personal mobility and the user can access the subscriber services. The subscriber can
operate on any terminal just by inserting the SIM card in that GSM terminal. SIM card contains
the International Mobile Subscriber Identity (IMSI) used to identify the subscriber to the system,
a secret key for authentication and other security information’s. SIM card may be protected against
unauthorized use by a password.
5.4.2 Base Station Subsystem
The BSS is composed of three parts, Base Transceiver Station (BTS) and U3ase Station Controller
(BSC). These two communicate across the standardized Abis interface. The third part is
Transponder and Rate Adaptation Unit (TRAU).
5.4.3 Base Transceiver Station
This provides the GSM radio coverage within a cell. It comprises of radio transmitting and
receiving equipment and associated signal processing units. This complements the radio features
of ME.
5.4.4 Base Station Controller
This manages the radio resources for one or more BTS’s. It handles radio channel set-up,
Handovers and frequency hopping. Handovers between BTS’s belonging to different BSC’s
P a g e 49 | 92
however can involve MSC’s but are still managed by the original serving BSC. It controls the
transmission of information about Local Area Codes (LAC), signaling channel configuration and
information’s about neighboring cells.
Figure no-5.4.4(a) block diagram of BSC
Figure no-5.4.4(b) block diagram of GSM technology
5.4.5 Trans-coder and Rate Adaptation Unit
This is responsible for trans-coding between GSM encoded speech at I 3KPS and fixed network
speech at 64KPS. Similarly it performs rate adaptation of GSM data services. Although it is a part
of BSS, it is located at MSC Sites. This is to benefit from the lower rate coding and consequent
saving in transmission costs.
5.5 Network and switching sub system
NSS in GSM uses an Intelligent Network (The central component of NSS is the Mobile Service
Switching Center (MSC). It is supported by Interworking functions (JWF), Home Location
Register (HLR), Visitor Location Register (VLR), Gateway MSC (GMSC) and Signal Transfer
Point (STP).
P a g e 50 | 92
5.5.1 Mobile Service Switching Center
It acts like a switching node and additionally provides all the functionality needed to handle a
mobile subscriber such as registration, authentication, and location updating. Handovers and call
routing to a roaming subscribe. These functions are provided in conjunction with several functional
entities. An MSC controls several BSC’s.
5.5.2 Inter Working Function, (IWF)
A gateway for MSC to interface with external networks for communications with users outside
GSM. The role of IWF depends upon the type of user data and the network to which it interfaces.
5.5.3 Home Location Register, (HLR)
It consists of a computer without switching capabilities. It is a database, which contains subscriber
information related to the subscriber’s current locations but not the actual location. HLR has two
divisions Authentication Center (AuC) and Equipment Identity Register (EIR). The AuC manages
the security data for subscriber authentication. The EIR database carry information about certain
ME’s. The security procedure is discussed later.
5.5.4 Visitor Location Register, (VLR)
It links to one or more MSC’s, temporarily storing subscription data currently served by its
corresponding MSC. VLR holds more current subscriber location than l—ILR. Although VLR is
an independent unit, it is always implemented together with the MSC.
5.5.5 Gateway MSC (GMSC)
In order to set-up a requested call, the call is initially routed to a GMSC which finds the correct
HLR.GMSC has an interface with external network for gate -waying and the network operates the
full signaling system 7 (SS7) between NSS Machines.
5.5.6 Signaling Transfer Point
It acts as a standalone node to optimize the cost of the signaling transport among MSC/VLR,
GMSC and HLR>
5.6More points
5.6.1 Operating subsystem:
There are three area of OSS
 Network operation and maintenance function.
 Subscription management including charging and billing.
 Mobile Equipment and Management.
P a g e 51 | 92
5.6.2 Layer modeling
 Transmission
 Radio resource management
 Mobility management
 Communication management
 Operation, administration and maintenance
5.6.3 Radio link aspects
The International Telecommunication Union (ITU) which manages Allocation of radio spectrum
has allocated the bands 890-915MHz for the uplink (MS to BS) and 960MHz for the downlink
(BS to MS) for mobile networks.
5.6.4 Multiple access and channel structure
Due to the scarcity of radio spectrum, a method must be devised to divide bandwidth among as
many users as possible. GSM uses a combination of FDMA TDMA. FDMA part involves the
division by frequency of the 25M1-lz bandwidth into carrier frequencies of 200 KHz bandwidth.
One or more carrier frequencies is then divided in time using TDMA scheme.
5.6.5 Traffic channels
This is also called physical channel. This is used to carry speech and data traffic: They are of three
kinds
 TCH/F (full rate): Transmits the speech code of 13 KBPS or Three data mode 12, 6 and
3.6 1KBPS.
 TCIH/H(half rate):Transmits the speech code of 7 1KBPS or Two data modes 6 3.6
1KBPS
 TCI-118(1/8th
rate): Used for low rate signaling channels, Common channels and channels.
They are also called Stand Alone Dedicated Control Channel(SDCCH)
5.6.6 Cell selection
Using the best cell from an MS depends on three factors
 The level of signal received by the MS.
 The maximum transmission power of the MS.
 Two parameters P1 and P2 specified by the cell
C1 = A-max (B, 0)
A = received level average-P 1
B = P2-Max RF power of the MS.
P a g e 52 | 92
P1 = A value between —110 and —48dBm
P2 = A value between 13 and 43dBm
Call selection algorithm is as follows
 The SIM must be inserted
 The strongest Cl is chosen by obtaining Cl from the candidate cells.
All cells must not be barred from service
P a g e 53 | 92
CHAPTER (6) SERVO MOTOR
6.1 Introduction
A servomotor is a rotary actuator that allows for precise control of angular position. It consists of
a motor coupled to a sensor for position feedback, through a reduction gearbox. It also requires a
relatively sophisticated controller, often a dedicated module designed specifically for use with
servomotors.
Figure no-6.1(a) block diagram of servo motor
The electric motor and the servomechanism both serve as fundamental building blocks for modern
mechanical equipment’s and advance technological instruments. An electric motor is a device that
uses electrical energy to produce mechanical energy. A servomechanism, or servo, differs from a
motor in that it automatically corrects its performance using error-sensing feedback. A servo is
typically implemented with an electric motor as the source of mechanical force.
Image no-6.1 block diagram of BSC
Servomotors are designed to operate control surfaces. So they do not rotate continuously. Rather
they are designed to rotate through 180 degrees with precise position control. If you want to use
them as the main drive motor for a mobile robot you need to modify them so that they will rotate
continuously. They do not simply run on a DC voltage like a standard DC motor. They have 3
wires. Red is power (generally 3V – 12V max), black is ground and then there is another wire,
usually white or yellow that is the “input signal wire”.
P a g e 54 | 92
6.2 Commercial application
Electric motors are inexpensive, easy-to-use, and most importantly, a convenient source of
mechanical force. They also allow delicate and precise movements, which grant them to play a
part in applications involving systems and controls. Electric motors can be found in household
appliances such as fans, refrigerators, washing machines, floor vacuums, hair dryers, and electric
heaters. Depending on the power output and the size of a particular motor, the cost ranges from a
few to several thousand US dollars. Due to the simplicity of their construction and their generic
nature, production of electric motors is inclusive to almost any electrical manufacturer.
Servos, on the other hand, can be a bit more expensive because they incorporate performance
adjustment capabilities on top of providing mechanical force. The automatic correction feature
requires feedback circuits to actively monitoring the performance parameters such as speed, in
cruise control, and position, in navigation systems. In complex cases, software manipulation of the
mechanism is needed. Some of the highly advanced applications of servomechanism include:
automatic machine tools, satellite-tracking antennas, and automatic security systems.
6.3 Types
Servo motors are special category of motors, designed for applications involving position control,
velocity control and torque control. These motors are special in the following ways:
1. Lower mechanical time constant.
2. Lower electrical time constant.
3. Permanent magnet of high flux density to generate the field.
4. Fail-safe electro-mechanical brakes.
For applications where the load is to be rapidly accelerated or decelerated frequently, the electrical
and mechanical time constants of the motor plays an important role. The mechanical time constants
in these motors are reduced by reducing the rotor inertia. Hence the rotors of these motors have an
elongated structure.
6.4 Principle of operation
Servo motors are used in closed loop control systems in which work is the control variable. Servo
motors feature a motion profile, which is a set of instructions programmed into the controller that
defines the servo motor operation in terms of time, position, and velocity.
P a g e 55 | 92
Figure no-6.4(a) principle of operation of servo motor
The servo motor controller directs operation of the motor by sending velocity command signals to
the amplifier that drives the servo motor. The servo compares its position and velocity feedbacks
to its programmed motion profiles and adjusts the motor velocity accordingly.
A servomotor is controlled by sending a pulse signal that is HIGH for a brief time, generally 1 – 2
ms. If you just connect a battery to power and ground, nothing will happen.
You must have a timer circuit that generates this pulsed signal and by varying the pulse ON time
(or the pulse width) the motor will move to a certain position over its range of motion and then
stop as long as the input pulse width is the same. Depending on the pulse width, you’ll get a
different position. This diagram shows some control signal pulses for a typical servo and the
position to which it will rotate in response to the pulse width.
Figure no-6.4(b) principle of operation sending of high pulse at every 20 ms
There is another element to the signal that also requires timing accuracy. The frequency of the
signal or its rate of refresh. Not only do you have to send the pulse, you have to keep sending
them as long as you want the motor to be in that position (or to keep rotating for modified servos).
Generally a frequency of 50 Hz is good. This means that you send the high pulse 50 times every
second.
A servo will only rotate through 180 degrees unless you modify it for continuous rotation. One
P a g e 56 | 92
interesting thing that comes out this modification is that you get a speed control function out of
it, though somewhat coarse.
When you make the modification you replace the circuitry in the motor that tells the motor what
position it is in. The modes you make tell the motor that it is always in the center position. So if
you feed a 1.75 ms pulse, it rotates to the 180 degree position, checks the feedback which tells it
that “hey, you haven’t moved yet. You’re still in the center position, keep going” so it does, checks
and sees that it hasn’t moved yet and keeps doing it. Since it thinks that it is in center position and
it has to move to its right most position it will move at its fastest rate.
Now suppose you send it a signal that says to rotate to 95 degrees, 5 degrees right of center. The
internal control system knows that it is now to move a very short distance. It also knows that if it
rotates at its fastest speed that it may overshoot this and has to come back, and overshoot again in
the other direction and try again, and so forth. This is called oscillation and is not a good thing.
The advantage that you get out of this is that the motor will move slower when you feed a signal
that is close to the center position. So you feed it a “go to 95 degree” signal and it will rotate CW
at a slow rate. Give it “go to 180 degrees” and it will rotate CW at its fastest rate and the same for
CCW.
6.5 Application
 Used in RC plane design
 Fixed angle motion
P a g e 57 | 92
CHAPTER (7) PIR SENSOR
7.1 Introduction
The PIR (Passive Infra-Red) Sensor is a pyro electric device that detects motion by measuring
changes in the infrared (heat) levels emitted by surrounding objects. When motion is detected the
PIR sensor outputs a high signal on its output pin. This logic signal can be read by a microcontroller
or used to drive an external load.
Figure no-7.1(a) PIR sensor
 Longer detection range, selectable by onboard jumper
 Wider supply voltage, from 3 to 6 VDC
 Higher output current provides for direct control of an external load
 Mounting holes included for permanent projects
 All parts SMT
PIR sensors allow you to sense motion, almost always used to detect whether a human has moved
in or out of the sensors range. They are small, inexpensive, low-power, easy to use and don't wear
out.
Figure no-7.1(b) Pcb of PIR sensor
They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR motion" sensors.PIRs
are basically made of a pyroelectric sensor (which you can see above as the round metal can with
a rectangular crystal in the center), which can detect levels of infrared radiation. Everything emits
P a g e 58 | 92
some low level radiation, and the hotter something is, the more radiation is emitted. The sensor in
a motion detector is actually split in two halves. The reason for that is that we are looking to detect
motion (change) not average IR levels. The two halves are wired up so that they cancel each other
out. If one half sees more or less IR radiation than the other, the output will swing high or low.
7.2 How it works
The PIR sensor itself has two slots in it; each slot is made of a special material that is sensitive to
IR. The lens used here is not really doing much and so we see that the two slots can 'see' out past
some distance (basically the sensitivity of the sensor). When the sensor is idle, both slots detect
the same amount of IR, the ambient amount radiated from the room or walls or outdoors. When
warm bodies like a human or animal passes by the sensor, it first intercepts one half of the PIR
sensor, which causes a positive differential change between the two halves. When the warm body
leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential
change. These change pulses are what is detected.
Figure no-7.2 Working of PIR sensor
7.3 Technical data
 Power requirements: 3 to 6 VDC; 12 mA @ 3 V, 23 mA @ 5 V
 Communication: Single bit high/low output
 Dimensions: 1.41 x 1.0 x 0.8 in (35.8 x 25.4 x 20.3 cm)
P a g e 59 | 92
 Operating temp range: 32 to 122 °F (0 to 50 °C)
7.4 Application
 Motion-activated nightlight
 Alarm systems
 Holiday animated props
 Motion based security system
P a g e 60 | 92
CHAPTER (8) COMPONENTS
8.1 Capacitor
8.1.1 Introduction
The capacitor's function is to store electricity, or electrical energy. The capacitor also functions as
a filter, passing alternating current (AC), and blocking direct current (DC). This symbol ( )is
used to indicate a capacitor in a circuit diagram. The capacitor is constructed with two electrode
plates facing each other but separated by an insulator.
When DC voltage is applied to the capacitor, an electric charge is stored on each electrode.
While the capacitor is charging up, current flows. The current will stop flowing when the capacitor
has fully charged.
8.1.2 Actual Capacitance
This is a measure of a capacitor’s ability to store charge. A large capacitance means that more
charge can be stored. It is measured in farad, F. 1F is very large, so prefixes are used to show the
smaller values.
Three prefixes are used, u (micron), n (Nano), and p (Pico).
1uf=10-6
f
1nf=10-9
f
1pf=10-12
f
Sometimes, a three-digit code is used to indicate the value of a capacitor. There are two
ways in which the capacitance can be written one uses letters and numbers, the other uses only
numbers. In either case, there are only three characters used. [10n] and [103] denote the same value
of capacitance.
The method used differs depending on the capacitor supplier. In the case that the value is
displayed with the three-digit code, the 1st and 2nd digits from the left show the 1st figure and the
2nd figure, and the 3rd digit is a multiplier which determines how many zeros are to be added to
the capacitance. Pico farad (pF) units are written this way.
For example, when the code is [103], it indicates 10 x 103, or 10,000pF = 10 nano-farad
(nF) = 0.01 microfarad (µF).
If the code happened to be [224], it would be 22 x 104 = or 220,000pF = 220nF = 0.22µF.
Values under 100pF are displayed with 2 digits only. For example, 47 would be 47pF.
The capacitor has an insulator (the dielectric) between 2 sheets of electrodes. Different kinds of
capacitors use different materials for the dielectric.
P a g e 61 | 92
8.1.3 Breakdown voltage
When using a capacitor, you must pay attention to the maximum voltage which can be used. This
is the "breakdown voltage." The breakdown voltage depends on the kind of capacitor being used.
You must be especially careful with electrolytic capacitors because the breakdown voltage is
comparatively low. The breakdown voltage of electrolytic capacitors is displayed as Working
Voltage.
The breakdown voltage is the voltage that when exceeded will cause the dielectric
(insulator) inside the capacitor to break down and conduct. When this happens, the failure can be
catastrophic.
8.1.4 Types of Capacitors
There are various types of capacitors available in the market. Some of them are as follows:
 Mica Capacitor
 Paper Capacitor
 Ceramic Capacitor
 Variable Capacitor
 Electrolytic Capacitor
 Tantalum Capacitor
 Film Capacitor
Here we used only two types of capacitor i.e. ceramic capacitor & electrolytic capacitor.
1. Polarized capacitors
2. Un-polarized capacitors
1. Polarized Capacitors:
These are the capacitors having polarity. Basically these are of larger values than 1uf. For
example below is the diagram of capacitor of 220 microfarad and having breakdown voltage 25V.
Image no-8.1.4(a) Picture of polarize capacitors
2. Un-polarized Capacitors (small values, up to 1µF)
Small value capacitors are un-polarized and may be connected either way round. They are
not damaged by heat when soldering, except for one unusual type (polystyrene). They have high
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system
Home security system

More Related Content

What's hot

Home security
Home securityHome security
Home securitynewaz30
 
Smart home
Smart homeSmart home
Smart homeNhat Loc
 
Presentation Smart Home With Home Automation
Presentation Smart Home With Home AutomationPresentation Smart Home With Home Automation
Presentation Smart Home With Home AutomationArifur Rahman
 
Home automation using arduino
Home automation using arduinoHome automation using arduino
Home automation using arduinoIkram Arshad
 
HOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOHOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOEklavya Sharma
 
Home automation using internet of things
Home automation using internet of thingsHome automation using internet of things
Home automation using internet of thingsAbhishek Bhadoria
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUSouvik Kundu
 
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUCONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUVINAY KUMAR GUDELA
 
Final year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetoothFinal year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetoothShubham Bhattacharya
 
IoT Based Home Automation System Presantation
IoT Based Home Automation System PresantationIoT Based Home Automation System Presantation
IoT Based Home Automation System PresantationFarhan Ahmed Rahee
 
Smart homes presentation
Smart homes presentation Smart homes presentation
Smart homes presentation shadenalsh
 
Home automation- An Iot application
Home automation- An Iot applicationHome automation- An Iot application
Home automation- An Iot applicationArchana Golhar
 
Security system using Arduino
Security system using ArduinoSecurity system using Arduino
Security system using ArduinoApoorv Anand
 
Smart Door locking system using arduino
Smart Door locking system using arduinoSmart Door locking system using arduino
Smart Door locking system using arduinoBhawnaSingh351973
 
IOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationIOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationNikhil Jadav
 
Gsm based fire alert system
Gsm based fire alert systemGsm based fire alert system
Gsm based fire alert systemNisha Kumari
 

What's hot (20)

Home security
Home securityHome security
Home security
 
Smart home
Smart homeSmart home
Smart home
 
GSM Based Security System
GSM Based Security SystemGSM Based Security System
GSM Based Security System
 
Presentation Smart Home With Home Automation
Presentation Smart Home With Home AutomationPresentation Smart Home With Home Automation
Presentation Smart Home With Home Automation
 
Home automation using arduino
Home automation using arduinoHome automation using arduino
Home automation using arduino
 
HOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOHOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINO
 
Home automation using internet of things
Home automation using internet of thingsHome automation using internet of things
Home automation using internet of things
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCU
 
Home automation
Home automationHome automation
Home automation
 
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUCONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
 
Final year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetoothFinal year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetooth
 
IoT Home Automation System
IoT Home Automation SystemIoT Home Automation System
IoT Home Automation System
 
IoT Based Home Automation System Presantation
IoT Based Home Automation System PresantationIoT Based Home Automation System Presantation
IoT Based Home Automation System Presantation
 
Home automation using IOT
Home automation using IOTHome automation using IOT
Home automation using IOT
 
Smart homes presentation
Smart homes presentation Smart homes presentation
Smart homes presentation
 
Home automation- An Iot application
Home automation- An Iot applicationHome automation- An Iot application
Home automation- An Iot application
 
Security system using Arduino
Security system using ArduinoSecurity system using Arduino
Security system using Arduino
 
Smart Door locking system using arduino
Smart Door locking system using arduinoSmart Door locking system using arduino
Smart Door locking system using arduino
 
IOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationIOT: Home Automation using Android Application
IOT: Home Automation using Android Application
 
Gsm based fire alert system
Gsm based fire alert systemGsm based fire alert system
Gsm based fire alert system
 

Viewers also liked

Home automation & security system
Home automation & security systemHome automation & security system
Home automation & security systemAniket Maithani
 
Smart home device system using arduino uno & X-Bee
Smart home device system using arduino uno & X-BeeSmart home device system using arduino uno & X-Bee
Smart home device system using arduino uno & X-Beepremdeshmane
 
Gsm based home(ppt)
Gsm based home(ppt)Gsm based home(ppt)
Gsm based home(ppt)kjabraham007
 
Arduino based intelligent greenhouse Project
Arduino based intelligent greenhouse ProjectArduino based intelligent greenhouse Project
Arduino based intelligent greenhouse ProjectAmit Saini
 
HOME AUTOMATION SYSTEM USING RADIO FREQUENCY
HOME AUTOMATION SYSTEM USING RADIO FREQUENCYHOME AUTOMATION SYSTEM USING RADIO FREQUENCY
HOME AUTOMATION SYSTEM USING RADIO FREQUENCYSUDIP KUMAR PAUL
 
Home security System By MUKUL TUHIN UJJOL KAZI SHANTANU
Home security  System By MUKUL TUHIN UJJOL KAZI SHANTANU Home security  System By MUKUL TUHIN UJJOL KAZI SHANTANU
Home security System By MUKUL TUHIN UJJOL KAZI SHANTANU Mukulkrahman
 
Projects based on atmega controlleer
Projects based on atmega  controlleerProjects based on atmega  controlleer
Projects based on atmega controlleersumit tiwari
 
Home appliances control using RF communication
Home appliances control using RF communicationHome appliances control using RF communication
Home appliances control using RF communicationChittaranjan Baliarsingh
 
Modified_PCR_CODE in Arduino
Modified_PCR_CODE in ArduinoModified_PCR_CODE in Arduino
Modified_PCR_CODE in ArduinoKhoa Le
 
Yuva Home automation project
Yuva Home automation projectYuva Home automation project
Yuva Home automation projectYuvaraja Ravi
 
SMS Based Home Automation System
SMS Based Home Automation SystemSMS Based Home Automation System
SMS Based Home Automation SystemSujit Nayak
 
Arduino Home Automation Hacks
Arduino Home Automation HacksArduino Home Automation Hacks
Arduino Home Automation HacksNicholas O'Leary
 
multiple input control by sms using GSM technology
multiple input control by sms using GSM technologymultiple input control by sms using GSM technology
multiple input control by sms using GSM technologySachin Singh
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IOJingfeng Liu
 
Home automation and Digital notice board using android app
Home automation and Digital notice board using android appHome automation and Digital notice board using android app
Home automation and Digital notice board using android appRishikesh .
 
Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)Birol Arslan
 

Viewers also liked (20)

Home automation & security system
Home automation & security systemHome automation & security system
Home automation & security system
 
Smart home device system using arduino uno & X-Bee
Smart home device system using arduino uno & X-BeeSmart home device system using arduino uno & X-Bee
Smart home device system using arduino uno & X-Bee
 
Gsm based home automation
Gsm based home automationGsm based home automation
Gsm based home automation
 
Gsm based home(ppt)
Gsm based home(ppt)Gsm based home(ppt)
Gsm based home(ppt)
 
Arduino based intelligent greenhouse Project
Arduino based intelligent greenhouse ProjectArduino based intelligent greenhouse Project
Arduino based intelligent greenhouse Project
 
HOME AUTOMATION SYSTEM USING RADIO FREQUENCY
HOME AUTOMATION SYSTEM USING RADIO FREQUENCYHOME AUTOMATION SYSTEM USING RADIO FREQUENCY
HOME AUTOMATION SYSTEM USING RADIO FREQUENCY
 
Home security System By MUKUL TUHIN UJJOL KAZI SHANTANU
Home security  System By MUKUL TUHIN UJJOL KAZI SHANTANU Home security  System By MUKUL TUHIN UJJOL KAZI SHANTANU
Home security System By MUKUL TUHIN UJJOL KAZI SHANTANU
 
Projects based on atmega controlleer
Projects based on atmega  controlleerProjects based on atmega  controlleer
Projects based on atmega controlleer
 
Home appliances control using RF communication
Home appliances control using RF communicationHome appliances control using RF communication
Home appliances control using RF communication
 
Modified_PCR_CODE in Arduino
Modified_PCR_CODE in ArduinoModified_PCR_CODE in Arduino
Modified_PCR_CODE in Arduino
 
RF Based Home Automation System
RF Based Home Automation SystemRF Based Home Automation System
RF Based Home Automation System
 
Home Automation
Home AutomationHome Automation
Home Automation
 
Yuva Home automation project
Yuva Home automation projectYuva Home automation project
Yuva Home automation project
 
SMS Based Home Automation System
SMS Based Home Automation SystemSMS Based Home Automation System
SMS Based Home Automation System
 
Arduino Home Automation Hacks
Arduino Home Automation HacksArduino Home Automation Hacks
Arduino Home Automation Hacks
 
multiple input control by sms using GSM technology
multiple input control by sms using GSM technologymultiple input control by sms using GSM technology
multiple input control by sms using GSM technology
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IO
 
Home automation and Digital notice board using android app
Home automation and Digital notice board using android appHome automation and Digital notice board using android app
Home automation and Digital notice board using android app
 
Security alarm
Security alarmSecurity alarm
Security alarm
 
Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)
 

Similar to Home security system

IOT Based Soldier Position Tracking and Health Monitoring System
IOT Based Soldier Position Tracking and Health Monitoring SystemIOT Based Soldier Position Tracking and Health Monitoring System
IOT Based Soldier Position Tracking and Health Monitoring SystemIRJET Journal
 
SMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..ppt
SMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..pptSMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..ppt
SMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..pptabdulkareem104286
 
HOME AUTOMATION SYSTEM USING IOT TECHNOLOGY.pdf
HOME  AUTOMATION SYSTEM USING IOT  TECHNOLOGY.pdfHOME  AUTOMATION SYSTEM USING IOT  TECHNOLOGY.pdf
HOME AUTOMATION SYSTEM USING IOT TECHNOLOGY.pdfHarshithaNerella
 
IRJET- Centralised Status alert system for industrial machines
IRJET-  	  Centralised Status alert system for industrial machinesIRJET-  	  Centralised Status alert system for industrial machines
IRJET- Centralised Status alert system for industrial machinesIRJET Journal
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Editor IJARCET
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Editor IJARCET
 
Advanced Anti-Theft & Home Safety System using GSM
Advanced Anti-Theft & Home Safety System using GSMAdvanced Anti-Theft & Home Safety System using GSM
Advanced Anti-Theft & Home Safety System using GSMIRJET Journal
 
Integrated Security System With Remot Controlling Of Appliances
Integrated Security System With Remot Controlling Of AppliancesIntegrated Security System With Remot Controlling Of Appliances
Integrated Security System With Remot Controlling Of AppliancesIRJET Journal
 
RAMKESH MEENA TRAINING REPORT IHT.pdf
RAMKESH MEENA TRAINING REPORT IHT.pdfRAMKESH MEENA TRAINING REPORT IHT.pdf
RAMKESH MEENA TRAINING REPORT IHT.pdfYaarJani
 
Sonar Project Report
Sonar Project ReportSonar Project Report
Sonar Project ReportSumit Sapra
 
IRJET- Home Locker Surveillance without using CCTV Camera
IRJET- Home Locker Surveillance without using CCTV CameraIRJET- Home Locker Surveillance without using CCTV Camera
IRJET- Home Locker Surveillance without using CCTV CameraIRJET Journal
 
IRJET- Rescue of Psycological Infirmity People using Wirless Network
IRJET- Rescue of Psycological Infirmity People using Wirless NetworkIRJET- Rescue of Psycological Infirmity People using Wirless Network
IRJET- Rescue of Psycological Infirmity People using Wirless NetworkIRJET Journal
 
Ball following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNOBall following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNOIRJET Journal
 
IRJET- Power Theft Detection and Monitoring using GSM Technology
IRJET-  	  Power Theft Detection and Monitoring using GSM TechnologyIRJET-  	  Power Theft Detection and Monitoring using GSM Technology
IRJET- Power Theft Detection and Monitoring using GSM TechnologyIRJET Journal
 
Advanced View Arduino Projects List - Use Arduino for Projects (3).pdf
Advanced View Arduino Projects List - Use Arduino for Projects (3).pdfAdvanced View Arduino Projects List - Use Arduino for Projects (3).pdf
Advanced View Arduino Projects List - Use Arduino for Projects (3).pdfIsmailkhan77481
 
final project report_full edit
final project report_full editfinal project report_full edit
final project report_full editSayam Roy
 
Home Security System using ESP32-CAM and Telegram Application
Home Security System using ESP32-CAM and Telegram ApplicationHome Security System using ESP32-CAM and Telegram Application
Home Security System using ESP32-CAM and Telegram ApplicationIRJET Journal
 
DIGITAL LOGIC DESIGN (1) PROJECT REPORT.docx
DIGITAL LOGIC DESIGN (1) PROJECT REPORT.docxDIGITAL LOGIC DESIGN (1) PROJECT REPORT.docx
DIGITAL LOGIC DESIGN (1) PROJECT REPORT.docxRafayNaveed4
 

Similar to Home security system (20)

IOT Based Soldier Position Tracking and Health Monitoring System
IOT Based Soldier Position Tracking and Health Monitoring SystemIOT Based Soldier Position Tracking and Health Monitoring System
IOT Based Soldier Position Tracking and Health Monitoring System
 
SMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..ppt
SMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..pptSMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..ppt
SMART SECURITY SYSTEM TO PREVENT THEFT USING GSM ppt..ppt
 
HOME AUTOMATION SYSTEM USING IOT TECHNOLOGY.pdf
HOME  AUTOMATION SYSTEM USING IOT  TECHNOLOGY.pdfHOME  AUTOMATION SYSTEM USING IOT  TECHNOLOGY.pdf
HOME AUTOMATION SYSTEM USING IOT TECHNOLOGY.pdf
 
IRJET- Centralised Status alert system for industrial machines
IRJET-  	  Centralised Status alert system for industrial machinesIRJET-  	  Centralised Status alert system for industrial machines
IRJET- Centralised Status alert system for industrial machines
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397
 
Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397Ijarcet vol-2-issue-7-2389-2397
Ijarcet vol-2-issue-7-2389-2397
 
Advanced Anti-Theft & Home Safety System using GSM
Advanced Anti-Theft & Home Safety System using GSMAdvanced Anti-Theft & Home Safety System using GSM
Advanced Anti-Theft & Home Safety System using GSM
 
Integrated Security System With Remot Controlling Of Appliances
Integrated Security System With Remot Controlling Of AppliancesIntegrated Security System With Remot Controlling Of Appliances
Integrated Security System With Remot Controlling Of Appliances
 
RAMKESH MEENA TRAINING REPORT IHT.pdf
RAMKESH MEENA TRAINING REPORT IHT.pdfRAMKESH MEENA TRAINING REPORT IHT.pdf
RAMKESH MEENA TRAINING REPORT IHT.pdf
 
Sonar Project Report
Sonar Project ReportSonar Project Report
Sonar Project Report
 
IRJET- Home Locker Surveillance without using CCTV Camera
IRJET- Home Locker Surveillance without using CCTV CameraIRJET- Home Locker Surveillance without using CCTV Camera
IRJET- Home Locker Surveillance without using CCTV Camera
 
G3602050055
G3602050055G3602050055
G3602050055
 
IRJET- Rescue of Psycological Infirmity People using Wirless Network
IRJET- Rescue of Psycological Infirmity People using Wirless NetworkIRJET- Rescue of Psycological Infirmity People using Wirless Network
IRJET- Rescue of Psycological Infirmity People using Wirless Network
 
Ball following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNOBall following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNO
 
085 n008
085 n008085 n008
085 n008
 
IRJET- Power Theft Detection and Monitoring using GSM Technology
IRJET-  	  Power Theft Detection and Monitoring using GSM TechnologyIRJET-  	  Power Theft Detection and Monitoring using GSM Technology
IRJET- Power Theft Detection and Monitoring using GSM Technology
 
Advanced View Arduino Projects List - Use Arduino for Projects (3).pdf
Advanced View Arduino Projects List - Use Arduino for Projects (3).pdfAdvanced View Arduino Projects List - Use Arduino for Projects (3).pdf
Advanced View Arduino Projects List - Use Arduino for Projects (3).pdf
 
final project report_full edit
final project report_full editfinal project report_full edit
final project report_full edit
 
Home Security System using ESP32-CAM and Telegram Application
Home Security System using ESP32-CAM and Telegram ApplicationHome Security System using ESP32-CAM and Telegram Application
Home Security System using ESP32-CAM and Telegram Application
 
DIGITAL LOGIC DESIGN (1) PROJECT REPORT.docx
DIGITAL LOGIC DESIGN (1) PROJECT REPORT.docxDIGITAL LOGIC DESIGN (1) PROJECT REPORT.docx
DIGITAL LOGIC DESIGN (1) PROJECT REPORT.docx
 

Recently uploaded

Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 

Recently uploaded (20)

Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 

Home security system

  • 1. P a g e 1 | 92 ABSTRACT Home security system is needed for convenience and safety. This system invented to keep home safe from intruder. In this work, we present the design and implementation of a GSM & PIR sensor based home security system using ARDUINO-UNO board. Which take a very less power. The system is a arduino-uno based home security system which contains a GSM modem and PIR sensor with servo-motor and a camera which provides a better security. The system can response rapidly as intruder enters into the trigged zone, PIR sensor sense the object and GSM module will send a notification as a SMS to the registered number of the home owner, and can also give a snapshot of that object. This security system for alerting a house owner wherever he will. In this system as a object enters into the zone GSM module produce a signal through a public telecom network and sends a message or redirect a call that that tells about your home update or predefined message which is embedded in arduino-uno board. Suspected activities are conveyed to remote user through SMS or Call using GSM technology. KEYWORDS: GSM (Global System for Mobile Communications), ARDUINO-UNO, PIR, SMS.
  • 2. P a g e 2 | 92 INDEX Page No. CHAPTER (1) INTRODUCTION OF PROJECT…………….…...(8) 1.1Aim of project……………………………………………………………….....(8) 1.2 Outlines of project…………………………………………………….………(8) 1.3 Methodology……………………………………………………………...…..(9) CHAPTER (2) LITRETURE REVIEW………….…………….....(11) 2.1 Embedded system…………………………………………………………...(11) 2.1.1 Introduction…………………………………………………………………....…(11) 2.1.2 Major building blocks of embedded system………………………………………(13) 2.1.3 Example of embedded system…………………………………………………….(14) 2.1.4 Characteristics of embedded system……………………………………………...(15) 2.1.5 Comparison…………………………………………………………………….…(16) 2.1.6 Embedded system hardware ……………………………………………………...(16) 2.1.7 Typical architecture ………………………………………………………….......(18) 2.1.8 Element of embedded system design……………………………………....……..(19) 2.2 Arduino……………………………………………………………..........…(20) 2.2.1 Introduction………………………………………………………………........…(20) 2.2.2 Who created Arduino……………………………………………………………..(21) 2.2.3 Why Arduino…………………………………………………………………......(22) 2.2.4 Working in Arduino………………………………………………………………(23) CHAPTER (3) ARDUINO-UNO……………………………..........(27) 3.1 Overview……………………………………………………………..….….(27) 3.2 Pin diagram……………………………………………………………....…(28) 3.3 ATMega328……………………………………………………………...…(29) 3.3.1 Introduction………………………………………………………………...…...(29) 3.3.2 Features……………………………………………………………………....….(29) 3.3.3 Pin description…………………………………………………………………..(30)
  • 3. P a g e 3 | 92 3.3.4 Comparison among ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P…………………………………………………………………………...(33) 3.3.5 Internal Description……………………………………………………….…..….(33) 3.3.6 Communication…………………………………………………………….........(35) 3.3.7 Processor architecture…………………………………………………….….…...(36) 3.3.8 Pin description………………………………………………….……...................(40) 3.3.9 Things to remember about ATMEGA328 controllers…………………....………(40) CHAPTER (4) ARDUINO SOFTWARE……………………………...(41) 4.1 Arduino IDE……………………………………………………………..…..(41) 4.1.1 What is IDE? …………………………………………………….….....................(42) 4.2 Serial Communication…………………………………………………….....(42) CHAPTER (5) GSM TECHNOLOGY AND MODEM……...........(44) 5.1 Introduction………………………………………………………………….(44) 5.2 Cellular mobile system………………………………………....................…(45) 5.3 GSM technology……………………………………………………………..(46) 5.4 System architecture………………………………………………….………(48) 5.4.1 Mobile Station…………………………………………………………………....(48) 5.4.2 Base Station Subsystem……………………………………………………….….(48) 5.4.3 Base Transceiver Station…………………………………………….....................(48) 5.4.4 Base Station Controller…………………………………………………………...(48) 5.4.5 Trans-coder and Rate Adaptation Unit……………………………….…………...(49) 5.5 Network and switching sub system…………………………………….…….(49) 5.5.1 Mobile Service Switching Center………………………………………………...(50) 5.5.2 Inter Working Function, (IWF) …………………………………………………..(50) 5.5.3 Home Location Register, (HLR) …………………………………………………(50) 5.5.4 Visitor Location Register, (VLR) ……………………………………...................(50) 5.5.5 Gateway MSC (GMSC) …………………………………………...……………..(50) 5.5.6 Signaling Transfer Point………………………………………….........................(50) 5.6 More points…………………………………………………………………..(50) 5.6.1 Operating subsystem……………………………………………………………...(50)
  • 4. P a g e 4 | 92 5.6.2 Layer modeling…………………………………………………...……………...(51) 5.6.3 Radio link aspects……………………………………………...…………………(51) 5.6.4 Multiple access and channel structure……………………………….…………...(51) 5.6.5 Traffic channels………………………………………………. …………………(51) 5.6.6 Cell selection……………………………………………………………………..(51) CHAPTER (6) SERVO MOTOR………………………………….(53) 6.1 Introduction………………………………………………………………….(53) 6.2 Commercial application……………………………………………………..(54) 6.3 Types…………………………………………………………………...........(54) 6.4 Principle of operation………………………………………………………..(54) 6.5 Application…………………………………………………………………..(56) CHAPTER (7) PIR SENSOR………………………………………(57) 7.1 Introduction…………………………………………………………….……(57) 7.2 How it works………………………………………………. ……………….(58) 7.3 Technical data……………………………………………………. …….......(58) 7.4 Application……………………………………………………. ……………(59) CHAPTER (8) COMPONENTS…………………………………(60) 8.1 Capacitor…………………………………………………………………….(60) 8.1.1 Introduction………………………………………………………………………(60) 8.1.2 Actual Capacitance………………………………………………..……………...(60) 8.1.3 Breakdown voltage………………………………………………..……………...(61) 8.1.4 Types of Capacitors……………………………………………….……………...(61) 8.1.5 Variable Capacitors……………………………………………….……………...(62) 8.1.6 Methods of Making Capacitors…………………………………………………..(62) 8.2 LCD……………………………………………………………………….…(62) 8.2.1 Introduction………………………………………………………………………(62) 8.2.2 Pin description……………………………………………………………………(63) 8.2.3 Sequence of writing to the LCD………………………………………………….(63) 8.2.4 LCD interface diagram…………………………………………….……………..(64)
  • 5. P a g e 5 | 92 8.3 LED………………………………………………….………………………(65) 8.3.1 Introduction………………………………………………………………………(65) 8.3.2 Applications……………………………………………………...........................(66) 8.3.3 LED specifications……………………………………………..………………...(66) CHAPTER (9) ACCESSORIES…………………………………...(68) 9.1 Adapters………………………………………………………………..……(68) 9.2 Dip Bases……………………………………………………………………(68) 9.3 Power Jack…………………………………………………………..………(68) 9.4 Switches……………………………………………………………..………(68) 9.5 Connectors……………………………………………………………..……(70) 9.6 Berge Strip…………………………………………………………..………(70) 9.7 DC connectors…………………………………………………….…………(70) CHAPTER (10) SOURCE CODE…………………………………(71) CHAPTER (11) RESULTS AND DISCUSSIONS………...……...(89) 11.1 Results and Conclusions…………………………………………...………(89) 11.2 Uses and further scope………………………………………………..……(90) CHAPTER (12) REFERENCES…………………………...………(92)
  • 6. P a g e 6 | 92 LIST OF FIGURES Figure No. Description Page No. 2.1.1 Components of embedded system 12 2.1.3 Examples of embedded system 14 2.1.6(a) Embedded system hardware (in loop) 16 2.1.6(b) Circuit diagram of embedded system hardware 17 2.1.7 Typical architecture of embedded system 18 3.2 Pin diagram OF Arduino UNO 28 3.3.3(a) Pin description of ATmega 328 31 3.3.3(b) Pin diagram of ATmega328 32 3.3.7(a) Process architecture of microcontroller 37 3.3.7(b) Variation of input and output voltage of microcontroller 39 3.3.8 Pin diagram of ATmega 328 40 5.4.4(a) Block diagram of BSC 49 5.4.4(b) Block diagram of GSM technology 49 6.1 Block diagram of servo motor 53 6.4(a) Principle of operation of servo motor 55 6.4(b) Principle of operation sending of high pulse at every 20 ms 55 7.1(a) PIR sensor 57 7.1(b) Pcb of PIR sensor 57 7.2 Working of PIR sensor 58 8.2.4 LCD interfacing diagram 65 8.3.1(a) Schematics diagram of LED 66 8.3.1(b) LED 66 11.1 GOOGLE trends comparing ARDUINO with its biggest competitors 89
  • 7. P a g e 7 | 92 LIST OF IMAGES Image No. Description Page No. 2.2.1 Picture of Arduino board 20 2.2.3(a) Working step1 23 2.2.3(b) Working step2 24 2.2.3(c) Showing the basic syntax of the programm 46 4.2 Transmission and reception of Arduino board 43 6.1 Block diagram of BSC 53 8.1.4(a) Picture of polarize capacitors 61 8.1.4(b) Picture of un-polarize capacitors 62 8.1.5 Picture of variable capacitors 62 8.3.1 Picture of LED 65 8.3.3 Identification of LED terminals 67 LIST OF TABLE Table No. Description Page No. 2.1.5 Comparison between embedded system and general purpose computing 16 3.3.4 Memory summary of different ATmega microcontroller 33 3.3.6 Arduino specification 36 5.2 Cellular mobile system 45 8.2.2 Pin description of 16x2 LCD display 63 8.3.3 Specification of LED 66
  • 8. P a g e 8 | 92 CHAPTER (1) INTRODUCTION OF PROJECT 1.1 Aim of Project From last few year home security is an essential requirement of households to keep home safe from intruders to get rob. So the researchers and companies tries to implement an algorithms and make some gradates that keep your home safe from intruders. This leads to advance technology that make your home intelligent or modern this called as home automation & security system also. With this technology house owner can control other appliances as well like lighting system, dimming, electrical appliances and many more. Now a day's wireless technology is used to control home appliances instead of wired topological connection. GSM (Global System for Mobile Communication) technology makes used to communicate input signal from appliances to output message on device. That means after detection of any intrusion GSM Modem sends the appropriate message to house owner's phone. The signals or data which is comes from sensors or other equipment digitize it by GSM module and send it to receiver. So that better security is provided by the user. Home automation or home security system offers many benefits. After so many research I gave a mainly focused on GSM based home security. It is very easy to install and having a very less cost. Basically it installed over the entry that front door where a matrix keypad and 16x2 LCD display is installed which is connected to the arduino-uno board and the coding is done in such manner so that “ENTER PASSWORD” is display on the LCD screen we enters the password to activate the system, once the system is activated the PIR sensor sense the objects and the camera which is mounted on the servo-motor, moves to the location of the object, signals will generate via PIR sensor and sends it to ATMEGA 328microcontroller of the arduino-uno board and action takes place according to piece of code written in the chip and GSM module sends the message to owner's phone. There has been much research done on various type of home security systems like Sensor based Home security System, Figure print, Palm print and keypad activation for authentication and so much. All type of Security system uses only a technique of GSM module. In this project the work mainly focuses on the security of home when the user is out from the place. GSM based technology proposed to keep updated owner about house security. In this security system is SMS based and uses GSM technology to send SMS to the owner. Normally the aim of this type of system is to keep secure home from intruders. To increase the performances of a smart automated house, lots of research is going on. For an example; The Aware Home Research Initiative (AHRI) at Georgia Institute of Technology is an interdisciplinary research endeavor aimed at addressing the fundamental technical, design, and social challenges for people in a home setting. 1.2 Outlines of Report
  • 9. P a g e 9 | 92 This report contains a detailed information about all the components used in this project. The components used are: Arduino-uno PIR sensor GSM module Servo-motor LCD LED Keypad interfacing A detailed report about each and every component is described in separate chapter. Chapter 2 contains information about Embedded System & Arduino board. Chapter 3 contains information about Arduino-uno. Chapter 4 contains information about Arduino software. Chapter 5 contains information about GSM technology and MODEM Chapter 6 contains information about Servo motor Chapter 7 contains information about PIR sensor Chapter 8 contains information about all the components Chapter 9 contains information about Accessories used in the project Chapter 10 contains Source code Chapter 11 contains Result and descriptions Chapter 12 contains Reference 1.3 Methodologies The idea of this project is to give information about the perpetrator to the victim of stolen car, confidential data from any organization, presence of unauthorized person in the home etc. So we have chosen GSM technology to give the information by sending SMS.
  • 10. P a g e 10 | 92 Sending SMS alone can’t help to the victim, if we send and an SMS with the snapshot of the perpetrator or able to take a video of that incident. So we include a camera which is mounted on the servo-motor which provides motion covered to the trigged zone when the incident has occurred. To run the CAMERA/WEBCAM and GSM module we use Arduino UNO board which has ATmega328 microcontroller. The Arduino is a very user friendly device which can be easily interfaced with any sensors or modules and is very compact in size. Also we can make RFID card detector using Arduino-uno using which one can make detect his own RFID card if available like if one wants to check balance in metro card, attendance record in office, and many more. Finally we can sense the room temperature and distance of any object. One can also glow LED’s in some beautiful dancing patterns and display them on LCD.
  • 11. P a g e 11 | 92 CHAPTER (2) LITERATURE REVIEW A literature review is collection of a critical, unbiased, and comprehensive evaluation of published information in a chosen and specific area of study of interest. It gives a general understanding of findings of the research work, conclusions, and recommendations and thereby brings out their strengths and weaknesses. This helps in identifying gaps, scope for further work and generalized concepts in the existing body of knowledge. 2.1 Embedded System 2.1.1 Introduction Embedded system are components integrating software and hardware jointly and specifically designed to provide given functionalities. A combination of computer hardware and software, and perhaps additional mechanical or other parts, designed to perform a dedicated function. In some cases, embedded system are part of a larger system or product, as in the cases of an antilock braking system in a car. Such equipment is electrical or battery powered. The chip controls one or more functions of the equipment, such as remembering how long it has-been since the device last received maintenance. An Embedded System is a special-purpose computer system designed to perform one or a few dedicated functions, often with real- time computing constraints. “An embedded system is an application that contains at least one programmable computer (typically in the form of a microcontroller, a microprocessor or digital signal processor chip) and which is used by individuals who are, in the main, unaware that the system is computer-based.” Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks. Some also have real time performance constraints that must be met, for reason such as safety and usability; others may have low or no performance requirements, allowing the system hardware to be simplified to reduce costs. An embedded system is not always a separate block - very often it is physically built-in to the device it is controlling. The software written for embedded systems is often called firmware, and is stored in read-only memory or flash convector chips rather than a disk drive. It often runs with limited computer hardware resources: small or no keyboard, screen, and little memory. An embedded system is some combination of hardware and software, either fixed in capability or programmable, that is specifically designed for a particular function. Industrial machines, automobiles, medical equipment, cameras, household appliances, airplanes, vending machines and toys (as well as the more obvious cellular phone and PDA) are among the myriad possible hosts of an embedded system. In embedded systems, software commonly known as firmware is hidden inside the same hardware rather than in some other hardware. Basically embedded systems are
  • 12. P a g e 12 | 92 task specific devices. One of its most important characteristic is gives the output within the time constraints or you can say they are time bound systems. Figure no-2.1.1Components of embedded system These embedded systems help to make the work more convenient and accurate. So, we often use these embedded systems in simple and complicated devices too. We use these embedded systems in our real life for many devices and applications such as Calculators, microwave, television remote control, home security and neighborhood traffic control systems, etc. Modern embedded systems are often based on microcontrollers (i.e. CPUs with integrated memory or peripheral interfaces) but ordinary microprocessors (using external chips for memory and peripheral interface circuits) are also still common, especially in more complex systems. In either case, the processor(s) used may be types ranging from general purpose to those specialized in certain class of computations or even custom designed for the application at hand. A common standard class of dedicated processors is the digital signal processor (DSP). Since the embedded system is dedicated to specific tasks, design engineers can optimize it to reduce the size and cost of the product and increase the reliability and performance. Some embedded systems are mass-produced, benefiting from economies of scale.
  • 13. P a g e 13 | 92 Embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, and largely complex systems like hybrid vehicles, MRI, and avionics. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large or enclosure. 2.1.2 Major building blocks of embedded system The major building blocks of an embedded system are listed below:  Microcontrollers / digital signal processors (DSP)  Integrated chips  Real time operating system (RTOS) - including board support package and device drivers  Industry-specific protocols and interfaces  Printed circuit board assembly Usually, an embedded system requires mechanical assembly to accommodate all the above components and create a product or a complete embedded device. A controller is used to control some process. At one time, controllers were built exclusively from logic components, and were usually large, heavy boxes. Later on, microprocessors were used and the entire controller could fit on a small circuit board. Real time system: A system where correctness depends not only on the correctness of the logical result of the computation, but also on the result delivery time. It responds in a timely, predictable way to unpredictable external stimuli arrivals. The real Time Systems can be further divided into two types:  Soft Real-Time System: Compute output response as fast as possible, but no specific deadlines that must be met.  Hard Real-Time System: Output response must be computed by specified deadline or system.
  • 14. P a g e 14 | 92 2.1.3 Example of embedded system Figure no- 2.1.3 examples of embedded system
  • 15. P a g e 15 | 92 2.1.4 Characteristics of embedded system  Must be dependable:  Reliability (t) = probability of system working correctly provided that is was working at t=0  Maintainability (d) = probability of system working correctly d time units after error occurred.  Availability: probability of system working at time t  Safety: no harm to be caused  Security: confidential and authentic communication Even perfectly designed systems can fail if the assumptions about the workload and possible errors turn out to be wrong. Making the system dependable must not be an after-thought, it must be considered from the very beginning. 1. Must be Efficient a) Energy efficient. b) Code-size efficient (especially for systems on a chip) c) Run-time efficient d) Weight efficient 2. Dedicated user interface & Dedicated towards a certain application: Knowledge about behavior at design time can be used to minimize resources and to maximize robustness. 3. Many ES must meet real-time constraints: a) A real-time system must react to stimuli from the controlled object (or the operator) within the time interval dictated by the environment. b) For real-time systems, right answers arriving too late (or even too early) are wrong. 4. Frequently connected to physical environment through sensors and actuators 5. Hybrid systems (analog + digital parts). 6. Typically, ES are reactive systems: A reactive system is one which is in continual interaction with is environment and executes at a pace determined by that environment“
  • 16. P a g e 16 | 92 2.1.5 Comparison Table no-2.1.5 comparison between embedded system and general purpose computing 2.1.6 Embedded system hardware Figure no- 2.1.6(a) embedded system hardware (in loop) We learnt that the hardware elements: a) Processor and b) Basic circuit elements: power source, clock, reset, timers, memory, glue circuit for the elements linking and interfaces. c) Keypad, LCD display matrix or touch screen Embedded Systems General Purpose Computing Few applications that are known at design-time. Broad class of applications. Not programmable by end user Programmable by end user. Fixed run-time requirement (additional computing power not useful). Faster is better. Criteria: 1. Cost 2. Power consumption 3. Predictability Criteria: 1. Cost 2. Average speed
  • 17. P a g e 17 | 92 d) IO communication elements: buses (serial and parallel), interfaces for network interface, ADC, DAC, pulse dialer, modem, Bluetooth, 802.11, as per the application e) Interrupt handler Embedded system hardware basically consists of three main elements:  Input System: Input system is the basically used to interact with external environment or type of input the user want to give. There can be various type of the input system depending upon the user or system need. Some of the examples are sensor interfaces (IR, LDR etc.), UART interface (for communication with PC), Wireless interfaces for various type of wireless communication etc. These interfaces have also a good circuit design and should be properly designed so that it can easily interact with the next unit.  Processing Unit: The next unit is the processing unit that consist either analog circuit to process the input or to make the system perform good and user dependant (as per program) uses the microcontroller interface circuit. The main function of this unit is to take the input, process it and generate the desired output as per the program (done by user) to control the output unit.  Output unit: The output unit consists of the circuit interface to generate and control the desired output. For example the relay driving unit, motor driver unit, alarm systems, Display units etc. Figure no- 2.1.6(b) circuit diagram of embedded system hardware
  • 18. P a g e 18 | 92 2.1.7 Typical Architecture of embedded system Figure no-2.1.7 typical architecture of embedded system
  • 19. P a g e 19 | 92 2.1.8 Element of embedded system design The design of embedded system includes three things: 1. Hardware: Embedded system hardware basically consists of three main elements:  Input System: Input system is the basically used to interact with external environment or type of input the user want to give. There can be various type of the input system depending upon the user or system need. Some of the examples are sensor interfaces (IR, LDR etc.), UART interface (for communication with PC), Wireless interfaces for various type of wireless communication etc. These interfaces have also a good circuit design and should be properly designed so that it can easily interact with the next unit.  Processing Unit: The next unit is the processing unit that consist either analog circuit to process the input or to make the system perform good and user dependent (as per program) uses the microcontroller interface circuit.  Output unit: The output unit consists of the circuit interface to generate and control the desired output. For example the relay driving unit, motor driver unit, alarm systems, Display units etc. 2. Embedded Software (Compilers): Embedded software is computer software that plays an integral role in the electronics it is supplied with. Embedded software's principal role is not information technology (i.e. it is not about information and the technologies related to providing information services), but rather the interaction with the physical world. It's written for machines that are not, first and foremost, computers. Manufacturers 'build in' embedded software in the electronics in cars, telephones, audio equipment, robots, appliances, toys, security systems, pacemakers, televisions and digital watches, for example. This software can become very sophisticated in applications such as airplanes, missiles, and process control systems. Varying hardware requires different embedded system depending upon the architecture. Linker Program (software): In computer science, a linker or link editor is a program that takes one or more objects generated by a compiler and combines them into a single executable program (hex code). These are inter-linked with the compilers 3. These are the Flash program that is capable of reading from the controllers writing to the hardware controllers to the HEX code.
  • 20. P a g e 20 | 92 2.2 Arduino 2.2.1 Introduction Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. Image no-2.2.1 picture of Arduino board Arduino can be used to develop interactive objects, taking inputs from a variety of switches or sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects can be stand-alone, or they can be communicating with software running on your computer (e.g. Flash, Processing, MAX-MSP.) The boards can be assembled by hand or purchased preassembled; the open-source IDE can be downloaded for free. The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment. Arduino is a popular open-source single-board microcontroller, descendant of the open-source Wiring platform designed to make the process of using electronics in multidisciplinary projects more accessible. The hardware consists of a simple open hardware design for the Arduino board with an Atmel AVR processor and on-board input/output support. The software consists of a standard programming language compiler and the boot loader that runs on the board. Arduino hardware is programmed using a Wiring-based language (syntax and libraries), similar to C++ with some slight simplifications and modifications, and a Processing-based integrated development environment. Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended for anyone making interactive projects. Arduino can take the
  • 21. P a g e 21 | 92 input from many sensors attached to it & can give the output to many lights, motors etc. There is no prerequisite knowledge of Advance electronics for operating Arduino. All you should know is basic electronics and C programming language. Arduino platform mainly contains a Hardware Board called Arduino Board & software Arduino IDE to program it. Other external hardware like Sensor Modules, Motors, lights etc. could be attached with the board. ARDUINO BOARDS:- Arduino UNO. Arduino MEGA. Arduino MINI. Arduino DUE. Arduino YUN. Arduino Lily pad. The most common Board used is Arduino UNO. “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. 2.2.2 Who created Arduino? Author Steve Heath There are many definitions for this but the best way to define it is to describe it in terms of what it is not and with examples of how it is used. An embedded system is a microprocessor-based system that is built to control a function or range of functions and is not designed to be programmed by the end user in the same way that a PC is. Yes, a user can make choices concerning functionality but cannot change the functionality of the system by adding/replacing software. With a PC, this is exactly what a user can do: one minute the PC is a word processor and the next it’s a games machine simply by changing the software. An embedded system is designed to perform one particular task albeit with choices and different options. The last point is important because it differentiates itself from the world of the PC where the end user does reprogram it whenever a different software package is bought and run. However, PCs have provided an easily accessible source of hardware and software for embedded systems and it should be no surprise that they form the basis of many embedded systems. To reflect this, a very detailed design example is included at the end of this book that uses a PC in this way to build a sophisticated data logging system for
  • 22. P a g e 22 | 92 a race car. If this need to control the physical world is so great, what is so special about embedded systems that has led to the widespread use of microprocessors? There are several major reasons and these have increased over the years as the technology has progressed and developed. Replacement for discrete logic-based circuits. The microprocessor came about almost by accident. Arduino started in 2005 as a project for students at the Interaction Design Institute Ivrea in Ivrea, Italy. At that time program students used a "BASIC Stamp" at a cost of $100, considered expensive for students. Massimo Banzi, one of the founders, taught at Ivrea. The name "Arduino" comes from a bar in Ivrea, where some of the founders of the project used to meet. The bar, in turn, has been named after Arduin of Ivrea, who was the margrave of Ivrea and king of Italy from 1002 to 1014. Colombian student Hernando Barragan created the Wiring development platform which served as the basis for Arduino. Following the completion of the Wiring platform, its lighter, less expensive versions were created and made available to the open-source community; associated researchers, including David Cuartielles, promoted the idea. The Arduino's initial core team consisted of Massimo Banzi, David Cuartielles, Tom Igoe, Gianluca Martino, and David Mellis. 2.2.3 Why Arduino? There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax Basic Stamp, and many others offer similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems: Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than $50 Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows. Simple, clear programming environment - The Arduino programming environment is easy-to- use for beginners, yet flexible enough for advanced users to take advantage of as well. For teachers, it's conveniently based on the Processing programming environment, so students learning to program in that environment will be familiar with the look and feel of Arduino Open source and extensible software- The Arduino software and is published as open source tools, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from
  • 23. P a g e 23 | 92 Arduino to the AVR C programming language on which it's based. Similarly, you can add AVR- C code directly into your Arduino programs if you want to. Open source and extensible hardware - The Arduino is based on Atmel's ATMEGA8 and ATMEGA168microcontrollers. The plans for the modules are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the breadboard version of the module in order to understand how it works and save money. 2.2.4 Working in Arduino The Arduino development environment 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. Software written using Arduino is called sketches. It 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 environment including complete error messages and other information. Now let us install the Arduino into our system and start working with it. Follow the following steps to install the Arduino in your computer/laptop: Step1. Install the FTDI driver provided in the CD given to you. To install it simply, unzip the FTDI file and install the driver. It may take from few seconds to even minutes to install depending on the computer and operating systems. Image no-2.2.3(a) working step1
  • 24. P a g e 24 | 92 Step2. Open the “Arduino-022” folder and click on the Arduino icon. A window will appear as shown here. Image no-2.2.3(b) working step2 Step3. Click on Tools from menu bar and select the board, and then select the board as “Arduino NG or older / ATMEGA 168”. Note: Please note that this option can be changed depending on the hardware used by the user. This is just an example of the board which is based on Arduino NG based on ATMEGA 168; hence we have selected this option. Step4. Connect the device with the computer using USB cable. Now we have to select the serial port on which the board will communicate with the computer. Go to Tools->Serial Port->COM X. Here the ‘x, varies from computer to computer. See the image. Note: It is very confusing to select the proper com port. We can check it by inserting and removing the USB cable, the new com generated by inserting the cable should be selected. Although, the Arduino selects the com port automatically, but sometimes we have to select the ports manually. The proper board has to be selected manually only. The code which goes inside the microcontroller is known as ‘HEX’ code. This code is generated by compilers.
  • 25. P a g e 25 | 92 The process of loading the code into the (flash memory of) microcontrollers is known as ‘Burning’ the microcontroller. There are several methods of burning microcontroller like using ‘ISP’ method, using ‘High Voltage Programming’ using ‘Boot-loaders’ etc. Each method has its own merits and demerits. The easiest way of programming is by using ‘Boot-loaders’. Boot-loaders are small programs residing inside the flash of the microcontrollers. For example in our system, the Boot-loader is there to program the device using serial port (UART). To program using UART interface make sure the device is Boot loaded. The Arduino works on UART interfaced programming. Let us explain more about environment of Arduino. There is a menu bar on the top of the window. All the lists in here are self-explanatory. We will seldom use these lists. Below menu bar, there is a tool bar frequently used in the environment. The icons of tool bar are explained here. Verify: It is used to verify the code, if there is any syntax error then it gets highlighted. If there is no error, then compilation is done. Stop: It is used to stop the verification at any time. New: Used to create a new workspace, but current workspace will be closed. Open: It is used to save any saved sketch. Save: Use to save the current sketch. Upload: Used to upload the sketch into the microcontroller. Any error, warning or notification can be shown in dark black window of the IDE. The development board provided contains all these connections. Hence we never need to make any such connections unless otherwise stated. For each program described further may have different circuit. The circuits are shown if necessary. Now let us start programming. Open the Arduino environment; select the proper com port and board as described earlier. Now, try to compile this code given in figure, it will produce no error. Because it is complete. There are two functions here: 1. void setup() 2. void loop() Before discussing about these, let us know what the ‘function’ is. Function is nothing but a group of statements under a single name.
  • 26. P a g e 26 | 92 Image no-2.2.3(c) showing the basic syntax of the programm All these statements are assumed to be executed at once. All the functions start with an opening parentheses (‘{‘) and terminates closing parentheses (‘}’). With and More discussion about ‘function’ is described later in the tutorial. All the lines written under void setup () function will execute only once as the program starts. Hence everything written under this function will execute only once. All the programs written under void loop () function will keep on executing as long as the system is kept on as this function keeps on executing continuously.
  • 27. P a g e 27 | 92 CHAPTER (3) ARDUINO UNO 3.1 Overview Arduino is an open-source computer hardware and software company, project and user community that designs and manufactures microcontroller-based kits for building digital devices and interactive objects that can sense and control the physical world. The project is based on a family of microcontroller board designs manufactured primarily by Smart Projects in Italy, and also by several other vendors, using various 8- bit Atmel AVR microcontrollers or 32-bit Atmel ARM processors. 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 platform provides an integrated development environment (IDE) based on the Processing project, which includes support for C, C++ and Java 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. Adafruit Industries estimated in mid-2011 that over 300,000 official Arduinos had been commercially produced, and in 2013 that 700,000 official boards were in users' hands. The Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. You can tinker with your UNO without worrying too much about doing something wrong, worst case scenario you can replace the chip for a few dollars and start over again. "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
  • 28. P a g e 28 | 92 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; for an extensive list of current, past or outdated boards see the Arduino index of boards. 3.2 Pin Diagram Figure no-3.2 pin diagram of Arduino UNO Arduino/Genuino Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. You can tinker with your UNO without worrying too much about doing something wrong, worst case scenario you can replace the chip for a few dollars and start over again.
  • 29. P a g e 29 | 92 3.3 ATmega328 3.3.1 Introduction The computer on one hand is designed to perform all the general purpose tasks on a single machine like you can use a computer to run a software to perform calculations or you can use a computer to store some multimedia file or to access internet through the browser, whereas the microcontrollers are meant to perform only the specific tasks, for e.g., switching the AC off automatically when room temperature drops to a certain defined limit and again turning it ON when temperature rises above the defined limit. There are number of popular families of microcontrollers which are used in different applications as per their capability and feasibility to perform the desired task, most common of these are 8051, AVR and PIC microcontrollers. In this we will introduce you with AVR family of microcontrollers. History of AVR AVR was developed in the year 1996 by Atmel Corporation. The architecture of AVR was developed by Alf-Egil Bogen and Vegard Wollan. AVR derives its name from its developers and stands for Alf-Egil Bogen Vegard Wollan RISC microcontroller, also known as Advanced Virtual RISC. AVR microcontrollers are available in three categories:  Tiny AVR – Less memory, small size, suitable only for simpler applications  Mega AVR – These are the most popular ones having good amount of memory (up-to 256 KB), higher number of in-built peripherals and suitable for moderate to complex applications.  Xmega AVR – Used commercially for complex applications, which require large program memory and high speed? 3.3.2 Features  RISC Architecture with CISC Instruction set  Powerful C and assembly programming
  • 30. P a g e 30 | 92  Scalable  Same powerful AVR microcontroller core  Low power consumption  Both digital and analog input and output interfaces 3.3.3 Pin description The Atmel ATmega48/88/328 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega48/88/328 achieves throughputs approaching 1 MIPS per MHz allowing the system designed to optimize power consumption versus processing speed. The Atmel ATmega48/88/328 provides the following features: 4K/8K/16K bytes of In-System Programmable Flash with Read-While-Write capabilities, 256/512/512 bytes EEPROM, 512/1K/1K bytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10- bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low power consumption. The ATmega48, ATmega88 and ATmega328 differ only in memory sizes, boot loader support, and interrupt vector sizes. Table 2-1 summarizes the different memory and interrupts vector sizes for the three devices. ATmega88 and ATmega328 support a real Read-While-Write Self-Programming mechanism. There is a separate Boot Loader Section, and the SPM instruction can only execute from there. In
  • 31. P a g e 31 | 92 ATmega48, there is no Read-While-Write support and no separate Boot Loader Section. The SPM instruction can execute from the entire Flash. Figure no-3.3.3(a) pin description of ATmega 328 The ATmega48PA/88PA/168PA/328P is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture (RISC, or Reduced Instruction Set Computer. is a type of microprocessor architecture that utilizes a small, highly-optimized set of instructions). By executing powerful instructions in a single clock cycle, the ATmega48PA/88PA/168PA/328P achieves throughputs approaching 1 MIPS per MHz allowing the system designed to optimize power consumption versus processing speed. The AVR (Advanced Virtual RISC) core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
  • 32. P a g e 32 | 92 allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The ATmega48PA/88PA/168PA/328P provides the following features: 4/8/16/32K bytes of In System Programmable Flash with Read-While- Write capabilities, 256/512/512/1K bytes EEPROM, 512/1K/1K/2K bytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC , a programmable Watchdog Timer with internal Oscillator, and five software selectable power saving modes. Figure no-3.3.3(b) pin diagram of ATmega328 The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the
  • 33. P a g e 33 | 92 crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low power consumption. The device is manufactured using Atmel’s high density non-volatile memory technology. The On- chip ISP Flash allows the program memory to be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip Boot program running on the AVR core. The Boot program can use any interface to download the application program in the Application Flash memory. 3.3.4 Comparison among ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P The ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P differ only in memory sizes, boot loader support, and interrupt vector sizes. Table summarizes the different memory and interrupt vector sizes for the three devices. Table: memory summary DEVICE FLASH EEPROM RAM INTERRUPT SIZE ATmega48PA 4K Bytes 256 Bytes 512 Bytes 1 instruction word/vector ATmega88PA 8K Bytes 512 Bytes 1K Bytes 1 instruction word/vector ATmega168PA 16K Bytes 512 Bytes 1K Bytes 2 instruction word/vector ATmega328P 32K Bytes 1K Bytes 2K Bytes 2 instruction word/vector Table no-3.3.4 memory summary of different ATmega microcontroller 3.3.5 Internal Description Power The Arduino/Genuino Uno board can be powered via the USB connection or with an external power supply. The power source is selected automatically. External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in
  • 34. P a g e 34 | 92 the GND and Vin pin headers of the POWER connector. The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts. The power pins are as follows:  Vin. The input voltage to the Arduino/Genuino 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 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.  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/Genuino 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. Memory The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library). Input and Output Each of the 14 digital 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.
  • 35. P a g e 35 | 92 In addition, some pins have specialized functions:  Serial: 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: 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.  SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.  LED: 13. 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.  TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.  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 analogReference() function.  There are a couple of other pins on the board:  AREF. Reference voltage for the analog inputs. Used with analogReference().  Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board. 3.3.6 Communication 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.
  • 36. P a g e 36 | 92 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). Table: Arduino Specifications Microcontroller ATmega328P Operating Voltage 5V Input Voltage (recommended) 7-12 V Input Voltage (limit) 6-20 V Digital I/O Pins 14 (of which 6 provide PWM Output) PWM Digital I/O Pins 6 Analog Input Pins 6 DC Current per I/O pin 20 mA DC Current for 3.3V Pin 50 mA Flash Memory 32 KB (ATmega 328P) of which 0.5 KB used by bootloader SRAM 2 KB (ATmega 328P) EEPROM 1 KB (ATmega328P) Clock Speed 16 MHz Length 68.6 mm Width 53.4 mm Weight 25 g Table no-3.3.6 Arduino specification 3.3.7 Processor architecture AVR follows Harvard Architecture format in which the processor is equipped with separate memories and buses for Program and the Data information. Here while an instruction is being executed, the next instruction is pre-fetched from the program memory.
  • 37. P a g e 37 | 92 Figure no-3.3.7(a) process architecture of microcontroller ALU: The high-performance AVR ALU operates in direct connection with all the 32 general purpose working registers. Within a single clock cycle, arithmetic operations between general purpose registers or between a register and an immediate are executed. The ALU operations are divided into three main categories – arithmetic, logical, and bit-functions. Some implementations of the architecture also provide a powerful multiplier supporting both signed/unsigned multiplication and fractional format. In-system reprogrammable flash program memory: The ATmega48/88/328 contains 4K/8K/16K bytes On-chip In-System Reprogrammable Flash memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the Flash is organized as 2K/4K/8K × 16. For software security, the Flash Program memory space is divided into two sections, Boot Loader Section and Application Program Section in ATmega88 and ATmega328. EEPROM data memory: The Atmel ATmega48 /88/328 contains 256/512/512 bytes of data EEPROM memory. It is organized as a separate data space e, in which single bytes can be read and written. The EEPROM has an endurance of at least 100,000 write/erase cycles. The access
  • 38. P a g e 38 | 92 between the EEPROM and the CPU is described in the following, specifying the EEPROM Address Registers, the EEPROM Data Register, and the EEPROM Control Register. Program counter: A program counter is a register in a computer processor that contains the address (location) of the instruction being executed at the current time. As each instruction gets fetched, the program counter increases its stored value by 1. After each instruction is fetched, the program counter points to the next instruction in the sequence. When the computer restarts or is reset, the program counter normally reverts to 0. In computing, a program is a specific set of ordered operations for a computer to perform. An instruction is an order given to a computer processor by a program. Within a computer, an address is a specific location in memory or storage. A register is one of a small set of data holding places that the processor uses. Program counter is very important feature in the microcontrollers. RAM: RAM stands for random access memory. This type of memory storage is temporary and volatile. You might have heard that if your system is working slowly you say that increase the RAM processing will increase. Let us understand in detail. Let us consider two cases to execute a task first the complete task is execute at one place(A), second the task is distributed in parts and the small tasks are executed at different places(A,B C)and finally assembled. It is clear the work will be finished in second case earlier. The A, B, C basically represent different address allocation for temporary processing. This is the case with RAM also if you increase the RAM the address basically increases for temporary processing so that no data has to wait for its turn. On major importance of the RAM is address allocations. However the storage is temporary every time u boot your system the data is lost but when you turn on the system The BIOS fetch number of addresses available in the RAM. This memory supports read as well as write operations both. Instruction execution section (IES). It has the most important unit—instruction register and instruction decoder to control the flow of the instruction during the processing’s. INPUT/OUTPUT Ports: To interact with the physical environment there are different input and output ports in every system like in PC we have VGA port to connect the monitor, USB port for flash memory connections and many more ports. Similarly ATMEGA 328 has its input and output ports with different configurations depending on the architecture like only input, only output and bi-directional input output ports. The accessing of this port is referred as input output interface design for microcontrollers. IT has analog input port, analog output port, digital input port ,digital output port, serial communication pins, timer execution pins etc. Analog Comparator & A/D converters: The major question is that how a controller manage to detect variation of voltage in-spite it could not understand the voltage but understand only digital sequence Most of the physical quantities around us are continuous. By continuous we mean that the quantity can take any value between two extreme. For example the atmospheric temperature can take any value (within certain range). If an electrical quantity is made to vary directly in proportion to this
  • 39. P a g e 39 | 92 value (temperature etc) then what we have is Analogue signal. Now we have we have brought a physical quantity into electrical domain. The electrical quantity in most case is voltage. To bring this quantity into digital domain we have to convert this into digital form. For this a ADC or analog to digital converter is needed. Most modern MCU including AVRs has an ADC on chip. An ADC converts an input voltage into a number. An ADC has a resolution. A 10 Bit ADC has a range of 0-1023. (2^10=1024) The ADC also has a Reference voltage (ARef). When input voltage is GND the output is 0 and when input voltage is equal to ARef the output is 1023. So the input range is 0-ARef and digital output is 0- 1023. Figure no-3.3.7(b) variation of input and output voltage of microcontroller Inbuilt ADC of AVR Now you know the basics of ADC let us see how we can use the inbuilt ADC of AVR MCU. The ADC is multiplexed with PORTA that means the ADC channels are shared with PORTA. The ADC can be operated in single conversion and free running more. In single conversion mode the ADC does the conversion and then stop. While in free it is continuously converting. It does a conversion and then start next conversion immediately after that. ADC Pre-scalar The ADC needs a clock pulse to do its conversion. This clock generated by system clock by dividing it to get smaller frequency. As the system frequency can be set to any value by the user (using internal or externals oscillators) (In board™ a 16MHz crystal is used). So the Pre-scalar is provided to produces acceptable frequency for ADC from any system clock frequency. System clock can be divided by 2, 4,16,32,64,128 by setting the Pre-scalar. ADC Channels The ADC in ATmega328 has 6 channels that mean you can take samples from eight different terminals. You can connect up to 8 different sensors and get their values separately.
  • 40. P a g e 40 | 92 3.3.8 Pin description Figure no-3.3.8 pin diagram of ATmega 328 3.3.9 Things to remember about ATMEGA328 controllers The ATMEGA controllers are strong controllers but you have to take some small points in mind always like:  When you go for the programming of atmega328 consider the pin no. as configures in red color in Pin diagram shown before (like controllers pin number 2 is digital pin number 0 for input or output ,pin23 is analog pin A0 ). Sao you will address the pin according to that number.  Use the proper pin for proper input output interface that analog input should be configured at analog pin analog output should be configured on PWM pins and likewise the digital inputs and outputs.
  • 41. P a g e 41 | 92 CHAPTER (4) ARDUINO SOFTWARE 4.1 Arduino IDE The Arduino IDE is a cross-platform application written in Java, and is derived from the IDE for the Processing programming language 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 as syntax highlighting, brace matching, and automatic indentation, and is also capable of compiling and uploading programs to the board with a single click. Although building on command-line is possible if required with some third-party tools such as Ino. The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same name), which makes many common input/output operations much easier. Arduino programs are written in C/C++, although users only need define two functions to make a run-able program: setup () – a function run once at the start of a program that can initialize settings loop() – a function called repeatedly until the board powers off A typical first program for a microcontroller simply blinks an LED on and off. #define LED_PIN 13 void setup () { pinMode (LED_PIN, OUTPUT); // enable pin 13 for digital output } void loop () { digitalWrite (LED_PIN, HIGH); // turn on the LED delay (1000); // wait one second (1000 milliseconds) digitalWrite (LED_PIN, LOW); // turn off the LED delay (1000); // wait one second }
  • 42. P a g e 42 | 92 4.1.1 What is IDE? • The Arduino integrated development environment (IDE) is a cross-platform application written in Java, and derives from the IDE for the Processing programming language and the Wiring projects. • It is designed to introduce programming to artists and other newcomers unfamiliar with software development. • It includes a code editor with features such as syntax highlighting, brace matching, and automatic indentation, and is also capable of compiling and uploading programs to the board with a single click. A program or code written for Arduino is called a "sketch • Arduino programs are written in C or C++. The Arduino IDE comes with a software library called "Wiring" from the original Wiring project, which makes many common input/output operations much easier. • The source code for the IDE is available and released under the GNU General Public License, version 2. 4.2 Serial Communication Used for communication between the Arduino and a computer or other devices. All Arduino boards have at least one serial port (also known as a UART or USART): Serial. It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB. Thus, if one use these functions, one cannot also use pins 0 and 1 for digital input or output. One can use the Arduino environment's built-in serial monitor to communicate with an Arduino board. Click the serial monitor button in the toolbar and select the same baud rate used in the call to begin(). Information passes between the computer and Arduino through USB cable. Information is transmitted as 0’s and 1’s, also known as bits. • Compiling turns your program into binary data (ones and zeros)
  • 43. P a g e 43 | 92 • Uploading sends the bits through USB cable to the Arduino • The two LEDs near the USB connector blink when data is transmitted • RX blinks when the Arduino is receiving data • TX blinks when the Arduino is transmitting data Image no-4.2 Transmission and reception of Arduino board
  • 44. P a g e 44 | 92 CHAPTER (5) GSM TECHNOLOGY AND MODEM 5.1 Introduction  GSM (Groupe Spéciale Mobile, now named Global System for Mobile Communications) is a 2nd Generation cellular mobile system innovated in Europe by ETSI (European Telecommunications Standardization Institute). It is now a “family name” of a number of systems including 2.5G and 3G systems such as:  PCS (Personal Cellular System/Service) – North American GSM  HSCSD (High-Speed Circuit Switched Data) – GSM with high-speed data by bundling up to four voice equivalent channels  GPRS (General Packet Radio Services) – GSM enhancement in cell-phone software and network hardware and  software to support packet switching (the one used by the Internet)  EDGE (Enhanced Data rates for GSM Evolution) – a technique to achieve better ‘compression’ of data on the air interface  EGPRS (EDGE based GPRS)  UMTS (Universal Mobile Telecommunications Service) – 3G System based on W-CDMA (Wideband Code Division Multiple Access)  HSPA (High Speed Packet Access) – Data speed enhancement for 3G systems  3GSM (3rd  Generation GSM) – new name for 3G systems that are based on GSM technologies The development of GSM started in 1982 when a study group ‘Group Special Mobile’ was formed during Conference of European Posts and Telegraphs (CEPT) this group was to develop a Pan- European public cellular system in the 900 MHz range. Some of the basic criteria for their proposed system were:  Good subjective speech quality  ISDN compatibility  Spectral efficiency  Support for international roaming  Support for range of new services and facilities In 1989, GSM responsibility was transferred to European Telecommunication Standards Institute (ETSI) and commercial service was started in mid1991. Although GSM was standardized in
  • 45. P a g e 45 | 92 Europe, now it is operational in other continents also. The acronym GSM now aptly stands for Global System for Mobile Communication. 5.2 Cellular mobile system Cellular radio was devised in order to make better use of limited resource of Radio Spectrum. Each Megahertz of spectrum will only support a comparatively a small number of simultaneous conversations and the same frequency must be reused many times in order to meet the capacity needed for national or regional service. So with the development in Political, Commercial and Industrial areas there arose a necessity for uniformity in cellular communication Cellular mobile communication has generations: 1. First generation: Analog radio; mostly telephony only, virtually no data capability other than special device with analog modem. 2. Second Generation: Digital radio and short messaging; this is now the main stream system. Recently a variety of technique has been innovated and employed to enhance data capability of 2G systems. The data capability includes Internet access and picture sharing. These systems are called 2.5G systems. 3. Third Generation: Digital system with multimedia services including video phone and relatively higher speed (say up to 1 Mbps) Internet access. A slow roll off of 3G system has been started in advanced networks of developed and rapidly developing countries. 4. Fourth Generation: Digital system with voice-over-IP (VOIP) technology (Note that the voice for G1, 2 and 3 are circuit-switched). That is, the services are integrated into all IP network. This is expected to be future network and not coming any time soon. Table no-5.2 cellular mobile sysytem
  • 46. P a g e 46 | 92 5.3 GSM technology One of the most important conclusions from the early tests of the new GSM technology was that the new standard should employ Time Division Multiple Access (TDMA) technology. This ensured the support of major corporate players like Nokia, Ericsson and Siemens, and the flexibility of having access to a broad range of suppliers and the potential to get product faster into the marketplace. After a series of tests, the GSM digital standard was proven to work in 1988. With global coverage goals in mind, being compatible with GSM from day one is a prerequisite for any new system that would add functionality to GSM. As with other 2G systems, GSM handles voice efficiently, but the support for data and Internet applications is limited. A data connection is established in just the same way as for a regular voice call; the user dials in and a circuit-switched connection continues during the entire session. If the user disconnects and wants to re-connect, the dial-in sequence has to be repeated. This issue, coupled with the limitation that users are billed for the time that they are connected, creates a need for packet data for GSM. The digital nature of GSM allows the transmission of data (both synchronous and asynchronous) to or from ISDN terminals, although the most basic service support by GSM is telephony. Speech, which is inherently analog, has to be digitized. The method employed by ISDN, and by current telephone systems for multiplexing voice lines over high-speed trunks and optical fiber lines, is Pulse Coded Modulation (PCM). From the start, planners of GSM wanted to ensure ISDN compatibility in services offered, although the attainment of the standard ISDN bit rate of 64 Kbit/s was difficult to achieve, thereby belying some of the limitations of a radio link. The 64 Kbit/s signal, although simple to implement, contains significant redundancy. Since its inception, GSM was destined to employ digital rather than analog technology and operate in the 900 MHz frequency band. Most GSM systems operate in the 900 MHz and 1.8 GHz frequency bands, except in North America where they operate in the 1.9 GHz band. GSM divides up the radio spectrum bandwidth by using a combination of Time- and Frequency Division Multiple Access (TDMA/FDMA) schemes on its 25 MHz wide frequency spectrum, dividing it into 124 carrier frequencies (spaced 200 Khz apart). Each frequency is then divided into eight time slots using TDMA, and one or more carrier frequencies are assigned to each base station. The fundamental unit of time in this TDMA scheme is called a ‘burst period’ and it lasts 15/26 ms (or approx. 0.577 ms). Therefore the eight ‘time slots’ are actually ‘burst periods’, which are grouped into a TDMA frame, which subsequently form the basic unit for the definition of logical channels. The development of standards and systems spans well beyond the technical realm and often into
  • 47. P a g e 47 | 92 the political; this is best exemplified by what happened with GSM. Shortly after the suitability of TDMA for GSM was determined, a political battle erupted over the question of whether to adopt a wide-band or narrow-band TDMA solution. Whereas France and Germany supported a wide- band solution, the Scandinavian countries favored a narrow-band alternative. These governmental preferences were clearly a reflection of the respective countries’ domestic equipment manufacturers as German and French manufacturers SEL and Alcatel had invested substantially into wide-band technology, whereas their Scandinavian counterparts Ericsson and Nokia poured resources into the narrow-band alternative. Italy and the UK, in turn, were the subjects of intense lobbying on behalf of the two camps with the result of frequently changing coalitions The culmination of this controversy between the two camps was a CEPT (Conference des Administrations Europeans des Posts et Telecommunications) Meeting in Madeira in February 1987. The Scandinavian countries finally convinced Italy, the UK and a few smaller states of the technical superiority of narrow-band technology and left Germany and France as the only proponents of the wide-band alternative. Since CEPT followed purely intergovernmental procedures, however, decisions had to be taken unanimously, and Germany and France were able to veto a decision that would have led to the adoption of narrow-band TDMA as the technology underlying the GSM project. A unique feature of GSM is the Short Message Service (SMS), which has achieved wide popularity as what some have called the unexpected ‘killer application’ of GSM. SMS is a bi-directional service for sending short alphanumeric message in a store-and-forward process. SMS can be used both ‘point-to-point’ as well as in cell-broadcast mode. (Further information in Section 3.5) Supplementary services are provided on top of tele-services or bearer services, and include features such as, inter alia, call forwarding, call waiting, caller identification, three-way conversations, and call-barring. Another of GSM’s most attractive features is the extent to which its network is considered to be secure. All communications, both speech and data, are encrypted to prevent eavesdropping, and GSM subscribers are identified by their Subscriber Identity Module (SIM) card (which holds their identity number and authentication key and algorithm). While the choice of algorithm is the responsibility of individual GSM operators, they all work closely together through the Memorandum of Understanding (MOU) (to be described in greater detail in section 2.2.2) to ensure security of authentication. This smartcard technology minimizes the necessity for owning terminals - as travelers can simply rent GSM phones at the airport and
  • 48. P a g e 48 | 92 insert their SIM card. Since it’s the card rather than the terminal that enables network access, feature access and billing, the user is immediately on-line. 5.4 System architecture The functional architecture of a GSM system can be broadly classified into  Mobile Station (MS)  Base Station Subsystem (BSS)  Network and Switching Subsystem (NSS)  Operation Subsystem (OSS) The MS and the BSS communicate via the Um interface or radio link. The BSS communicates with Mobile Service Switching Center across the A interface. 5.4.1 Mobile Station This may be a standalone piece of equipment for certain services or support the connection of external terminals. The MS consists of the Mobile Equipment (ME) and a Subscriber Identity Module (SIM).The ME is uniquely identified by the International Mobile Equipment Identity (IMEI), but it need not be personally assigned to one subscriber, The SIM which is a smart card provides personal mobility and the user can access the subscriber services. The subscriber can operate on any terminal just by inserting the SIM card in that GSM terminal. SIM card contains the International Mobile Subscriber Identity (IMSI) used to identify the subscriber to the system, a secret key for authentication and other security information’s. SIM card may be protected against unauthorized use by a password. 5.4.2 Base Station Subsystem The BSS is composed of three parts, Base Transceiver Station (BTS) and U3ase Station Controller (BSC). These two communicate across the standardized Abis interface. The third part is Transponder and Rate Adaptation Unit (TRAU). 5.4.3 Base Transceiver Station This provides the GSM radio coverage within a cell. It comprises of radio transmitting and receiving equipment and associated signal processing units. This complements the radio features of ME. 5.4.4 Base Station Controller This manages the radio resources for one or more BTS’s. It handles radio channel set-up, Handovers and frequency hopping. Handovers between BTS’s belonging to different BSC’s
  • 49. P a g e 49 | 92 however can involve MSC’s but are still managed by the original serving BSC. It controls the transmission of information about Local Area Codes (LAC), signaling channel configuration and information’s about neighboring cells. Figure no-5.4.4(a) block diagram of BSC Figure no-5.4.4(b) block diagram of GSM technology 5.4.5 Trans-coder and Rate Adaptation Unit This is responsible for trans-coding between GSM encoded speech at I 3KPS and fixed network speech at 64KPS. Similarly it performs rate adaptation of GSM data services. Although it is a part of BSS, it is located at MSC Sites. This is to benefit from the lower rate coding and consequent saving in transmission costs. 5.5 Network and switching sub system NSS in GSM uses an Intelligent Network (The central component of NSS is the Mobile Service Switching Center (MSC). It is supported by Interworking functions (JWF), Home Location Register (HLR), Visitor Location Register (VLR), Gateway MSC (GMSC) and Signal Transfer Point (STP).
  • 50. P a g e 50 | 92 5.5.1 Mobile Service Switching Center It acts like a switching node and additionally provides all the functionality needed to handle a mobile subscriber such as registration, authentication, and location updating. Handovers and call routing to a roaming subscribe. These functions are provided in conjunction with several functional entities. An MSC controls several BSC’s. 5.5.2 Inter Working Function, (IWF) A gateway for MSC to interface with external networks for communications with users outside GSM. The role of IWF depends upon the type of user data and the network to which it interfaces. 5.5.3 Home Location Register, (HLR) It consists of a computer without switching capabilities. It is a database, which contains subscriber information related to the subscriber’s current locations but not the actual location. HLR has two divisions Authentication Center (AuC) and Equipment Identity Register (EIR). The AuC manages the security data for subscriber authentication. The EIR database carry information about certain ME’s. The security procedure is discussed later. 5.5.4 Visitor Location Register, (VLR) It links to one or more MSC’s, temporarily storing subscription data currently served by its corresponding MSC. VLR holds more current subscriber location than l—ILR. Although VLR is an independent unit, it is always implemented together with the MSC. 5.5.5 Gateway MSC (GMSC) In order to set-up a requested call, the call is initially routed to a GMSC which finds the correct HLR.GMSC has an interface with external network for gate -waying and the network operates the full signaling system 7 (SS7) between NSS Machines. 5.5.6 Signaling Transfer Point It acts as a standalone node to optimize the cost of the signaling transport among MSC/VLR, GMSC and HLR> 5.6More points 5.6.1 Operating subsystem: There are three area of OSS  Network operation and maintenance function.  Subscription management including charging and billing.  Mobile Equipment and Management.
  • 51. P a g e 51 | 92 5.6.2 Layer modeling  Transmission  Radio resource management  Mobility management  Communication management  Operation, administration and maintenance 5.6.3 Radio link aspects The International Telecommunication Union (ITU) which manages Allocation of radio spectrum has allocated the bands 890-915MHz for the uplink (MS to BS) and 960MHz for the downlink (BS to MS) for mobile networks. 5.6.4 Multiple access and channel structure Due to the scarcity of radio spectrum, a method must be devised to divide bandwidth among as many users as possible. GSM uses a combination of FDMA TDMA. FDMA part involves the division by frequency of the 25M1-lz bandwidth into carrier frequencies of 200 KHz bandwidth. One or more carrier frequencies is then divided in time using TDMA scheme. 5.6.5 Traffic channels This is also called physical channel. This is used to carry speech and data traffic: They are of three kinds  TCH/F (full rate): Transmits the speech code of 13 KBPS or Three data mode 12, 6 and 3.6 1KBPS.  TCIH/H(half rate):Transmits the speech code of 7 1KBPS or Two data modes 6 3.6 1KBPS  TCI-118(1/8th rate): Used for low rate signaling channels, Common channels and channels. They are also called Stand Alone Dedicated Control Channel(SDCCH) 5.6.6 Cell selection Using the best cell from an MS depends on three factors  The level of signal received by the MS.  The maximum transmission power of the MS.  Two parameters P1 and P2 specified by the cell C1 = A-max (B, 0) A = received level average-P 1 B = P2-Max RF power of the MS.
  • 52. P a g e 52 | 92 P1 = A value between —110 and —48dBm P2 = A value between 13 and 43dBm Call selection algorithm is as follows  The SIM must be inserted  The strongest Cl is chosen by obtaining Cl from the candidate cells. All cells must not be barred from service
  • 53. P a g e 53 | 92 CHAPTER (6) SERVO MOTOR 6.1 Introduction A servomotor is a rotary actuator that allows for precise control of angular position. It consists of a motor coupled to a sensor for position feedback, through a reduction gearbox. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors. Figure no-6.1(a) block diagram of servo motor The electric motor and the servomechanism both serve as fundamental building blocks for modern mechanical equipment’s and advance technological instruments. An electric motor is a device that uses electrical energy to produce mechanical energy. A servomechanism, or servo, differs from a motor in that it automatically corrects its performance using error-sensing feedback. A servo is typically implemented with an electric motor as the source of mechanical force. Image no-6.1 block diagram of BSC Servomotors are designed to operate control surfaces. So they do not rotate continuously. Rather they are designed to rotate through 180 degrees with precise position control. If you want to use them as the main drive motor for a mobile robot you need to modify them so that they will rotate continuously. They do not simply run on a DC voltage like a standard DC motor. They have 3 wires. Red is power (generally 3V – 12V max), black is ground and then there is another wire, usually white or yellow that is the “input signal wire”.
  • 54. P a g e 54 | 92 6.2 Commercial application Electric motors are inexpensive, easy-to-use, and most importantly, a convenient source of mechanical force. They also allow delicate and precise movements, which grant them to play a part in applications involving systems and controls. Electric motors can be found in household appliances such as fans, refrigerators, washing machines, floor vacuums, hair dryers, and electric heaters. Depending on the power output and the size of a particular motor, the cost ranges from a few to several thousand US dollars. Due to the simplicity of their construction and their generic nature, production of electric motors is inclusive to almost any electrical manufacturer. Servos, on the other hand, can be a bit more expensive because they incorporate performance adjustment capabilities on top of providing mechanical force. The automatic correction feature requires feedback circuits to actively monitoring the performance parameters such as speed, in cruise control, and position, in navigation systems. In complex cases, software manipulation of the mechanism is needed. Some of the highly advanced applications of servomechanism include: automatic machine tools, satellite-tracking antennas, and automatic security systems. 6.3 Types Servo motors are special category of motors, designed for applications involving position control, velocity control and torque control. These motors are special in the following ways: 1. Lower mechanical time constant. 2. Lower electrical time constant. 3. Permanent magnet of high flux density to generate the field. 4. Fail-safe electro-mechanical brakes. For applications where the load is to be rapidly accelerated or decelerated frequently, the electrical and mechanical time constants of the motor plays an important role. The mechanical time constants in these motors are reduced by reducing the rotor inertia. Hence the rotors of these motors have an elongated structure. 6.4 Principle of operation Servo motors are used in closed loop control systems in which work is the control variable. Servo motors feature a motion profile, which is a set of instructions programmed into the controller that defines the servo motor operation in terms of time, position, and velocity.
  • 55. P a g e 55 | 92 Figure no-6.4(a) principle of operation of servo motor The servo motor controller directs operation of the motor by sending velocity command signals to the amplifier that drives the servo motor. The servo compares its position and velocity feedbacks to its programmed motion profiles and adjusts the motor velocity accordingly. A servomotor is controlled by sending a pulse signal that is HIGH for a brief time, generally 1 – 2 ms. If you just connect a battery to power and ground, nothing will happen. You must have a timer circuit that generates this pulsed signal and by varying the pulse ON time (or the pulse width) the motor will move to a certain position over its range of motion and then stop as long as the input pulse width is the same. Depending on the pulse width, you’ll get a different position. This diagram shows some control signal pulses for a typical servo and the position to which it will rotate in response to the pulse width. Figure no-6.4(b) principle of operation sending of high pulse at every 20 ms There is another element to the signal that also requires timing accuracy. The frequency of the signal or its rate of refresh. Not only do you have to send the pulse, you have to keep sending them as long as you want the motor to be in that position (or to keep rotating for modified servos). Generally a frequency of 50 Hz is good. This means that you send the high pulse 50 times every second. A servo will only rotate through 180 degrees unless you modify it for continuous rotation. One
  • 56. P a g e 56 | 92 interesting thing that comes out this modification is that you get a speed control function out of it, though somewhat coarse. When you make the modification you replace the circuitry in the motor that tells the motor what position it is in. The modes you make tell the motor that it is always in the center position. So if you feed a 1.75 ms pulse, it rotates to the 180 degree position, checks the feedback which tells it that “hey, you haven’t moved yet. You’re still in the center position, keep going” so it does, checks and sees that it hasn’t moved yet and keeps doing it. Since it thinks that it is in center position and it has to move to its right most position it will move at its fastest rate. Now suppose you send it a signal that says to rotate to 95 degrees, 5 degrees right of center. The internal control system knows that it is now to move a very short distance. It also knows that if it rotates at its fastest speed that it may overshoot this and has to come back, and overshoot again in the other direction and try again, and so forth. This is called oscillation and is not a good thing. The advantage that you get out of this is that the motor will move slower when you feed a signal that is close to the center position. So you feed it a “go to 95 degree” signal and it will rotate CW at a slow rate. Give it “go to 180 degrees” and it will rotate CW at its fastest rate and the same for CCW. 6.5 Application  Used in RC plane design  Fixed angle motion
  • 57. P a g e 57 | 92 CHAPTER (7) PIR SENSOR 7.1 Introduction The PIR (Passive Infra-Red) Sensor is a pyro electric device that detects motion by measuring changes in the infrared (heat) levels emitted by surrounding objects. When motion is detected the PIR sensor outputs a high signal on its output pin. This logic signal can be read by a microcontroller or used to drive an external load. Figure no-7.1(a) PIR sensor  Longer detection range, selectable by onboard jumper  Wider supply voltage, from 3 to 6 VDC  Higher output current provides for direct control of an external load  Mounting holes included for permanent projects  All parts SMT PIR sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range. They are small, inexpensive, low-power, easy to use and don't wear out. Figure no-7.1(b) Pcb of PIR sensor They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR motion" sensors.PIRs are basically made of a pyroelectric sensor (which you can see above as the round metal can with a rectangular crystal in the center), which can detect levels of infrared radiation. Everything emits
  • 58. P a g e 58 | 92 some low level radiation, and the hotter something is, the more radiation is emitted. The sensor in a motion detector is actually split in two halves. The reason for that is that we are looking to detect motion (change) not average IR levels. The two halves are wired up so that they cancel each other out. If one half sees more or less IR radiation than the other, the output will swing high or low. 7.2 How it works The PIR sensor itself has two slots in it; each slot is made of a special material that is sensitive to IR. The lens used here is not really doing much and so we see that the two slots can 'see' out past some distance (basically the sensitivity of the sensor). When the sensor is idle, both slots detect the same amount of IR, the ambient amount radiated from the room or walls or outdoors. When warm bodies like a human or animal passes by the sensor, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential change. These change pulses are what is detected. Figure no-7.2 Working of PIR sensor 7.3 Technical data  Power requirements: 3 to 6 VDC; 12 mA @ 3 V, 23 mA @ 5 V  Communication: Single bit high/low output  Dimensions: 1.41 x 1.0 x 0.8 in (35.8 x 25.4 x 20.3 cm)
  • 59. P a g e 59 | 92  Operating temp range: 32 to 122 °F (0 to 50 °C) 7.4 Application  Motion-activated nightlight  Alarm systems  Holiday animated props  Motion based security system
  • 60. P a g e 60 | 92 CHAPTER (8) COMPONENTS 8.1 Capacitor 8.1.1 Introduction The capacitor's function is to store electricity, or electrical energy. The capacitor also functions as a filter, passing alternating current (AC), and blocking direct current (DC). This symbol ( )is used to indicate a capacitor in a circuit diagram. The capacitor is constructed with two electrode plates facing each other but separated by an insulator. When DC voltage is applied to the capacitor, an electric charge is stored on each electrode. While the capacitor is charging up, current flows. The current will stop flowing when the capacitor has fully charged. 8.1.2 Actual Capacitance This is a measure of a capacitor’s ability to store charge. A large capacitance means that more charge can be stored. It is measured in farad, F. 1F is very large, so prefixes are used to show the smaller values. Three prefixes are used, u (micron), n (Nano), and p (Pico). 1uf=10-6 f 1nf=10-9 f 1pf=10-12 f Sometimes, a three-digit code is used to indicate the value of a capacitor. There are two ways in which the capacitance can be written one uses letters and numbers, the other uses only numbers. In either case, there are only three characters used. [10n] and [103] denote the same value of capacitance. The method used differs depending on the capacitor supplier. In the case that the value is displayed with the three-digit code, the 1st and 2nd digits from the left show the 1st figure and the 2nd figure, and the 3rd digit is a multiplier which determines how many zeros are to be added to the capacitance. Pico farad (pF) units are written this way. For example, when the code is [103], it indicates 10 x 103, or 10,000pF = 10 nano-farad (nF) = 0.01 microfarad (µF). If the code happened to be [224], it would be 22 x 104 = or 220,000pF = 220nF = 0.22µF. Values under 100pF are displayed with 2 digits only. For example, 47 would be 47pF. The capacitor has an insulator (the dielectric) between 2 sheets of electrodes. Different kinds of capacitors use different materials for the dielectric.
  • 61. P a g e 61 | 92 8.1.3 Breakdown voltage When using a capacitor, you must pay attention to the maximum voltage which can be used. This is the "breakdown voltage." The breakdown voltage depends on the kind of capacitor being used. You must be especially careful with electrolytic capacitors because the breakdown voltage is comparatively low. The breakdown voltage of electrolytic capacitors is displayed as Working Voltage. The breakdown voltage is the voltage that when exceeded will cause the dielectric (insulator) inside the capacitor to break down and conduct. When this happens, the failure can be catastrophic. 8.1.4 Types of Capacitors There are various types of capacitors available in the market. Some of them are as follows:  Mica Capacitor  Paper Capacitor  Ceramic Capacitor  Variable Capacitor  Electrolytic Capacitor  Tantalum Capacitor  Film Capacitor Here we used only two types of capacitor i.e. ceramic capacitor & electrolytic capacitor. 1. Polarized capacitors 2. Un-polarized capacitors 1. Polarized Capacitors: These are the capacitors having polarity. Basically these are of larger values than 1uf. For example below is the diagram of capacitor of 220 microfarad and having breakdown voltage 25V. Image no-8.1.4(a) Picture of polarize capacitors 2. Un-polarized Capacitors (small values, up to 1µF) Small value capacitors are un-polarized and may be connected either way round. They are not damaged by heat when soldering, except for one unusual type (polystyrene). They have high