0% found this document useful (0 votes)
68 views70 pages

Automatic Vehicle Detection Electromagnetic Intelligent Breaking System 2

This document presents a major project report on an Automatic Vehicle Detection Electromagnetic Intelligent Braking System. It includes sections on the introduction, background of the project, connectivity and communication methods, and an abstract. The project aims to design a control system for an automatic and intelligent braking system for vehicles using electromagnetic braking and sensors to detect obstacles. When an obstacle is detected, the system will signal the microcontroller to stop the motor and engage the electromagnetic braking to stop the vehicle.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views70 pages

Automatic Vehicle Detection Electromagnetic Intelligent Breaking System 2

This document presents a major project report on an Automatic Vehicle Detection Electromagnetic Intelligent Braking System. It includes sections on the introduction, background of the project, connectivity and communication methods, and an abstract. The project aims to design a control system for an automatic and intelligent braking system for vehicles using electromagnetic braking and sensors to detect obstacles. When an obstacle is detected, the system will signal the microcontroller to stop the motor and engage the electromagnetic braking to stop the vehicle.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 70

A

MAJOR- PROJECT REPORT

ON

Automatic Vehicle Detection Electromagnetic Intelligent Breaking


system
Major – Project Report Submitted in partial fulfillment of the requirement

for the award of the degree of

BACHELOR OF TECHNOLOGY
IN
MECHANICAL ENGINEERING
BY
N.VENKATA SURYA BHARADWAJ 16M51A0326.

MD.ZAMEER ALI 17M55A0322.

K.SAI KIRAN 16M51A0319.

UNDER THE GUIDENCE OF


Mr. VINOD REDDY

DEPARTMENT OF MECHANICAL ENGINEERING

ELLENKI INSTITUTE OF ENGINEERING & TECHNOLOGY


NEAR BHEL, PATELGUDA, PATANCHERU, SANGAREDDY ( D) – 502305
AFFILIATED TO JNTU, HYDERABAD AND APPROVED BY AICTE, NEW DELHI
ELLENKI INSTITUTE OF ENGINEERING & TECHNOLOGY
NEAR BHEL, PATELGUDA, PATANCHERU,SANGAREDDY ( D) – 502305
AFFILIATED TO JNTU, HYDERABAD AND APPROVED BY AICTE, NEW DELHI

DEPARTMENT OF MECHANICAL ENGINEERING

CERTIFICATE
This is to certify that the major-project report entitled “ Automatic Vehicle
Detection Electromagnetic Intelligent Breaking system” being submitted
by:

N.VENKATA SURYA BHARADWAJ (16M51A0326)

MD.ZAMEERALI (17M55A0322 )

K.SAI KIRAN (16M51A0319)

in partial fulfillment of the requirements for the award of Degree of Bachelor of


Technology in MECHANICAL ENGINEERING Under Jawaharlal Nehru
Technological University, Hyderabad during the period of 2019-2020.

INTERNAL GUIDE HEAD OF THE DEPARTMENT

EXTERNAL EXAMINER
ACKNOWLEDGEMENT

It is our pleasure to acknowledge the help that we have received from


different individuals and place on our appreciation and thanks to those who have
helped us in bringing this Mini-Project work.

We express our deep sense of gratitude to our beloved chairman


Sri. E. SADASIVA REDDY , ELLENKI GROUP OF INSTITUTATIONS who
extended his co-operation in various ways throughout the course.

We express our deep sense of gratitude to our beloved Director


Sri. M. SAMBASIVA REDDY, RESEARCH AND DEVELOPMENT CENTER
AND ELLENKI INISTITUTE OF ENGINEERING & TECHNOLOGY who extended
his co-operation in various ways throughout the course.

We would like to thank Professor Dr.R.SARVANAN, PRINCIPAL


for providing us with an opportunity to do our Major-Project.

We express special thanks Mr. CH. NAGARAJU , HEAD,

DEPARTMENT OF MECHANICAL ENGINEERING for his encouraging support and


guidance in carrying out the Mini-Project.

We express special thanks Mr.VINOD REDDY, ASSISTANT

PROFESSOR,DEPARTMENTOF MECHANICAL ENGINEERING for his encouraging


support and guidance in carrying out the Major-Project.

Finally, our heartfelt gratitude and thanks to one and all who helped us
directly or indirectly to make our Major-Project successful.

N.VENKATA SURYA BHARADWAJ 16M51A0326.

MD.ZAMEER ALI 17M55A0322.

K.SAI KIRAN 16M51A0319 .


ABSTRACT

Automotive vehicles are increasingly being equipped with collision avoidance and warning
systems for predicting the potential collision with an external object, such as another vehicle or a
pedestrian. Upon detecting a potential collision, such systems typically initiate an action to avoid
the collision and/or provide a warning to the vehicle operator. The aim is to design and develop a
control system based on an automatic, intelligent and electronically controlled automotive
braking system for automobiles is called as “INTELLIGET BRAKING SYSTEM”. This Braking
system consists of IR transmitter and receiver circuit and the vehicle. The IR sensor is used to
detect the obstacle. There is any obstacle in the path, the IR sensor senses the obstacle and giving
the control signal to the microcontroller, which in turn sends a signal to the motor to stop and
also to the solenoid so as to stop the vehicle as programmed. This project facilitates
electromagnetic braking system using solenoid. Here in fabrication module include a circular
disc associated with a dc motor and a solenoid. Embedded system module includes micro
controller with a solenoid and sensor.
CHAPTER-1
INTRODUCTION
1. BACKGROUND: This section takes a brief look at Android smart phones and its features,
how smart Phones will help to develop a community in the environment it is used in. Hardware,
software and communication protocols are evaluated for their suitability to this application.
Finally, we take a brief look on existing systems

1.1 Android Platform:

Android devices are powerful mobile computers and they become more and more popular
smart phones used worldwide. They becomes more and more popular for software developers
because of its powerful capabilities and open architecture, also it’s based on the java
programming language. Because Android uses the Java programming language getting started
with the Android API is easy; the API is open and allows easy access to the hardware
components. Android devices provide numerous communication interfaces like USB, Wi-Fi and
Bluetooth, that can be used to connect to the robot. We think it is a great platform for a robotic
system control, because it’s much cheaper than any other ARM-based processing unit. We use
android platform because it is the widest used in the word and runs the largest number of
smartphones worldwide.

1.2 Connectivity and Communication:

For the communication of the robot with the cell phone or a mobile we are using the
Bluetooth device. The Bluetooth device (HC-05) is attached to the robot that receives the data
from the mobile and also can transmit the data. Bluetooth: Bluetooth is a wireless
communications protocol running at 2.4 GHz, with client-server architecture, suitable for
forming personal area networks. It is designed for low power devices such as mobile phones .
Bluetooth now comes as standard on the majority of mobile phones, and desktop computers. It
can be easily fitted with a module to allow Bluetooth communication. Bluetooth is the only
appropriate communications protocol because there is no fear of getting the frequency
interference. Bluetooth uses the MAC Address of the device. The Bluetooth gives the
connectivity between two devices using their MAC Address.
Introduction:

Robots are smart machines that can be programmed and used in many areas such as
industry, manufacturing, production lines, or health, etc. These robots perform hard, dangerous,
and accurate work to facilitate our life and to increase the production because they can work 24
hours without rest , and can do works like human but more 444 Arpit Sharma et al precisely and
with less time. Assistive mobile robots that perform different kinds of work over everyday
activities in many areas such as industry, manufacturing, production lines, or health, etc. are very
commonly used to improve our life. The idea of this research is to exploit robotics usage on
healthcare field to help mobility disabled people. A smartphone is a mobile phone built on a
mobile computing platform, with more advanced computing ability and connectivity than a
feature phone. Smartphones are a more affordable and efficient hand held devices which can be
used to support collaborative activities in a community. It is a result of a huge advancement in
mobile phones technology. Humans are anxiously working on finding new ways of interacting
with machines. However, a major breakthrough was observed when gestures were used for this
interaction. A gesture is a form of non-verbal communication in which visible bodily actions
communicate particular messages [2,7,10]. It comprises of sound, light variation or any type of
body movement. Based upon the type of gestures, they have been captured via Acoustic (sound),
Tactile (touch), Optical (light), Bionic and Motion Technologies through still camera, data glove,
Bluetooth, infrared beams etc. Motion Technology has succeeded in drawing the attention of
researchers from different parts of the world. Smartphone, a small yet powerful device is rapidly
changing the traditional ways of human-machine interaction. Modern smartphones are embedded
with accelerometer sensor, Bluetooth module and are powered by different operating systems
such as Symbian, Bada, Android OS etc. Among all available mobile operating systems Android
OS has gained significant popularity after being launched in 2008, overtaking all previous
competitors due to its open architecture. Android platform has revolutionized the application
development field for cellphone, opening new doors for technical exploration [4,6]. The
smartphone can be freely rotated in space, temporarily varying 3-dimensional signal data is
obtained from the phone's 3-axis acceleration sensor. This data is transmitted to a robot via
Bluetooth module of smartphone using an android app. Further, it is processed by a
microcontroller embedded on the robot for its desirable motions. In this context, a robot is an
analogy for any machine that is controlled by man varying from a simple toy to heavy
machinery. Robots have even replaced humans in performing various tasks that they are unable
to perform due to physical disability, size limitation or extreme environments. For past two
decades, researchers from around the world have shown keen interest in gesture technology and
its possibilities in various fields making it a powerful tool for humans. Smartphones have proved
to be of much more aid than being a device just for making calls. The large world is merging
together into the palms of humans in the form of a smartphone. A lot of research work in this
context has been explored and presented in the next section.

Nowadays smart phones are becoming more powerful with reinforced processors, larger
storage capacities, richer entertainment function and more communication methods. Bluetooth is
mainly used for data exchange; add new features to smart phones. Bluetooth technology, created
by telecom vendor Ericsson in 1994, shows its advantage by integrating with smart phones. It
has changed how people use digital device at home or office, and has transferred traditional
wired digital devices into wireless devices. A host Bluetooth device is capable of communicating
with up to seven Bluetooth modules at same time through one link . Considering its normal
working area of within eight meters, it is especially useful in home environment. Thank for
Bluetooth technology and other similar techniques, with dramatic increase in Smartphone users,
smart phones have gradually turned into an all-purpose portable device and provided people for
their daily use . In recent years, an open-source platform Android has been widely used in smart
phones . Android has complete software package consisting of an operating system, middleware
layer and core applications. Different from other existing platform like iOS (iPhone OS), it
comes with software development kit (SDK), which provides essential tools and Application.
Using a Smartphone as the “brain” of a robot is already an active research field with several open
opportunities and promising possibilities. In this paper we present a review of current robots
controlled by mobile phone and discuss a closed loop control systems using audio channels of
mobile devices, such as phones and tablet computers. In our work, move the robot upward,
backward, left and right side by the android application.

Android controlled robot project make use of an Android mobile phone for robotic
control with the help of Bluetooth technology. This is a simple robotics projects using
microcontroller. We have already seen Mobile Controlled Robot using DTMF technology which
uses call based method to control robot. Also many wireless-controlled robots use RF modules.
The control commands available are more than RF modules. Smartphone controlled robot is
superior than all these robots.
This project is a Bluetooth controlled robot. For this the android mobile user has to install
an application on her/his mobile. Then user needs to turn on the Bluetooth in the mobile. The
wireless communication techniques used to control the robot is Bluetooth technology. User can
use various commands like move forward, reverse, stop move left, move right. These commands
are sent from the Android mobile to the Bluetooth receiver. Android based robot has a
Bluetooth receiver unit which receives the commands and give it to the microcontroller circuit to
control the motors. The microcontroller then transmits the signal to the motor driver IC’s to
operate the motors.
CHAPTER – 2
BACKGROUND EMBEDDED

An embedded system is a combination of software and hardware to perform a dedicated


task. Some of the main devices used in embedded products are Microprocessors and
Microcontrollers. Microprocessors are commonly referred to as general purpose processors as
they simply accept the inputs, process it and give the output. In contrast, a microcontroller not
only accepts the data as inputs but also manipulates it, interfaces the data with various devices,
controls the data and thus finally gives the result.

2.1 INTRODUCTION TO EMBEDDED SYSTEM


An Embedded System is a combination of computer hardware and software, and perhaps
additional mechanical or other parts, designed to perform a specific function. A good example is
the microwave oven. Almost every household has one, and tens of millions of them are used
every day, but very few people realize that a processor and software are involved in the
preparation of their lunch or dinner.
This is in direct contrast to the personal computer in the family room. It too is comprised
of computer hardware and software and mechanical components (disk drives, for example).
However, a personal computer is not designed to perform a specific function rather; it is able to
do many different things. Many people use the term general-purpose computer to make this
distinction clear. As shipped, a general-purpose computer is a blank slate; the manufacturer does
not know what the customer will do wish it. One customer may use it for a network file server
another may use it exclusively for playing games, and a third may use it to write the next great
American novel.
Frequently, an embedded system is a component within some larger system. For
example, modern cars and trucks contain many embedded systems. One embedded system
controls the anti-lock brakes, other monitors and controls the vehicle's emissions, and a third
displays information on the dashboard. In some cases, these embedded systems are connected by
some sort of a communication network, but that is certainly not a requirement.
At the possible risk of confusing you, it is important to point out that a general-purpose
computer is itself made up of numerous embedded systems. For example, my computer consists
of a keyboard, mouse, video card, modem, hard drive, floppy drive, and sound card-each of
which is an embedded system. Each of these devices contains a processor and software and is
designed to perform a specific function. For example, the modem is designed to send and receive
digital data over analog telephone line. That's it and all of the other devices can be summarized
in a single sentence as well.
If an embedded system is designed well, the existence of the processor and software
could be completely unnoticed by the user of the device. Such is the case for a microwave oven,
VCR, or alarm clock. In some cases, it would even be possible to build an equivalent device that
does not contain the processor and software. This could be done by replacing the combination
with a custom integrated circuit that performs the same functions in hardware. However, a lot of
flexibility is lost when a design is hard-cooled in this way. It is must easier, and cheaper, to
change a few lines of software than to redesign a piece of custom hardware.
2.2 HISTORY AND FUTURE
Given the definition of embedded systems earlier is this chapter; the first such systems
could not possibly have appeared before 1971. That was the year Intel introduced the world's
first microprocessor. This chip, the 4004, was designed for use in a line of business calculators
produced by the Japanese Company Busicom. In 1969, Busicom asked Intel to design a set of
custom integrated circuits-one for each of their new calculator models. The 4004 was Intel's
response rather than design custom hardware for each calculator, Intel proposed a general-
purpose circuit that could be used throughout the entire line of calculators. Intel's idea was that
the software would give each calculator its unique set of features.
The microcontroller was an overnight success, and its use increased steadily over the next
decade. Early embedded applications included unmanned space probes, computerized traffic
lights, and aircraft flight control systems. In the 1980s, embedded systems quietly rode the
waves of the microcomputer age and brought microprocessors into every part of our kitchens
(bread machines, food processors, and microwave ovens), living rooms (televisions, stereos, and
remote controls), and workplaces (fax machines, pagers, laser printers, cash registers, and credit
card readers).
It seems inevitable has the number of embedded systems will continue to increase
rapidly. Already there are promising new embedded devices that have enormous market
potential; light switches and thermostats that can be central computer, intelligent air-bag systems
that don't inflate when children or small adults are present, pal-sized electronic organizers and
personal digital assistants (PDAs), digital cameras, and dashboard navigation systems. Clearly,
individuals who possess the skills and desire to design the next generation of embedded systems
will be in demand for quite some time.
2.3 REAL TIME SYSTEMS
One subclass of embedded is worthy of an introduction at this point. As commonly
defined, a real-time system is a computer system that has timing constraints. In other words, a
real-time system is partly specified in terms of its ability to make certain calculations or
decisions in a timely manner. These important calculations are said to have deadlines for
completion. And, for all practical purposes, a missed deadline is just as bad as a wrong answer.
The issue of what if a deadline is missed is a crucial one. For example, if the real-time
system is part of an airplane's flight control system, it is possible for the lives of the passengers
and crew to be endangered by a single missed deadline. However, if instead the system is
involved in satellite communication, the damage could be limited to a single corrupt data packet.
The more severe the consequences, the more likely it will be said that the deadline is "hard" and
thus, the system is a hard real-time system. Real-time systems at the other end of this discussion
are said to have "soft" deadlines.
All of the topics and examples presented in this book are applicable to the designers of
real-time system who is more delight in his work. He must guarantee reliable operation of the
software and hardware under all the possible conditions and to the degree that human lives
depend upon three system's proper execution, engineering calculations and descriptive
paperwork.
2.4 APPLICATION AREAS
Nearly 99 per cent of the processors manufactured end up in embedded systems. The
embedded system market is one of the highest growth areas as these systems are used in very
market segment- consumer electronics, office automation, industrial automation, biomedical
engineering, wireless communication, Data communication, telecommunications, transportation,
military and so on.
Consumer Appliances: At home we use a number of embedded systems which include
digital camera, digital diary, DVD player, electronic toys, microwave oven, remote controls for
TV and air-conditioner, VCO player, video game consoles, video recorders etc. Today’s high-
tech car has about 20 embedded systems for transmission control, engine spark control, air-
conditioning, navigation etc. Even wristwatches are now becoming embedded systems. The
palmtops are powerful embedded systems using which we can carry out many general-purpose
tasks such as playing games and word processing.
Office Automation: The office automation products using em embedded systems are
copying machine, fax machine, key telephone, modem, printer, scanner etc.
Industrial Automation: Today a lot of industries use embedded systems for process
control. These include pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity
generation and transmission. The embedded systems for industrial use are designed to carry out
specific tasks such as monitoring the temperature, pressure, humidity, voltage, current etc., and
then take appropriate action based on the monitored levels to control other devices or to send
information to a centralized monitoring station. In hazardous industrial environment, where
human presence has to be avoided, robots are used, which are programmed to do specific jobs.
The robots are now becoming very powerful and carry out many interesting and complicated
tasks such as hardware assembly.
Medical Electronics: Almost every medical-equipment in the hospital is an embedded
system. These equipment’s include diagnostic aids such as ECG, EEG, blood pressure measuring
devices, X-ray scanners; equipment used in blood analysis, radiation, colonoscopy, endoscopy
etc. Developments in medical electronics have paved way for more accurate diagnosis of
diseases.
Computer Networking: Computer networking products such as bridges, routers,
Integrated Services Digital Networks (ISDN), Asynchronous Transfer Mode (ATM), X.25 and
frame relay switches are embedded systems which implement the necessary data communication
protocols. For example, a router interconnects two networks. The two networks may be running
different protocol stacks. The router’s function is to obtain the data packets from incoming pores,
analyze the packets and send them towards the destination after doing necessary protocol
conversion. Most networking equipment’s, other than the end systems (desktop computers) we
use to access the networks, are embedded systems.
Telecommunications: In the field of telecommunications, the embedded systems can be
categorized as subscriber terminals and network equipment. The subscriber terminals such as key
telephones, ISDN phones, terminal adapters, web cameras are embedded systems. The network
equipment includes multiplexers, multiple access systems, Packet Assemblers Dissemblers
(PADs), sate11ite modems etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded
systems that provide very low-cost voice communication over the Internet.
Wireless Technologies: Advances in mobile communications are paving way for many
interesting applications using embedded systems. The mobile phone is one of the marvels of the
last decade of the 20’h century. It is a very powerful embedded system that provides voice
communication while we are on the move. The Personal Digital Assistants and the palmtops can
now be used to access multimedia services over the Internet. Mobile communication
infrastructure such as base station controllers, mobile switching centers are also powerful
embedded systems.
Insemination: Testing and measurement are the fundamental requirements in all scientific
and engineering activities. The measuring equipment we use in laboratories to measure
parameters such as weight, temperature, pressure, humidity, voltage, current etc. are all
embedded systems. Test equipment such as oscilloscope, spectrum analyzer, logic analyzer,
protocol analyzer, radio communication test set etc. are embedded systems built around powerful
processors. Thank to miniaturization, the test and measuring equipment are now becoming
portable facilitating easy testing and measurement in the field by field-personnel.
Security: Security of persons and information has always been a major issue. We need to
protect our homes and offices; and also the information we transmit and store. Developing
embedded systems for security applications is one of the most lucrative businesses nowadays.
Security devices at homes, offices, airports etc. for authentication and verification are embedded
systems. Encryption devices are nearly 99 per cent of the processors that are manufactured end
up in~ embedded systems. Embedded systems find applications in every industrial segment-
consumer electronics, transportation, avionics, biomedical engineering, manufacturing, process
control and industrial automation, data communication, telecommunication, defense, security etc
Used to encrypt the data/voice being transmitted on communication links such as telephone lines.
Biometric systems using fingerprint and face recognition are now being extensively used for user
authentication in banking applications as well as for access control in high security buildings.
Finance: Financial dealing through cash and cheques are now slowly paving way for
transactions using smart cards and ATM (Automatic Teller Machine, also expanded as Any Time
Money) machines. Smart card, of the size of a credit card, has a small micro-controller and
memory; and it interacts with the smart card reader! ATM machine and acts as an electronic
wallet. Smart card technology has the capability of ushering in a cashless society. Well, the list
goes on. It is no exaggeration to say that eyes wherever you go, you can see, or at least feel, the
work of an embedded system.
2.5 Overview of Embedded System Architecture
Every embedded system consists of custom-built hardware built around a Central
Processing Unit (CPU). This hardware also contains memory chips onto which the software is
loaded. The software residing on the memory chip is also called the ‘firmware’. The embedded
system architecture can be represented as a layered architecture as shown in Fig.
The operating system runs above the hardware, and the application software runs above
the operating system. The same architecture is applicable to any computer including a desktop
computer. However, there are significant differences. It is not compulsory to have an operating
system in every embedded system. For small appliances such as remote control units, air
conditioners, toys etc., there is no need for an operating system and you can write only the
software specific to that application. For applications involving complex processing, it is
advisable to have an operating system. In such a case, you need to integrate the application
software with the operating system and then transfer the entire software on to the memory chip.
Once the software is transferred to the memory chip, the software will continue to run for a long
time you don’t need to reload new software.

Fig 2.1: Overview of Embedded System Architecture


Now, let us see the details of the various building blocks of the hardware of an embedded
system. As shown in Fig. the building blocks are:
· Central Processing Unit (CPU)
· Memory (Read-only Memory and Random Access Memory)
· Input Devices
· Output devices
· Communication interfaces
· Application-specific circuitry
Central Processing Unit (CPU): The Central Processing Unit (processor, in short) can be
any of the following: microcontroller, microprocessor or Digital Signal Processor (DSP).

Fig 2.2: Central Processing Unit (CPU)


A micro-controller is a low-cost processor. Its main attraction is that on the chip itself,
there will be many other components such as memory, serial communication interface, analog-to
digital converter etc. So, for small applications, a micro-controller is the best choice as the
number of external components required will be very less. On the other hand, microprocessors
are more powerful, but you need to use many external components with them. D5P is used
mainly for applications in which signal processing is involved such as audio and video
processing.
Memory: The memory is categorized as Random Access 11emory (RAM) and Read Only
Memory (ROM). The contents of the RAM will be erased if power is switched off to the chip,
whereas ROM retains the contents even if the power is switched off. So, the firmware is stored in
the ROM. When power is switched on, the processor reads the ROM; the program is program is
executed.
Input Devices: Unlike the desktops, the input devices to an embedded system have very
limited capability. There will be no keyboard or a mouse, and hence interacting with the
embedded system is no easy task. Many embedded systems will have a small keypad-you press
one key to give a specific command. A keypad may be used to input only the digits. Many
embedded systems used in process control do not have any input device for user interaction; they
take inputs from sensors or transducers 1’fnd produce electrical signals that are in turn fed to
other systems.
Output Devices: The output devices of the embedded systems also have very limited
capability. Some embedded systems will have a few Light Emitting Diodes (LEDs) to indicate
the health status of the system modules, or for visual indication of alarms. A small Liquid Crystal
Display (LCD) may also be used to display some important parameters.
Communication Interfaces: The embedded systems may need to, interact with other
embedded systems at they may have to transmit data to a desktop. To facilitate this, the
embedded systems are provided with one or a few communication interfaces such as RS232,
RS422, RS485, Universal Serial Bus (USB), IEEE 1394, Ethernet etc.
Application-specific Circuitry: Sensors, transducers, special processing and control
circuitry may be required fat an embedded system, depending on its application. This circuitry
interacts with the processor to carry out the necessary work. The entire hardware has to be given
power supply either through the 230 volts main supply or through a battery. The hardware has to
design in such a way that the power consumption is minimized.

Conclusions: Embedded Systems plays a vital role in our day today life. They are used
for household appliances like microwave oven to the satellite applications. They provide good
man to machine interface. Automation is the further step in the world of Embedded Systems,
which includes the elimination of the human being in the mundane applications. They are cost
effective, accurate and can work in any conditions and round the clock
CHAPTER 3
REVIEW OF LITERATURE

3.1 Block Diagram:

Battery

Micro DC Motor-1
Bluetooth controller Motor
Receiver driver
ATMEGA8 DC Motor-1

ANDROID
PHONE
Fig. block diagram of this project
Fig. block diagram for power supply

3.2 Microcontroller

3.2.1Microcontroller_ATMEGA8
Features
• High performance, low power Atmel
8-bit microcontroller
• Advanced RISC architecture
1. 131 powerful instructions – most single clock cycle execution
2. 32 × 8 general purpose working registers
3. Fully static operation
4. Up to 20 MIPS throughput at 20MHz
5. On-chip 2-cycle multiplier
• High endurance non-volatile memory segments
1. 4/8/16 Kbytes of in-system self-programmable flash program memory
2. 256/512/512 bytes EEPROM
3. 512/1K/1Kbytes internal SRAM
4. Write/erase cyles: 10,000 flash/100,000 EEPROM
5. Data retention: 20 years at 85°C/100 years at 25°C
6. Optional boot code section with independent lock bits
In-system programming by on-chip boot program
True read-while-write operation
1. Programming lock for software security
2. QTouchlibrary support
3. Capacitive touch buttons, sliders and wheels
4. QTouch and QMatrix acquisition
5. Up to 64 sense channels
• Peripheral features
1. Two 8-bit timer/counters with separate prescaler and compare mode
2. One 16-bit timer/counter with separate prescaler, compare mode, and capture mode
3. Real time counter with separate oscillator
4. Six PWM channels
5. 8-channel 10-bit ADC in TQFP and QFN/MLF package
6. 6-channel 10-bit ADC in PDIP Package
7. Programmable serial USART
8. Master/slave SPI serial interface
9. Byte-oriented 2-wire serial interface (Philips I
 C compatible)
1. Programmable watchdog timer with separate on-chip oscillator
2. On-chip analog comparator
3. Interrupt and wake-up on pin change

• Special microcontroller features


1. DebugWIRE on-chip debug system
2. Power-on reset and programmable brown-out detection
3. Internal calibrated oscillator
4. External and internal interrupt sources
5. Five sleep modes: Idle, ADC noise reduction, power-save, power-down, and standby
• I/O and packages
1. 23 programmable I/O lines
2. 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
• Operating voltage:
1. 1.8V - 5.5V for Atmel ATmega48V/88V/168V
2. 2.7V - 5.5V for Atmel ATmega48/88/168
• Temperature range:
1. 40°C to 85°C
• Speed grade:
2. ATmega48V/88V/168V: 0 - 4MHz @ 1.8V - 5.5V, 0 - 10MHz @ 2.7V - 5.5V
3. ATmega48/88/168: 0 - 10MHz @ 2.7V - 5.5V, 0 - 20MHz @ 4.5V - 5.5V
• Low power consumption
1. Active mode:
250µA at 1MHz, 1.8V
15µA at 32kHz, 1.8V (including oscillator)
2. Power-down mode:
0.1µA at 1.8V
3.3 Pin Diagram:

Pin descriptions
VCC
Digital supply voltage.
GND
Ground.
Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2 Port B is an 8-bit bi-directional I/O port with
internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical
drive characteristics with both high sink and source capability. As inputs, Port B pins that are
externallypulled low will source current if the pull-up resistors are activated. The Port B pins are
tri-stated when a reset condition becomes active, even if the clock is not running. Depending on
the clock selection fuse settings, PB6 can be used as input to the inverting Oscillator amplifier
and input to the internal clock operating circuit. Depending on the clock selection fuse settings,
PB7 can be used as output from the inverting Oscillator amplifier. If the Internal Calibrated RC
Oscillator is used as chip clock source, PB7..6 is used as TOSC2..1 input for the Asynchronous
Timer/Counter2 if the AS2 bit in ASSR is set.
The various special features of Port B are elaborated in “Alternate functions of port B”.
Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each
bit). The PC5..0 output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally pulled low will source current if the
pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes
active, even if the clock is not running.
PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical
characteristics of PC6 differ from those of the other pins of Port C.
If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin
for longer than the minimum pulse length will generate a Reset, even if the clock is not running.
The minimum pulse length is given in Table 29-3 on page 307. Shorter pulses are not guaranteed
to generate a Reset.
Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each
bit). The Port D output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port D pins that are externally pulled low will source current if the
pull-up ATmega48/88/168 resistors are activated. The Port D pins are tri-stated when a reset
condition becomes active,even if the clock is not running.
AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC through a low-pass filter. Note that PC6..4 use digital supply voltage, VCC
AREF
AREF is the analog reference pin for the A/D Converter.
1.1.9 ADC7:6 (TQFP and QFN/MLF package only)
In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter.
These pins are powered from the analog supply and serve as 10-bit ADC channels
Overview
The Atmel ATmega48/88/168 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/168 achieves throughputs approaching 1 MIPS per MHz allowing the system
designer to optimize power consumption versus processing speed.
Block Diagram:
The AVR 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), allowing two
independent registers to be accessed in one single instruction executedin one clock cycle. The
resulting architecture is more code efficient while achieving throughputs up to ten times faster
than conventional CISC microcontrollers.
The Atmel ATmega48/88/168 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
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.
Atmel offers the QTouch Library for embedding capacitive touch buttons, sliders and
wheels functionality into AVR microcontrollers. The patented charge-transfer signal acquisition
offers robust sensing and includes fully debounced reporting of touch keys and includes
Adjacent Key Suppression. technology for unambigiuous detection of key events. The easy-to-
use QTouch Suite toolchain allows you to explore, develop and debug your own touch
applications.
The device is manufactured using the Atmel 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. Software in the Boot Flash
section will continue to run while the Application Flash section is updated, providing true Read-
While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable
Flash on a monolithic chip, the Atmel ATmega48/88/168 is a powerful microcontroller that
provides a highly flexible and cost effective solution to many embedded control applications.
The ATmega48/88/168 AVR is supported with a full suite of program and system development
tools including: C Compilers, Macro Assemblers, Program Debugger/Simulators, In-Circuit
Emulators, and Evaluation kits.
Data retention Reliability Qualification results show that the projected data retention
failure rate is much less than 1 PPM over 20 years at 85°C or 100 years at 25°C.
About code examples
This documentation contains simple code examplesthat briefly show how to use various
parts of the device. These code examples assume that the part specific header file is included
before compilation. Be aware that not all C compiler vendors include bit definitions in the header
files and interrupt handling in C is compiler dependent. Please confirm with the C compiler
documentation for more details.
For I/O Registers located in extended I/O map, “IN”, “OUT”, “SBIS”, “SBIC”, “CBI”,
and “SBI” instructions must be replaced with instructions that allow access to extended I/O.
Typically “LDS” and “STS” combined with “SBRS”, “SBRC”, “SBR”, and “CBR”.

Capacitive touch sensing


The Atmel QTouch Library provides a simple to use solution to realize touch sensitive
interfaces on most Atmel AVR microcontrollers. The QTouch Library includes support for the
QTouch and QMatrix acquisition methods.
Touch sensing can be added to any application by linking the appropriate Atmel QTouch Library
for the AVR Microcontroller. This is done by using a simple set of APIs to define the touch
channels and sensors, and then calling the touch sensing API’s to retrieve the channel
information and determine the touch sensor states.

Architectural overview
In order to maximize performance and parallelism, the AVR uses a Harvard architecture – with
separate memories and buses for program and data. Instructions in the program memory are
executed with a single level pipelining. While one instruction is being executed, the next
instruction is pre-fetched from the program memory. This concept enables instructions to be
executed in every clock cycle. The program memory is In-System Reprogrammable Flash
memory.
The fast-access Register File contains 32 × 8-bit general purpose working registers with a
single clock cycle access time. This allows single-cycle Arithmetic Logic Unit (ALU) operation.
In a typical ALU operation, two operands are output from the Register File, the operation is
executed, and the result is stored back in the Register File – in one clock cycle.
Six of the 32 registers can be used as three 16-bit indirect address register pointers for
Data Space addressing – enabling efficient address calculations. One of the these address
pointers can also be used as an address pointer for look up tables in Flash program memory.
These added function registers are the 16-bit X-register, Y-register, and Z-register, described
later in this section. The ALU supports arithmetic and logic operations between registers or
between a constant and a register. Single register operations can also be executed in the ALU.
After an arithmetic operation, the Status Register is updated to reflect information about the
result of the operation. Program flow is provided by conditional and unconditional jump and call
instructions, able to directly address the whole address space. Most AVR instructions have a
single 16-bit word format. Every program memory address contains a 16-bit or 32-bit
instruction. Program Flash memory space is divided in two sections, the Boot Program section
and the Application Program section. Both sections have dedicated Lock bits for write and
read/write protection. The SPM instruction that writes into the Application Flash memory section
must reside in the Boot Program section.
During interrupts and subroutine calls, the return address Program Counter (PC) is stored
on the Stack. The Stack is effectively allocated in the general data SRAM, and consequently the
Stack size is only limited by the total SRAM size and the usage of the SRAM. All user programs
must initialize the SP in the Reset routine (before subroutines or interrupts are executed). The
Stack Pointer (SP) is read/write accessible in the I/O space. The data SRAM can easily be
accessed through the five different addressing modes supported in the AVR architecture. The
memory spaces in the AVR architecture are all linear and regular memory maps. A flexible
interrupt module has its control registers in the I/O space with an additional Global Interrupt
Enable bit in the StatusRegister. All interrupts have a separate Interrupt Vector in the Interrupt
Vector table. The interrupts have priority in accordance with their Interrupt Vector position. The
lower the Interrupt Vector address, the higher the priority.
The I/O memory space contains 64 addresses for CPU peripheral functions as Control
Registers, SPI, and other I/O functions. The I/O Memory can be accessed directly, or as the Data
Space locations following those of the Register File, 0x20 - 0x5F. In addition, the
ATmega48/88/168 has Extended I/O space from 0x60 - 0xFF in SRAM where only the
ST/STS/STD and LD/LDS/LDD instructions can be used.
ALU – Arithmetic Logic Unit
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.
Status register
The Status Register contains information about the result of the most recently executed
arithmetic instruction. This information can be used for altering program flow in order to
perform conditional operations. Note that the Status Register is updated after all ALU operations,
as specified in the Instruction Set Reference. This will in many cases remove the need for using
the dedicated compare instructions, resulting in faster and more compact code.
The Status Register is not automatically stored when entering an interrupt routine and
restored when returning from an interrupt. This must be handled by software. General purpose
register file The register file is optimized for the AVR enhanced RISC instruction set.
register file:
• One 8-bit output operand and one 8-bit result input
• Two 8-bit output operands and one 8-bit result input
• Two 8-bit output operands and one 16-bit result input
• One 16-bit output operand and one 16-bit result input
Figure 7-2shows the structure of the 32 general purpose working registers in the CPU.
Most of the instructions operating on the register file have direct access to all registers, and most
of them are single cycle instructions. directly into the first 32 locations of the userData Space.
AVR memories
This section describes the different memories in the Atmel ATmega48/88/168. The AVR
architecture has two main memory spaces, the Data Memory and the Program Memory space. In
addition, the ATmega48/88/168 features anEEPROM Memory for datastorage. All three memory
spaces are linear and regular. In-system reprogrammable flash program memory
The ATmega48/88/168 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
ATmega168. ATmega48 does not have separate Boot Loader and Application Program sections,
and the SPM instruction can be executed from the entire Flash. See SELFPRGEN description in
section “SPMCSR – Store program memory control and status register” The Flash memory has
an endurance of at least 10,000 write/erase cycles. The ATmega48/88/168 Program Counter (PC)
is 11/12/13 bits wide, thus addressing the 2K/4K/8K program memory locations. The operation
of Boot Program section and associated Boot Lock bits for software protection are described in
detail in “Self-programming the flash, Atmel ATmega48” on page 262and “Boot loader support
– Read-while-write self-programming, Atmel ATmega88 and Atmel ATmega168” on page 269.
“Memory programming” on page 285contains a detailed description on Flash Programming in
SPI- or Parallel Programming mode. Constant tables can be allocated within the entire program
memory address space (see the LPM
SRAM data memory
The ATmega48/88/168 is a complex microcontroller with more peripheral units than can
be supported within the 64 locations reserved in the Opcode for the IN and OUT instructions.
For the Extended I/O space from 0x60 - 0xFF in SRAM, only the ST/STS/STD and
LD/LDS/LDD instructions can be used.
The lower 768/1280/1280 data memory locations address both the Register File, the I/O
memory, Extended I/O memory, and the internal data SRAM. The first 32 locations address the
Register File, the next 64 location the standard I/O memory, then 160 locations of Extended I/O
memory, and the next 512/1024/1024 locations address the internal data SRAM. The five
different addressing modes for the data memory cover: Direct, Indirect with Displacement,
Indirect, Indirect with Pre-decrement, and Indirect with Post-increment. In the Register File,
registers R26 to R31 feature the indirect addressing pointer registers.
The direct addressing reaches the entire data space. The Indirect with Displacement mode
reaches 63 address locations from the base address given by the Y-register or Z-register.
When using register indirect addressing modes with automatic pre-decrement and post-
increment, the address registers X, Y, and Z are decremented or incremented.

Data memory access times


This section describes the general access timing concepts for internal memory access.

EEPROM data memory


The Atmel ATmega48/88/168 contains 256/512/512 bytes of data EEPROM memory. It
is organized as a separate data space, in which single bytes can be read and written. The
EEPROM has an endurance of at least 100,000 write/erase cycles. The access 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.

EEPROM read/write access


The EEPROM Access Registers are accessible in the I/O space.
The write access time for the EEPROM is given in Table 8-2 on page 24. A self-timing function,
however, lets the user software detect when the next byte can be written. If the user code
contains instructions that write the EEPROM, some precautions must be taken. In heavily
filtered power supplies, VCC is likely to rise or fall slowly on power-up/down. This causes the
device for some period of time to run at a voltage lower than specified as minimum for the clock
frequency used. See “Preventing EEPROM corruption” on page 20for details on how to avoid
problems in these situations. In order to prevent unintentional EEPROM writes, a specific write
procedure must be followed. Refer to the description ofthe EEPROM Control Register for
detailson this. When the EEPROM is read, the CPU is halted for four clock cycles before the
next instruction is executed. When the EEPROM is written, the CPU is halted for two clock
cycles before the next instruction is executed.

Preventing EEPROM corruption


During periods of low VCC, the EEPROM data can be corrupted because the supply
voltage is too low for the CPU and the EEPROM to operate properly. These issues are the same
as for board level systems using EEPROM, and the same design solutions should be applied.
Clk ,WR,RD,Data,Data,Address Address valid,T1 T2 T3,Compute address,Read
Write,CPU,Memory access instruction Next instruction
ATmega48/88/168
An EEPROM data corruption can be caused by two situations when the voltage is too
low. First, a regular write sequence to the EEPROM requires a minimum voltage to operate
correctly. Secondly, the CPU itself can execute instructions incorrectly, if the supply voltage is
too low. EEPROM data corruption can easily be avoided by following this design
recommendation: Keep the AVR RESET active (low) during periods of insufficient power
supply voltage. This can be done by enabling the internal Brown-out Detector (BOD). If the
detection level of the internal BOD does not match the needed detection level, an external low
VCCreset Protection circuit can be used. If a reset occurs while a write operation is in progress,
the write operation will be completed provided that the power supply voltage is sufficient.
I/O memory
All ATmega48/88/168 I/Os and peripherals are placed in the I/O space. All I/O locations
may be accessed by the LD/LDS/LDD and ST/STS/STD instructions, transferring data between
the 32 general purpose working registers and the I/O space. I/O Registers within the address
range 0x00 - 0x1F are directly bit-accessible using the SBI and CBI instructions. In these
registers, the value of single bits can be checked by using the SBIS and SBIC instructions. Refer
to “Instruction set summary” on page 347for more details. When using the I/O specific
commands IN and OUT, the I/O addresses 0x00 - 0x3F must be used. When addressing I/O
Registers as data space using LD and ST instructions, 0x20 must be added to these addresses.
The ATmega48/88/168 is a complex microcontroller with more peripheral units than can be
supported within the 64 location reserved in Opcode for the IN and OUT instructions. For the
Extended I/O space from 0x60 - 0xFF in SRAM, only the ST/STS/STD and LD/LDS/LDD
instructions can be used. For compatibility with future devices, reservedbits should be written to
zero if accessed. Reserved I/O memory addresses should never be written.
Some of the Status Flags are cleared by writing a logical one to them. Note that, unlike most
other AVRs, the CBI and SBI instructions will onlyoperate on the specified bit, and can therefore
be used on registers containing such Status Flags. The CBI and SBI instructions work with
registers 0x00 to 0x1F only. The I/O and peripherals control registers are explained in later
sections.
General purpose I/O registers
The ATmega48/88/168 contains three General Purpose I/O Registers. These registers can
be used for storing any information, and they are particularly useful for storing global variables
and Status Flags. General Purpose I/O Registers within the address range 0x00 - 0x1F are
directly bit-accessible using the SBI, CBI, SBIS, and SBIC instructions.
System clock and clock options
Clock systems and their distribution
Need not be active at a given time. In order to reduce power consumption, the clocks to modules
not being used can be halted by using different sleep modes, as described in “Power management
and sleep modes”
CPU clock – clkCPU
The CPU clock is routed to parts of the system concerned with operation of the AVR core.
Examples of such modules are the General Purpose Register File, the Status Register and the
data memory holding the Stack Pointer. Halting the CPU clock inhibits the core from performing
general operations and calculations.

I/O clock – clkI/O


The I/O clock is used by the majority of the I/O modules, like Timer/Counters, SPI, and
USART. The I/O clock is also used by the External Interrupt module, but note that some external
interrupts are detected by asynchronous logic, allowing such interrupts to be detected even if the
I/O clock is halted. Also note that start condition detection in the USI module is carried out
asynchronously when clkI/O is halted, TWI address recognition in all sleep modes.
Asynchronous timer clock – clkASY
The Asynchronous Timer clock allows the Asynchronous Timer/Counter to be clocked directly
from an external clock or an external 32kHz clock crystal. The dedicated clock domain allows
using this Timer/Counter as a real-time counter even when the device is in sleep mode.

ADC clock – clkADC


The ADC is provided with a dedicated clock domain. This allows halting the CPU and I/O
clocks in order to reduce noise generated by digital circuitry. This gives more accurate ADC
conversion results.
Clock sources
The device has the following clock source options, selectable by Flash Fuse bits as shown
below. The clock from the selected source is input to the AVR clock generator, and routed to the
appropriate modules.
Default clock source
The device is shipped with internal RC oscillator at 8.0MHz and with the fuse CKDIV8
programmed, resulting in 1.0MHz system clock. The startup time is set to maximum and time-
out period enabled. (CKSEL = "0010", SUT = "10", CKDIV8 = "0"). The default setting ensures
that all users can make their desired clock source setting using any available programming
interface.

Clock startup sequence


Any clock source needs a sufficient VCC to start oscillating and a minimum number of
oscillating cycles before it can be considered stable. describes the start conditions for the
internal reset. The delay (tTOUT) is timed from the Watchdog Oscillator and the number of
cycles in the delay is set by the SUTx and CKSELx fuse bits.
Low power crystal oscillator
Pins XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier
crystal or a ceramic resonator may be used.
This Crystal Oscillator is a low power oscillator, with reduced voltage swing on the XTAL2
output. It gives the lowest power consumption, but is not capable of driving other clock inputs,
and C1 and C2 should always be equal for both crystals and resonators. The optimal value of the
capacitors depends on the crystal or resonator in use, the amount of stray capacitance, and the
electromagnetic noise of the environment. Some initial guidelines for choosing capacitors for use
with crystals are given in ceramic resonators, the capacitor values given by the manufacturer
should be used.

Full swing crystal oscillator


Pins XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier which can
be configured for use as an On-chip Oscillator, as shown in Figure 9-2 on page 30. Either a
quartz crystal or a ceramic resonator may be used.
This Crystal Oscillator is a full swing oscillator, with rail-to-rail swing on the XTAL2 output.
This is useful for driving other clock inputs and in noisy environments. The current consumption
is higher than the “Low power crystal oscillator” on page 29. Note that the Full Swing Crystal
Oscillator will only operate for VCC= 2.7V - 5.5V.
C1 and C2 should always be equal for both crystals and resonators. The optimal value of the
capacitors depends on the crystal or resonator in use, the amount of stray capacitance, and the
electromagnetic noise of the environment.

External clock
To drive the device from an external clock source, XTAL1
Clock output buffer
The device can output the system clock on the CLKO pin. To enable the output, the
CKOUT
Fuse has to be programmed. This mode is suitable when the chip clock is used to drive other
circuits on the system. The clock also will be output during reset, and the normal operation of
I/O pin will be overridden when the fuse is programmed. Any clock source, including the
internal RC.
Timer/counter oscillator
The device can operate its Timer/Counter2 from anexternal 32.768kHz watch crystal or a
external clock source. The Timer/Counter Oscillator Pins (TOSC1 and TOSC2) are shared with
XTAL1 and XTAL2. This means that the Timer/Counter Oscillator can only be used when an
internal RC Oscillator is selected as system clock source. See Figure 9-2 on page 30for crystal
connection.
Applying an external clock source to TOSC1 requires EXTCLK in the ASSR Register written to
logic one. See “Asynchronous operation of Timer/Counter2” on page 151for further description
on selecting external clock as input instead of a 32kHz crystal.
System clock prescaler
The Atmel ATmega48/88/168 has a system clock prescaler, and the system clock can be
divided by setting the “CLKPR – Clock prescale register” on page 37. This feature can be used
to decrease the system clock frequency and the power consumption when the requirement for
processing power is low. This can be used with all clock source options, and it will affect the
When switching between prescaler settings, the System Clock Prescaler ensures that no glitches
occurs in the clock system. It also ensures that no intermediate frequency is higher than neither
the clock frequency corresponding to the previous setting, nor the clock frequency corresponding
to the new setting. The ripple counter that implements the prescaler runs at the frequency of the
undivided clock, which may be faster than the CPU's clock frequency. Hence, it is not possible to
determine the state of the prescaler - even if it were readable, and the exact time it takes to switch
from one clock division to the other cannot be exactly predicted. From the time the CLKPS
values are written, it takes between T1 + T2 and T1 + 2 ×T2 before the new clock frequency is
active. In this interval, two active clock edges are produced. Here, T1 is the previous clock
period, and T2 is the period corresponding to the new prescaler setting.
3.3 DC Motor

DC motors seem quite simple. Apply a voltage to both terminals, and it will spins. DC
motors are non-polarized which means that it can reverse voltage so the motor will rotate in two
directions, forward and backward. Typical DC motors are rated from about 6V-12V. The larger
ones are often 24V or more but for the purpose of this project, it is necessary to use 6V-12V
range motor. Voltage is directly related to motor torque. The more voltage supplied, the higher
the torque will be produce. Specifications of most DC motors show high revolutions per minute
(rpm) and low torque. The DC motor is popular in a number of drive applications due to its
simple operation and control. By referring it has 2 main parts which is rotor and stator. Stator
is the part where the permanent magnet situated and used to generate the magnetic field and it
is static. Rotor is the rotary part in the motor and contains block of core and wire loops. It also
called the armature.
The rotor is placed inside the magnetic field caused by two permanent magnets. By
referring to the situation, both sides of the wire loop will have a force on them. Trying to make
the wire loop rotate. The current is applied to the loop through the commentator, which is shown
as two pieces of metal formed into a ring in the figure. Current is applied to the commentator by
stationary graphite blocks, called brushes, which rub against the commentator ring. The loop will
continue to rotate anticlockwise until it is vertical. At this point, the stationary brushes won’t be
applying current around the loop anymore because they will be contacting the gap between the
commentator segments, but the inertia of the loop keeps it going little more, until the DC supply
reconnects to the commentator segments, and the current then goes around the loop in the
opposite direction. The force though is still in the same direction. and the loop continues to
rotate.

Figure : The Operation of DC Motor

3.3.1 DC Motor Voltage

DC motors are non-polarized - meaning that one can reverse voltage without any bad
things happening. Typical DC motors are rated from about 6V-12V. The larger ones are often
24V or more. But for the purposes of this project, do stay in the 6V-12V range. It is stated that
voltage is directly related to motor torque. High voltage produces higher torque. A DC motor
is rated at the voltage it is most efficient at running. If very few volts are applied, it just won't
work. If too much is applied, it will overheat and the coils will melt. So the general rule is to
apply as close to the rated voltage of the motor. But do not surpass 12V motors unless the
torque is required badly.

3.3.2 DC Motor Current

As with all circuitry, one must pay attention to current. Too little, and it just won't work.
Too much, the motor will meltdown. When buying a motor, there are two current ratings one
should pay attention to. The first is operating current. This is the average amount of current the
motor is expected to draw under a typical torque. Multiply this number by the rated voltage
and the average power draw required to run the motor is obtained. The other current rating
which one needs to pay attention to is the stall current. This is when the motor is power up, and
enough torque is put to force it to stop rotating. This is the maximum amount of current themotor
will ever draw, and hence the maximum amount of power too. So, one must design all control
circuitry capable of handling this stall current. Also, if the motor is constantly run, or run it
higher than the rated voltage, it is wise to heat sink to keep the motor's coils from melting.

3.3.3 DC Motor Power Rating

Basically, all motors are rated at certain wattage. Wattage is energy. Inefficiency of
energy conversion directly relates to heat output. Too much heat, the motor coils melt. So the
manufacturers of motors know how much wattage will cause motor failure, and post this on the
motor specification sheets. The equation is:

Power (watts) = Voltage * Current

Increase voltage and measure current until the power is about -90% below the given power
rating.

3.3.4 DC Motor Torque

Torque is defined as that force which tends to produce and maintain rotation. The
function of torque in a DC motor is to provide the mechanical output or drive the piece of
equipment that the DC motor is attached to. There are two torque value ratings which must been
pay attention to. The first is the operating torque. This is the torque theft or was designed to give.
Usually it is the listed torque value. The other rated value is stall torque. This is the torque
required to stop the motor from rotating. He torque which is developed by the motor can be
determined using Equation:

T = KQI,

Where

T = torque

K = a constant depending on physical size of motor

Q = field flux, number of lines of force per pole

I = armature current

When buying a DC motor, there are two torque value ratings which must be Pay attention
to. The first is operating torque. This is the torque the motor was designed to give. Usually it is
the listed torque value. The other rated value is stall torque. This is the torque required to stop the
motor from rotating. If one need a little more speed, going 20% above the rated motor voltage
value is fairly safe. But, that this is less efficient, and the motor should be heat- sinker.

Velocity is very complex when it comes to DC motors. The general rule is motors run the
most efficient when run at the highest possible speeds. Obviously however this is not possible.
There are times to run the motor slowly. Just like car, it won't to keep the car constantly at high
speed. The voltage and applied torque resistance obviously also affects speed.

PMDC motor

This motor using for this project PMDC motor In a dc motor, an armature rotates inside
a magnetic field. Basic working principle of DC motor is based on the fact that whenever
a current carrying conductor is placed inside magnetic, there will be mechanical force
experienced by that conductor. All kinds of DC work in this principle only. Hence for
constructing a dc motor it is essential to establish a magnetic field. The magnetic field is
obviously established by means of magnet. The magnet can by any types i.e. it may be
electromagnet or it can be permanent magnet. When permanent magnet is used to
create magnetic field in a DC motor, the motor is referred as permanent magnet dc
motor or PMDC motor. Have you ever uncovered any battery operated toy, if you did, you had
obviously found a battery-operated motor inside it. This battery operated motor is nothing but
a permanent magnet dc motor or PMDC motor. These types of motor are essentially simple in
construction. These motors are commonly used as starter motor in automobiles, windshield
wipers, washer, for blowers used in heaters and air conditioners, to raise and lower windows, it
also extensively used in toys. As the magnetic field strength of a permanent magnet is fixed it
cannot be controlled externally, field control of this type of dc motor cannot be possible. Thus
permanent magnet dc motor is used where there is no need of speed control of motor by means
of controlling its field. Small fractional and sub fractional kW motors now constructed with
permanent magnet.

Construction of Permanent Magnet DC Motor or PMDC Motor

As it is indicated in name of permanent magnet dc motor, the field poles of this motor are
essentially made of permanent magnet.

A PMDC motor mainly consists of two parts. A stator and an armature. Here the stator
which is a steel cylinder. The magnets are mounted in the inner periphery of this cylinder. The
permanent magnets are mounted in such a way that the N – pole and S – pole of each magnet are
alternatively faced towards armature as shown in the figure below. That means, if N – pole of
one magnet is faced towards armature then S – pole of very next magnet is faced towards
armature.

In addition to holding the magnet on its inner periphery, the steel cylindrical stator also
serves as low reluctance return path for the magnetic flux. Although field coil is not required in
permanent magnet dc motor but still it is sometimes found that they are used along with
permanent magnet. This is because if permanent magnets lose their strength, these lost magnetic
strengths can be compensated by field excitation through these field coils. Generally, rare earth
hard magnetic materials are used for these permanent magnet.

The rotor of PMDC motor is similar to other DC motor. The rotor or armature of
permanent magnet dc motor also consists of core, windings and commentator. Armature core is
made of number of varnish insulated, slotted circular lamination of steel sheets. By fixing these
circular steel sheets one by one, a cylindrical shaped slotted armature core is formed. The varnish
insulated laminated steel sheets are used to reduce eddy current loss in armature of permanent
magnet dc motor. These slots on the outer periphery of the armature core are used for housing
armature conductors in them. The armature conductors are connected in a suitable manner which
gives rise to armature winding. The end terminals of the winding are connected to the
commentator segments placed on the motor shaft. Like other dc motor, carbon or graphite
brushes are placed with spring pressure on the commentator segments to supply current to the
armature.

Working Principle of Permanent Magnet DC Motor or PMDC Motor

As we said earlier the working principle of PMDC motor is just similar to the general
working. That is when a carrying conductor comes inside a magnetic field, a mechanical force
will be experienced by the conductor and the direction of this force is governed by Fleming’s left
hand rule. As in a permanent magnet dc motor, the armature is placed inside the magnetic
field of permanent magnet; the armature rotates in the direction of the generated force. Here each
conductor of the armature experiences the mechanical force F = B.I.L Newton where B is
the magnetic field strength in Tesla (weber / m2), I is the current in Ampere flowing through that
conductor and L is length of the conductor in metre comes under the magnetic field. Each
conductor of the armature experiences a force and the compilation of those forces produces a
torque, which tends to rotate the armature.

Equivalent Circuit of Permanent Magnet DC Motor or PMDC Motor

As in PMDC motor the field is produced by permanent magnet, there is no need of


drawing field coils in the equivalent circuit of permanent magnet dc motor. The supply voltage to
the armature will have armature resistance drop and rest of the supply voltage is countered by
back emf of the motor. Hence voltage equation of the motor is given by,

Where I, is armature current and R is armature resistance of the motor.


Eb is the back emf and V is the supply voltage.

Advantages of Permanent Magnet DC Motor or PMDC Motor

PMDC motor has some advantages over other types of dc motors. They are :

 No need of field excitation arrangement.


 No input power in consumed for excitation which improves efficiency of dc motor.
 No field coil hence space for field coil is saved which reduces the overall size of the
motor.
 Cheaper and economical for fractional kW rated applications.

Disadvantages of Permanent Magnet DC Motor or PMDC Motor

 In this case, the armature reaction of DC motor cannot be compensated hence the
magnetic strength of the field may get weak due to demagnetizing effect armature
reaction.
 There is also a chance of getting the poles permanently demagnetized (partial) due to
excessive armature current during starting, reversal and overloading condition of the
motor.
 Another major disadvantage of PMDC motor is that, the field in the air gap is fixed and
limited and it cannot be controlled externally. Therefore, very efficient speed control of
DC motor in this type of motor is difficult.

Applications of Permanent Magnet DC Motor or PMDC Motor

PMDC motor is extensively used where small dc motors are required and also very
effective control is not required, such as in automobiles starter, toys, wipers, washers, hot
blowers, air conditioners, computer disc drives and in many more.

3.4 MOTOR DRIVER (L293D):

Introduction:
The L293D motor driver is available for providing User with ease and user friendly
interfacing for embedded application. L293D motor driver is mounted on a good quality, single
sided non-PTH PCB. The pins of L293D motor driver IC are connected to connectors for easy
access to the driver IC’s pin functions. The L293D is a Dual Full Bridge driver that can drive up
to 1Amp per bridge with supply voltage up to 24V. It can drive two DC motors, relays,
solenoids, etc. The device is TTL compatible. Two H bridges of L293D can be connected in
parallel to increase its current capacity to 2 Amp.
Features: ·
Easily compatible with any of the system · Easy interfacing through FRC (Flat Ribbon
Cable) · External Power supply pin for Motors supported · Onboard PWM (Pulse Width
Modulation) selection switch · 2pin Terminal Block (Phoenix Connectors) for easy Motors
Connection · Onboard H-Bridge base Motor Driver IC (L293D)
Technical Specification:
1. Power Supply: Over FRC connector 5V DC
External Power 9V to 24V DC
2. Dimensional Size : 44mm x 37mm x 14mm (l x b x h)
3. · Temperature Range: 0°C to +70 °C.
L293D IC: The driver IC L293D is quad push-pull drivers capable of delivering output
currents to 1A per channel respectively. Each channel is controlled by a TTL-compatible logic
input and each pair of drivers (a full bridge) is equipped with an inhibit input available at pin 1
and pin 9. The motor will run only when chip inhibit is at high logic i.e. chip inhibit is enabled.

3.5 BATTERY:

An electric battery is a device consisting of two or more electrochemical cells that


convert stored chemical energy into electrical energy. Each cell has a positive terminal,
or cathode, and a negative terminal, or anode. The terminal marked positive is at a higher
electrical potential energy than is the terminal marked negative. The terminal marked positive is
the source of electrons that when connected to an external circuit will flow and deliver energy to
an external device. When a battery is connected to an external circuit,Electrolytes are able to
move as ions within, allowing the chemical reactions to be completed at the separate terminals
and so deliver energy to the external circuit. It is the movement of those ions within the battery
which allows current to flow out of the battery to perform work. Although the
term battery technically means a device with multiple cells, single cells are also popularly called
batteries.

Primary (single-use or "disposable") batteries are used once and discarded; the electrode
materials are irreversibly changed during discharge. Common examples are the alkaline
battery used for flashlights and a multitude of portable devices. Secondary(rechargeable
batteries) can be discharged and recharged multiple times; the original composition of the
electrodes can be restored by reverse current. Examples include the lead-acid batteries used in
vehicles and lithium ion batteries used for portable electronics.

Batteries come in many shapes and sizes, from miniature cells used to power hearing
aids and wristwatches to battery banks the size of rooms that provide standby power
for telephone exchanges and computer data centers.

Electronic symbol
Virtual batteries

PRINCIPLE OF OPERATION

Batteries convert chemical energy directly to electrical energy. A battery consists of some
number of voltaic cells. Each cell consists of twohalf-cells connected in series by a conductive
electrolyte containing anions and cations. One half-cell includes electrolyte and the negative
electrode, the electrode to which anions (negatively charged ions) migrate; the other half-cell
includes electrolyte and the positive electrode to which cations (positively charged ions)
migrate. Redox reactions power the battery. Cations are reduced (electrons are added) at the
cathode during charging, while anions are oxidized (electrons are removed) at the anode during
charging. During discharge, the process is reversed. The electrodes do not touch each other, but
are electrically connected by the electrolyte. Some cells use different electrolytes for each half-
cell. A separator allows ions to flow between half-cells, but prevents mixing of the electrolytes.

Each half-cell has an electromotive force (or emf), determined by its ability to drive
electric current from the interior to the exterior of the cell. The net emf of the cell is the
difference between the emfs of its half-cells. Thus, if the electrodes have emfs and , then
the net emf is ; in other words, the net emf is the difference between the reduction
potentials of the half-reactions.

The electrical driving force or across the terminals of a cell is known as the terminal
voltage (difference) and is measured in volts. The terminal voltage of a cell that is neither
charging nor discharging is called the open-circuit voltage and equals the emf of the cell.
Because of internal resistance, the terminal voltage of a cell that is discharging is smaller in
magnitude than the open-circuit voltage and the terminal voltage of a cell that is charging
exceeds the open-circuit voltage.

An ideal cell has negligible internal resistance, so it would maintain a constant terminal
voltage of until exhausted, then dropping to zero. If such a cell maintained 1.5 volts and stored
a charge of one coulomb then on complete discharge it would perform 1.5 joules of work. In
actual cells, the internal resistance increases under discharge and the open circuit voltage also
decreases under discharge. If the voltage and resistance are plotted against time, the resulting
graphs typically are a curve; the shape of the curve varies according to the chemistry and internal
arrangement employed.

The voltage developed across a cell's terminals depends on the energy release of the
chemical reactions of its electrodes and electrolyte. Alkaline and zinc–carbon cells have different
chemistries, but approximately the same emf of 1.5 volts; likewise NiCd and NiMH cells have
different chemistries, but approximately the same emf of 1.2 volts. [18] The high electrochemical
potential changes in the reactions of lithium compounds give lithium cells emfs of 3 volts or
more

TYPES OF BATTERIES

Batteries are classified into primary and secondary forms.

 Primary batteries irreversibly transform chemical energy to electrical energy. When the
supply of reactants is exhausted, energy cannot be readily restored to the battery.
 Secondary batteries can be recharged; that is, they can have their chemical reactions reversed
by supplying electrical energy to the cell, approximately restoring their original composition.

Some types of primary batteries used, for example, for telegraph circuits, were restored to
operation by replacing the electrodes. Secondary batteries are not indefinitely rechargeable due
to dissipation of the active materials, loss of electrolyte and internal corrosion

Primary batteries

Primary batteries, or primary cells, can produce current immediately on assembly. These
are most commonly used in portable devices that have low current drain, are used only
intermittently, or are used well away from an alternative power source, such as in alarm and
communication circuits where other electric power is only intermittently available. Disposable
primary cells cannot be reliably recharged, since the chemical reactions are not easily reversible
and active materials may not return to their original forms. Battery manufacturers recommend
against attempting to recharge primary cells.

In general, these have higher energy densities than rechargeable batteries, but disposable
batteries do not fare well under high-drain applications with loads under 75 ohms (75 Ω).
Common types of disposable batteries include zinc–carbon batteries and alkaline batteries.

Secondary batteries

Secondary batteries, also known as secondary cells, or rechargeable batteries, must be


charged before first use; they are usually assembled with active materials in the discharged state.
Rechargeable batteries are (re)charged by applying electric current, which reverses the chemical
reactions that occur during discharge/use. Devices to supply the appropriate current are called
chargers.

The oldest form of rechargeable battery is the lead–acid battery. This technology contains
liquid electrolyte in an unsealed container, requiring that the battery be kept upright and the area
be well ventilated to ensure safe dispersal of the hydrogen gas it produces during overcharging.
The lead–acid battery is relatively heavy for the amount of electrical energy it can supply. Its low
manufacturing cost and its high surge current levels make it common where its capacity (over
approximately 10 Ah) is more important than weight and handling issues. A common application
is the modern car battery, which can, in general, deliver a peak current of 450 amperes.

The sealed valve regulated lead–acid battery (VRLA battery) is popular in the automotive
industry as a replacement for the lead–acid wet cell. The VRLA battery uses an
immobilized sulfuric acid electrolyte, reducing the chance of leakage and extending shelf life.
VRLA batteries immobilize the electrolyte. The two types are:

 Gel batteries (or "gel cell") use a semi-solid electrolyte.


 Absorbed Glass Mat (AGM) batteries absorb the electrolyte in a special fiberglass matting.

Other portable rechargeable batteries include several sealed "dry cell" types, that are useful
in applications such as mobile phones and laptop computers. Cells of this type (in order of
increasing power density and cost) include nickel–cadmium (NiCd), nickel–zinc (NiZn), nickel
metal hydride (NiMH), and lithium-ion (Li-ion) cells. Li-ion has by far the highest share of the
dry cell rechargeable market. NiMH has replaced NiCd in most applications due to its higher
capacity, but NiCd remains in use in power tools, two-way radios, and medical equipment.

Recent developments include batteries with embedded electronics such as USBCELL,


which allows charging an AA battery through a USB connector, nanoball batteries that allow for
a discharge rate about 100x greater than current batteries, and smart battery packs with state-of-
charge monitors and battery protection circuits that prevent damage on over-discharge. Low self-
discharge (LSD) allows secondary cells to be charged prior to shipping.

Battery cell types

Many types of electrochemical cells have been produced, with varying chemical
processes and designs, including galvanic cells, electrolytic cells, fuel cells, flow cells and
voltaic piles.

Wet cell3

A wet cell battery has a liquid electrolyte. Other names are flooded cell, since the liquid
covers all internal parts, or vented cell, since gases produced during operation can escape to the
air. Wet cells were a precursor to dry cells and are commonly used as a learning tool
for electrochemistry. They can be built with common laboratory supplies, such asbeakers, for
demonstrations of how electrochemical cells work. A particular type of wet cell known as
a concentration cell is important in understanding corrosion.

Wet cells may be primary cells (non-rechargeable) or secondary cells (rechargeable).


Originally, all practical primary batteries such as the Daniell cell were built as open-top glass jar
wet cells. Other primary wet cells are the Leclanche cell, Grove cell, Bunsen cell, Chromic acid
cell, Clark cell, and Weston cell. The Leclanche cell chemistry was adapted to the first dry cells.
Wet cells are still used in automobile batteries and in industry for standby power for switchgear,
telecommunication or large uninterruptible power supplies, but in many places batteries with gel
cells have been used instead. These applications commonly use lead–acid or nickel–
cadmium cells.

Dry cell

Line art drawing of a dry cell:


1. brass cap, 2. plastic seal, 3. expansion space, 4. porous cardboard, 5. zinc can, 6. carbon rod, 7.
chemical mixture.

A dry cell uses a paste electrolyte, with only enough moisture to allow current to flow.
Unlike a wet cell, a dry cell can operate in any orientation without spilling, as it contains no free
liquid, making it suitable for portable equipment. By comparison, the first wet cells were
typically fragile glass containers with lead rods hanging from the open top and needed careful
handling to avoid spillage. Lead–acid batteries did not achieve the safety and portability of the
dry cell until the development of the gel battery.
A common dry cell is the zinc–carbon battery, sometimes called the dry Leclanché cell,
with a nominal voltage of 1.5 volts, the same as thealkaline battery (since both use the
same zinc–manganese dioxide combination).

A standard dry cell comprises a zinc anode, usually in the form of a cylindrical pot, with
a carbon cathode in the form of a central rod. The electrolyte is ammonium chloride in the form
of a paste next to the zinc anode. The remaining space between the electrolyte and carbon
cathode is taken up by a second paste consisting of ammonium chloride and manganese dioxide,
the latter acting as a depolariser. In some designs, the ammonium chloride is replaced by zinc
chloride.

Molten salt

Molten salt batteries are primary or secondary batteries that use a molten salt as
electrolyte. They operate at high temperatures and must be well insulated to retain heat.

Reserve

A reserve battery can be stored unassembled (unactivated and supplying no power) for a
long period (perhaps years). When the battery is needed, then it is assembled (e.g., by adding
electrolyte); once assembled, the battery is charged and ready to work. For example, a battery for
an electronic artillery fuze might be activated by the impact of firing a gun: The acceleration
breaks a capsule of electrolyte that activates the battery and powers the fuze's circuits. Reserve
batteries are usually designed for a short service life (seconds or minutes) after long storage
(years). A water-activated battery for oceanographic instruments or military applications
becomes activated on immersion in water.

Battery cell performance

A battery's characteristics may vary over load cycle, over charge cycle, and over lifetime
due to many factors including internal chemistry, current drain, and temperature.

Capacity and Discharge

A battery's capacity is the amount of electric charge it can deliver at the rated voltage.
The more electrode material contained in the cell the greater its capacity. A small cell has less
capacity than a larger cell with the same chemistry, although they develop the same open-circuit
voltage. Capacity is measured in units such as amp-hour (A·h).

The rated capacity of a battery is usually expressed as the product of 20 hours multiplied
by the current that a new battery can consistently supply for 20 hours at 68 °F (20 °C), while
remaining above a specified terminal voltage per cell. For example, a battery rated at 100 A·h
can deliver 5 A over a 20-hour period at room temperature.

The fraction of the stored charge that a battery can deliver depends on multiple factors,
including battery chemistry, the rate at which the charge is delivered (current), the required
terminal voltage, the storage period, ambient temperature and other factors.

The higher the discharge rate, the lower the capacity. The relationship between current,
discharge time and capacity for a lead acid battery is approximated (over a typical range of
current values) by Peukert's law:

where

is the capacity when discharged at a rate of 1 amp.


is the current drawn from battery (A).
is the amount of time (in hours) that a battery can sustain.
is a constant around 1.3.

Batteries that are stored for a long period or that are discharged at a small fraction of the
capacity lose capacity due to the presence of generally irreversible side reactions that consume
charge carriers without producing current. This phenomenon is known as internal self-discharge.
Further, when batteries are recharged, additional side reactions can occur, reducing capacity for
subsequent discharges. After enough recharges, in essence all capacity is lost and the battery
stops producing power.

Internal energy losses and limitations on the rate that ions pass through the electrolyte
cause battery efficiency to vary. Above a minimum threshold, discharging at a low rate delivers
more of the battery's capacity than at a higher rate.
Installing batteries with varying A·h ratings does not affect device operation (although it
may affect the operation interval) rated for a specific voltage unless load limits are exceeded.
High-drain loads such as digital cameras can reduce total capacity, as happens with alkaline
batteries. For example, a battery rated at 2 A·h for a 10- or 20-hour discharge would not sustain a
current of 1 A for a full two hours as its stated capacity implies.

Storage

Battery life can be extended by storing the batteries at a low temperature, as in


a refrigerator or freezer, which slows the side reactions. Such storage can extend the life of
alkaline batteries by about 5%; rechargeable batteries can hold their charge much longer,
depending upon type. To reach their maximum voltage, batteries must be returned to room
temperature; discharging an alkaline battery at 250 mA at 0 °C is only half as efficient as at
20 °C. Alkaline battery manufacturers such as Duracell do not recommend refrigerating
batteries.

Battery sizes

Primary batteries readily available to consumers range from tiny button cells used for
electric watches, to the No. 6 cell used for signal circuits or other long duration applications.
Secondary cells are made in very large sizes; very large batteries can power a submarine or
stabilize an electrical grid and help level out peak loads.

3.6 ANDROID

Controlling a robot with a mobile device like smartphone or a tablet that runs Android
OS must meet at least two conditions: to have an accelerometer and Bluetooth module. Almost
all types and versions of mobile devices have included this type of sensors and communication
technology. I said ‘at least two conditions’ because the imagination of users may exceed the
boundaries of usually controlling methods in order to control robots in different ways like using
sounds or using the visual robotic system.

Even is used the accelerometer or the Bluetooth technology, an application has to be


developed to run on the Android device. This application can be designed from scratch or using
tools designed to build Android applications without any programming language skills. In the
following are available kits and tutorials used for inspiration to build the application to control
the robot.

First were the computers, meanwhile the smartphones and tablets are becoming all-in-one
devices with useful features like communication, maps, and electro-mechanical machine control.
Why? Because these are an incredible inventory of technologies used to control robots including
sensors like GPS, accelerometer, Bluetooth, screen sensitivity to touch, powerful processor,
camera, application development with free toolkit, and the list goes on.

Android is a Linux-based operating system designed by Google to be used with sensitive


to touch devices like smartphones and tablets. Combining the functionality of the smartphone
with robotic features, anyone can build robotic projects controlled with a simple touch of a
screen or using different technologies integrated in the Android device.

Using smart devices in order to control the robots offer a sense of freedom in the world of
robots. How Android devices come in different shapes and features, the robots can be designed
to fit with any Android devices.

This is good:

 any user can develop application for free;


 existing tools to develop applications and no programming skills required;
 all sensors like GPS, compass for navigation, Bluetooth are already integrated in the
device;
 the applications can be shared between Android devices;
 cost-efficient projects;

This is bad:

 it is not too simple to connect the device to a robot;


 if the user doesn’t have an Android device, this has to be purchased;
Android Applications

Android applications are usually developed in the Java language using the Android
Software Development Kit. Once developed, Android applications can be packaged easily and
sold out either through a store such as Google Play or the Amazon appstore. Android powers
hundreds of millions of mobile devices in more than 190 countries around the world. It's the
largest installed base of any mobile platform and growing fast. Every day more than 1 million
new Android devices are activated worldwide. This tutorial has been written with an aim to teach
you how to develop and package Android application. We will start from environment setup for
Android application programming and then drill down to look into various aspects of Android
applications.

3.6 BLUETOOTH
Bluetooth is a wireless technology standard for exchanging data over short distances
(using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed
and mobile devices, and building personal area networks (PANs). Invented by telecom
vendor Ericsson in 1994, it was originally conceived as a wireless alternative to RS-232 data
cables. It can connect several devices, overcoming problems of synchronization.

Bluetooth is managed by the Bluetooth Special Interest Group (SIG), which has more
than 20,000 member companies in the areas of telecommunication, computing, networking, and
consumer electronics. The IEEE standardized Bluetooth as IEEE 802.15.1, but no longer
maintains the standard. The Bluetooth SIG oversees development of the specification, manages
the qualification program, and protects the trademarks. A manufacturer must make a device
meet Bluetooth SIG standards to market it as a Bluetooth device A network of patents apply to
the technology, which are licensed to individual qualifying devices.

HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed
for transparent wireless serial connection setup. Serial port Bluetooth module is fully qualified
Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio
transceiver and baseband. It uses CSR Blue core 04-External single chip Bluetooth system with
CMOS technology and with AFH (Adaptive Frequency Hopping Feature). It has the footprint as
small as 12.7mmx27mm. Hope it will simplify your overall design/development cycle.

Fig: Bluetooth module


3.8 POWER SUPPLY

The power supplies are designed to convert high voltage AC mains electricity to a suitable
low voltage supply for electronic circuits and other devices. A power supply can by broken down
into a series of blocks, each of which performs a particular function. A D.C power supply which
maintains the output voltage constant irrespective of A.C mains fluctuations or load variations is
known as “Regulated D.C Power Supply”

For example a 5V regulated power supply system as shown below:

Fig.3.5.1 Components of a typical linear power supply.

3.8.1 TRANSFORMER

A transformer is an electrical device which is used to convert electrical power from one
Electrical circuit to another without change in frequency. Transformers convert AC electricity
from one voltage to another with little loss of power. Transformers work only with AC and this
is one of the reasons why mains electricity is AC. Step-up transformers increase in output
voltage, step-down transformers decrease in output voltage. Most power supplies use a step-
down transformer to reduce the dangerously high mains voltage to a safer low voltage.

The input coil is called the primary and the output coil is called the secondary. There is
no electrical connection between the two coils; instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down current is stepped up. The ratio of
the number of turns on each coil, called the turn’s ratio, determines the ratio of the voltages. A
step-down transformer has a large number of turns on its primary (input) coil which is connected
to the high voltage mains supply, and a small number of turns on its secondary (output) coil to
give a low output voltage.

Fig.3.5.2 An Electrical Transformer

Turns ratio = Vp/ VS = Np/NS

Power Out= Power In

VS X IS=VP X IP

Vp = primary (input) voltage


Np = number of turns on primary coil
Ip = primary (input) current

3.8.2 RECTIFIER

A circuit which is used to convert a.c to dc is known as RECTIFIER. The process of


conversion a.c to d.c is called “rectification”

TYPES OF RECTIFIERS

1. Half wave Rectifier


2. Full wave rectifier
 Centre tap full wave rectifier.
 Bridge type full bridge rectifier.

Comparison of rectifier circuits:

Type of Rectifier

Parameter Half wave Full wave Bridge

Number of diodes 1 2 4

PIV of diodes Vm 2Vm Vm

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

Vdc,at no-load 0.318Vm 0.636Vm 0.636Vm

Ripple factor 1.21 0.482 0.482

Ripple Frequency F 2f 2f

Rectification

Efficiency 0.406 0.812 0.812

Transformer

Utilization 0.287 0.693 0.812

Factor(TUF)

RMS voltage Vrms Vm/2 Vm/√2 Vm/√2

Table 3 Comparison of rectifier circuits:

Full-wave Rectifier:
From the above comparison we came to know that full wave bridge rectifier as more
advantages than the other two rectifiers. So, in our project we are using full wave bridge rectifier
circuit.

Bridge Rectifier:

A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave
rectification. This is a widely used configuration, both with individual diodes wired as shown
and with single component bridges where the diode bridge is wired internally.

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

Fig.3.5.2.1 Bridge rectifier

Operation:

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

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

Fig .3.5.2.3 The diodes D1 and D4 are in forward biased

3.8.3 Regulator

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

Fig.3.5.2.4 A Three Terminal Voltage Regulator

78XX

The Bay Linear LM78XX is integrated linear positive regulator with three terminals. The
LM78XX offer several fixed output voltages making them useful in wide range of applications.
When used as a zener diode/resistor combination replacement, the LM78XX usually results in an
effective output impedance improvement of two orders of magnitude, lower quiescent current.
The LM78XX is available in the TO-252, TO-220 & TO-263packages,

Features

• Output Current of 1.5A, Output Voltage Tolerance of 5%

• Internal thermal overload protection, Internal Short-Circuit Limited

• No External Component, Output Voltage 5.0V, 6V, 8V, 9V, 10V,12V, 15V, 18V, 24V

• Offer in plastic TO-252, TO-220 & TO-263 , Direct Replacement for LM78X

3.3.4 LED (LIGHT EMITTING DIODE)


A light-emitting diode (LED) is an electronic light source All early devices emitted low-
intensity red light, but modern LEDs are available across the visible, ultraviolet and infra red
wavelengths, with very high brightness.

LEDs are based on the semiconductor diode. When the diode is forward biased (switched
on), electrons are able to recombine with holes and energy is released in the form of light. This
effect is called electroluminescence and the color of the light is determined by the energy gap of
the semiconductor. The LED is usually small in area (less than 1 mm2) with integrated optical
components to shape its radiation pattern and assist in reflection.

LEDs present many advantages over traditional light sources including lower energy
consumption, longer lifetime, improved robustness, smaller size and faster switching. However,
they are relatively expensive and require more precise current and heat management than
traditional light sources.

Applications of LEDs are diverse. They are used as low-energy indicators but also for
replacements for traditional light sources in general lighting and automotive lighting. The
compact size of LEDs has allowed new text and video displays and sensors to be developed,
while their high switching rates are useful in communications technology.
Like a normal diode, the LED consists of a chip of semiconducting material impregnated,
or doped, with impurities to create a p-n junction. As in other diodes, current flows easily from
the p-side, or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers—
electrons and holes—flow into the junction from electrodes with different voltages. When an
electron meets a hole, it falls into a lower energy level, and releases energy in the form of a
photon.

The wavelength of the light emitted, and therefore its color, depends on the band gap
energy of the materials forming the p-n junction. In silicon or germanium diodes, the electrons
and holes recombine by a non-radioactive transition which produces no optical emission,
because these are indirect band gap materials. The materials used for the LED have a direct band
gap with energies corresponding to near-infrared, visible or near-ultraviolet light.

LED development began with infrared and red devices made with gallium arsenide.
Advances in materials science have made possible the production of devices with ever-shorter
wavelengths, producing light in a variety of colors. LEDs are usually built on an n-type substrate,
with an electrode attached to the p-type layer deposited on its surface. P-type substrates, while
less common, occur as well. Many commercial LEDs, especially GaN/InGaN, also use sapphire
substrate
CHAPTER-4

RESULT AND FINAL PROJECT

RESULT:

As a result of this automatic braking system, the function of each part is working well and the
whole system is successfully accomplished. The safety distance is determined then the vehicle
system is braked when the obstacle is detected

FINAL PROJECT:

In this project, we have checked the working of our project, we connected it with a batteries and
whose braking system is controlled by a DC gear motor and servomotor. This technique is eco-
friendly and this work is an attempt to reduce accidents while in critical driving conditions. We
have tested the working of the system by placing various objects ahead as obstacles. The system
responded by reducing the speed of the vehicle when the obstacle is placed at various distances
from it. Also the system stopped automatically in restricted areas. It gave very accurate
measurement according to limit of values interpreted

Final Project view


CHAPTER-5

ADVANTAGES AND APPLICATIONS

Advantages and Applications:


1. The robot is small in size so can be used for spying.
2. With few additions and modifications, this robot can be used in the borders for detecting
and disposing hidden land mines.
3. The robot can be used for reconnaissance or surveillance.
CHAPTER-6

CONCLUSION AND FUTURESCOPE

Conclusion

This project shows how the android smartphone can be used as remote controller for
robot and various embedded technologies with the help of the Bluetooth technology. The
proposed system also shows that how a robot can be used for travelling purpose. The operating
system of smartphone is Android, and it can develop effective remote control program and by
using WiFi wireless network, the communication between smartphone and robot can be realized,
which makes it simple and convenient to control robot.

Future Development:
1. We can interface sensors to this robot so that it can monitor some parameters.
2. We can add wireless camera to this robot.
3. This project can also be developed by using GSM module.
FUTURE SCOPE

The future scope is to design and develop a control system based on an

automotive braking system is called “Automatic Braking System”. The

Automatic Braking System with ultrasonic sensor would alert the driver when

the distance between vehicle and obstacle is in within the sensing range zone

then the brakes are applied. This is the new function in this prototype design

that could be possibly used for all the vehicles. By making it safer, this system

will provide better guarantee for vehicle’s safety and avoid losses. Therefore,

the safety system of vehicles will be developed and may have more market

demands.

It can be further used for large type of heavy vehicles like buses,

trucks, cranes, tractors, etc. We can surely get the information about the

obstacle detection sense zone according to vehicle condition. It is verily useful

to public sector and users. It is also avoids the accidents in large or

metropolitan cities. So we feel it is a better idea for automatically braking of

vehicle with moderate cost.


REFERENCES

1. http://www.projectsof8051.com
2. www.engineersgarage.com
3. www.wikipedia.com
4. “How Bluetooth Technology Works”, www.bluetooth.com/bluetooth/technology/works
This link refers to technical document that contains information about electronic control
unit.
5. http://www.aa1car.com/this website contains technical articles,books and

manuals that help us find what’s wrong with our vehicle and what needed to

fix it.

6. David Epsilon, An embedded software premier, Pearson education, 1999.

You might also like