Download Abstract - 1000kv technologies

Document related concepts

Resistive opto-isolator wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Time-to-digital converter wikipedia , lookup

Power engineering wikipedia , lookup

Electric motor wikipedia , lookup

History of electric power transmission wikipedia , lookup

Buck converter wikipedia , lookup

Rectifier wikipedia , lookup

Induction motor wikipedia , lookup

Voltage optimisation wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Alternating current wikipedia , lookup

Mains electricity wikipedia , lookup

Power electronics wikipedia , lookup

Embedded system wikipedia , lookup

Stepper motor wikipedia , lookup

Opto-isolator wikipedia , lookup

Brushed DC electric motor wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Transcript
Chapter -1
INTRODUCTION
1.1Background
With the development of technology and the continuous improvement of people's
living standard, people are in pursuit of automated, intelligent and convenient home control
systems. At present, the PC is used as the remote control terminal for most home control
systems; however, there are some problems in the PC monitor terminal, such as its great
bulk, inconvenience to carry, high cost, limited monitoring range and so on. Therefore, it’s a
good choice to design a terminal based on phone. With the popularity of smart phones,
particularly, the phone based on Android system is rapidly developed. At its I/O developer
conference, Google showed a sneak preview of its Android Home project, which will extend the
Android platform into household objects. It means that the remote control based on Android
phone will become a mainstream way. After logging into the control interface, users can
easily control the lights, TVs and air conditionings anytime, anywhere, which brings great
convenience to people and improves the quality of life.
1.2 Literature Survey
For this proposed Seminar, following IEEE papers were studied as part of
literature survey. Smart Home System for Disabled People Via Wireless Bluetooth gives
moneywise concept by using GPRS as the medium to control and monitor home appliances.
Design and Realization of Home Appliances Control System Based on The Android
Smartphone present the information about the remote appliances control system based on
the Android smart phone is designed and realized. A user logs into the smart phone interface,
and clicks the buttons gently to send message commands which will be transmitted to home
information Centre through the communication network. Then the AVR microcontroller
recognizes the specified command, and controls the home appliance switches in the wireless
radio frequency manner to achieve remote control of appliances ultimately. Exploiting Bluetooth
on android mobile devices for home security application present the information about mobile
devoice has been integrated into our everyday life. Home automation and security are becoming
increasingly prominent features on mobile devoices the mobile devoice and security system
communicates via Bluetooth because a short -range-only communication system was desired.
With the help of android mobile we can control task such as locking the doors, turning
on/off lights remotely. According to kaue, home automation can be useful to those who need to
access home appliances while away from their home and can improve the lives of the disabled.
1.3 Motivation
Disabled people are more likely to be exposed to daily life problems than other healthy
people. While deaf people cannot hear the door bell, Alzheimer diseased people can forget the
gas open in the kitchen. These are some encountered examples when they are alone at home.
With the help of technology, assistant projects can be developed to overcome their difficulties.
Smart homes can also be used to support disabled people, providing safe, secure and
empowering environments. The system can allow the user to control many features or automate
them. The environment can also be monitored by the smart home system to ensure safety and
alert people when there is some dangerous situation.
1.4 Scope
The users can manipulate appliances anytime, anywhere, letting our houses become
more and more automated and intelligent. At present, the PC is used as the remote
control terminal for most home control systems [however, there are some problems in the PC
monitor terminal, such as its great bulk, inconvenience to carry, high cost, and limited
monitoring range and so on. Therefore, it’s a good choice to design a terminal based on
phone.
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 generalpurpose 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 hightech 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 segmentconsumer 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
HARDWARE DESIGN
Chapter 3
HARDWARE DESIGN
3.1 INTRODUCATON
In This Chapter Explain about All Component Atmega8 Microcontroller Overview, LED,
Power supply, DC motor, Regulator power supply, crystal oscillator, H-bridge, TTL, android,
wireless communication, serial communication, Bluetooth, relay .
Block diagram
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:
3.4 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.
3.5 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 InSystem 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-touse 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 ReadWhile-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 postincrement, 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 timeout 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 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.3.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 stepdown 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.3.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
0.406
0.812
0.812
0.287
0.693
0.812
Vm/2
Vm/√2
Vm/√2
Rectification
Efficiency
Transformer
Utilization
Factor(TUF)
RMS voltage Vrms
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.3.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 lowintensity 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
3.3.6 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 3.6: The Operation of DC Motor
3.3.6.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.6.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.6.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.6.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
Where I,
the
motor.
Hence voltage equation
of
the
motor
is
given
by,
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 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;
Features of Android
Android is a powerful operating system competing with Apple 4GS and supports great features.
Few of them are listed below:
Feature
Beautiful UI
. Description
Android OS basic screen provides a beautiful and intuitive user
interface
Connectivity
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi,
LTE, NFC and WiMAX.
Storage
SQLite, a lightweight relational database, is used for data storage
purposes. H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC,
Media support
HE-AAC, AAC 5.1, MP3, MIDI, Ogg Vorbis, WAV, JPEG,
PNG, GIF.
Messaging
SMS and MMS
Wi-Fi Direc
A technology that lets apps discover and pair directly, over a
high-bandwidth peer-to-peer connection
Android Beam
A popular NFC-based technology that lets users instantly share,
just by touching two NFC enabled phones together.
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.5 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.
3.6 Wireless communication
The term wireless communication was introduced in the 19th century and wireless
communication technology has developed over the subsequent years. It is one of the most
important mediums of transmission of information from one device to other devices. In this
technology, the information can be transmitted through the air without requiring any cable or
wires or other electronic conductors, by using electromagnetic waves like IR, RF, satellite, etc.
In the present days, the wireless communication technology refers to a variety of wireless
communication devices and technologies ranging from smart phones to computers, tabs,
laptops, Bluetooth Technology, printers. This article gives an overview of wireless
communication.
3.6.1 Types of wireless communications.
In recent days, the wireless communication technology has become an integral part of
several types of communication devices as it allows users to communicate even from remote
areas. The devices used for wireless communication are cordless telephones, mobiles, GPS units,
ZigBee technology, wireless computer parts, and satellite television, etc.
Satellite
Satellite communication is one of the wireless technologies, which is widely spread all
over the world allowing users to stay connected virtually anywhere on the Earth. The Satellites
used in this mode of communication, communicate directly with the orbiting satellites via radio
signals. Portable satellite phones and modems have more powerful broadcasting abilities than the
cellular devices as they have high range, apart from being more expensive in terms of cost, than
their counterparts.
For example, for outfitting a ship through satellite communication, a traditional
communication system is linked to a single satellite, which allows multiple users to share the
same broadcast equipment.
Wireless Networking
Wireless Networking technologies connect multiple computers, systems and devices
together without requiring wires or cables: a wireless local area network or WLAN comes under
Wi-Fi.
Wi-MAX
There are wireless broadband systems that offer fast Web surfing without being getting
connected through cable or DSL (Example of wireless broadband is Wi-MAX). Although WiMAX can potentially deliver data rates of more than 30 Megabits per second, yet the providers
offer average 0 data rates of 6 Mbps and often deliver less, making the service significantly
slower than the hard-wired broadband. The actual cost of the data available using Wi-MAX
widely varies with the distance from the transmitter. Wi-MAX is also one of the versions of 4G
wireless available in phones as Sprint’s 4G technologies.
Wi-Fi
Wi-Fi is a form of low-power wireless communication used by many electronic devices
such as laptops, systems, smart phones, etc. In a Wi-Fi setup, a wireless router serves as the
communication hub. These networks are extremely limited in range due to low power of
transmissions allowing users to connect only within close proximity to a router or signal
repeater. Wi-Fi is common in home networking applications which provides portability without
any need of cables. Wi-Fi networks need to be secured with passwords for security purposes in
order not to be accessed by others.
Wi-Fi
Advantages

Ease of Integration and Convenience – The wireless nature of such networks allows users
to access network resources from nearly any convenient location.

Mobility – With the emergence of public wireless networks, users can access the internet
even outside their normal working environment.

Expandability – Wireless networks are capable of serving a suddenly-increased number
of clients with the existing equipment. In a wired network, additional clients require
additional wiring.
Wireless Networking WiFI
Disadvantages

Wireless LANs may not be desirable for a number of reasons.

Radio Frequency transmission and wireless networking signals are subjected to a wide
variety of interference including the complex propagation effects that are beyond the
control of the network administrator.

Security Problems – Wireless networks may choose to utilize some of the various
encryption technologies.

Range will be insufficient for a larger structure – and, in order to increase its range,
repeaters or additional access points have to be purchased.

The speed on most wireless networks will be slower than the slowest common wired
networks.

Installation of an infrastructure-based wireless network is a complex to set up.
Bluetooth Technology
Bluetooth technology allows you to connect a variety of different electronic devices
wirelessly to a system for the transfer and sharing of data and this is the main function of
Bluetooth. Cell phones are connected to hands-free earpieces, wireless keyboard, mouse and
mike to laptops with the help of Bluetooth as it transmits information from one device to other
device. Bluetooth technology has many functions, and it is used most commonly in wireless
communications’ market.
Bluetooth Technology
Features

Bluetooth technology uses radio waves to communicate between devices. Most of these
radio waves have a range of 15-50 feet.

According to the official Bluetooth website, Bluetooth uses a low-power signal with a
maximum range of 50 feet with sufficient speed to enable transmission of data.

The pairing process identifies and connects any two devices to each other. It also
prevents interference from other non-paired Bluetooth devices in the area.

It uses maximum power only when it is required, thus preserving battery life.
3.7 H-Bridges
The H-Bridge is the link between digital circuitry and mechanical action. The computer
sends out binary commands, and high powered actuators do stuff. Most often H-bridges are used
to control rotational direction of DC motors. And unless you buy a potentially expensive motordriver, you need an H-bridge to control any robot with a motor.
Most DC-to-AC converters (power inverters), most AC/AC converters, the DC-to-DC push–
pull converter, most motor, and many other kinds of power electronics use H bridges. In
particular, a bipolar stepper motor is almost invariably driven by a motor controller containing
Two H Bridges.
The H-bridge arrangement is generally used to reverse the polarity/direction of the motor, but
can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motor's
terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively
disconnected from the circuit. The following table summarizes operation, with S1-S4
corresponding to the diagram above.
S1 S2 S3 S4 Result
1
0
0
1
Motor moves right
0
1
1
0
Motor moves left
0
0
0
0
Motor free runs
0
1
0
1
Motor brakes
1
0
1
0
Motor brakes
1
1
0
0
Short Power Supply
0
0
1
1
Short Power Supply
1
1
1
1
Short Power Supply

While originally designed to handle logic-level digital signals, a TTL inverter can be biased
as an analog amplifier. Connecting a resistor between the output and the input biases the TTL
element as a negative feedback amplifier. Such amplifiers may be useful to convert analog
signals to the digital domain but would not ordinarily be used where analog amplification is the
primary purpose. TTL inverters can also be used in crystal oscillators where their analog
amplification ability is significant.
3.7.1 L293D Motor Driver
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.7 Relay
A relay is an electrically operated switch. Many relays use an electromagnet to
mechanically operate a switch, but other operating principles are also used, such as solid-state
relays. Relays are used where it is necessary to control a circuit by a low-power signal (with
complete electrical isolation between control and controlled circuits), or where several circuits
must be controlled by one signal. The first relays were used in long distance telegraph circuits as
amplifiers: they repeated the signal coming in from one circuit and re-transmitted it on another
circuit. Relays were used extensively in telephone exchanges and early computers to perform
logical operations.
A type of relay that can handle the high power required to directly control an electric
motor or other loads is called a contactor. Solid-state relays control power circuits with
no moving parts, instead using a semiconductor device to perform switching. Relays with
calibrated operating characteristics and sometimes multiple operating coils are used to protect
electrical circuits from overload or faults; in modern electric power systems these functions are
performed by digital instruments still called "protective relays".
Chapter-4
Software description
AVR Studio 4 is a professional Integrated Development Environment (IDE) for writing
and debugging AVR applications in Windows 9x/NT/2000/XP environments. This tutorial
assumes that you have installed AVR Studio 4 on your computer. If you do not have AVR Studio
yet, you may obtain a copy of AVR Studio 4 from one of 3 places:
1. Atmel Corporation: http://www.atmel.com
2. AVR Freaks: http://www.avrfreaks.net
3. Borrow a CD from your instructor
This will guide you through the steps required for:
1. Executing the AVR Studio 4 Integrated Development Environment (IDE),
2. Typing in a program,
3. Assembling the program, and
4. Simulating a program
Step 1: Open AVR Studio 4 IDE. You should see the program banner shown below:
Figure : AVR Studio 4 Banner
Step 2: When IDE opens, you will see the programming and simulator environment as well as a
dialog box (Figure 3) requesting information: are you starting a new project or opening a saved
project?
Step 3: Click on the “New Project” button:
Step 4: In the next dialog box, choose the Atmel AVR Assembler as the project type:
Figure : Choose Atmel AVR Assembler
Step 5: Type in a project name and the initial file name:
Figure: Type Project and Initial File Names
Step 6: Click on the “Next” button
Step 7: Choose “AVR Simulator” for the Debug Platform and then scroll down the right window
to choose the ATmega32 AVR processor. Select in the drop down list.Choose Simulator and
ATmega32
Step 8: Click on the “Finish” button. You should then see the IDE
Step 9: Type in the program as shown in Figure 1. Note the color-coded text. This is done
automatically by the IDE and helps you to make corrections as you go.
Step 10: When you have completed the program save it. It is also good practice to periodically
save your program as you type.
Step 11: Assemble your program. You may do this by selecting “Build” from the “Build Menu”
or by striking the [F7] key:
Step 12: Continue assembling and correcting errors until the program assembles without error
(Note the green dot in the lower window and the comment that states: “Assembly complete, 0
Errors, 0 warnings”) you are ready to simulate.
Step 13: Simulate the program. To start the simulator you may choose “Start Debugging” from
The “Debug Menu” or you may click on the arrow button as shown below:
ATMEGA 8 COMPAILER AV4-IDE USING:
Atmega8 program dumping from ISP7 using :
Building Projects and Creating a HEX Files
Typical, the tool settings under Options – Target are all you need to start a new application. You
may translate all source files and line the application with a click on the Build Target toolbar
icon. When you build an application with syntax errors, avr4 will display errors and warning
messages in the Output Window – Build page. A double click on a message line opens the source
file on the correct location in a AVR4 editor window. Once you have successfully generated
your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to
download the software into an EPROM programmer or simulator. µVision2 creates HEX files
with each build process when Create HEX files under Options for Target – Output is enabled.
You may start your PROM programming utility after the make process when you specify the
program under the option Run User Program #1.
Chapter -5
Implementation of Programming Code sours
//*Program to control home application using android mobile phone
/*
BLUETOOTH----AVR8
TX-------PD0 (RX)
RX-------PD1 (TX)
*/
#define F_CPU 8000000UL
//external 8mz must
#define USART_BAUDRATE 9600
#define BAUD_PRESCALE ((F_CPU / (USART_BAUDRATE * 16UL)) - 1)
#include<avr/io.h>
#include"delay.h"
bluetooth_enable();
int main()
{
DDRC=0xff;
PORTC=0x00;
while(1)
{
DDRC=0xff;
temp=USART_Receive ();
if(temp=='W')//down arrow
PORTC=0b00000001;
else if(temp=='X')//up arrow
PORTC=0b00000010;
else if(temp=='S')//red
{
PORTC=0x00;
}
}
}
Chapter 5
SCHEMATIC DIAGRAM
Chapter-6
FUTURE SCOPE AND CONCLUSIONS
1. Conclusions
By designing the Android user interface and Home information Centre, home appliance
control system based on the Android phone can be designed. It has combined android client,
network transmission, and wireless switch, home information center to form a complete system,
and the whole system works normally. Identifying message commands and wireless encoding are
the two major tasks for home information center. Android phone have advantages such as
humane interface, customizable and extendible applications and android phone is easy to carry so
on. By constantly improving the control function, android phone allows us anytime, anywhere to
control any device, and finally realizes the highly intelligent home.
2. Future
This project can be further developed by integrating it with the internet to monitor your
home while sitting in a remote area. By doing this, one can keep an eye on his or her home
through an internet connected to the user’s mobile phone or PC or laptop. This will not only
improve the security of your ho me in this modern day world but will also assist in
conservation of energy like if you left any home appliance switched on by mistake, then
you can check the status of the appliance on the graphical interface made on your mobile and can
Switch it off using the internet connectivity.
References
1. Jianjun Lv, Zhishu Li, Mingyi Mao. "A new USB home appliances based on PC
and infrared remote control protocol".2010
2. International Conferences on Computer and Communication Technologies in Agriculture
Engineering.2010, pp.572 -575.
3. Shengwen Chen, Chunghuang Yang, Chung-Huang Yang.“Design and Implementation
of Live SD
Acquisition Tool in Android Smart Phone". 2011 Fifth International
Conference on Genetic and Evolutionary Computing. 2011, pp. 157-162.
4. Xiao Yuan, Yuliang Pan, Zaiying Ling. "The Application of Infrared Remote
Controlled Code Lock in the Management of Industrial Machine Parameters”
.Electrical and Control Engineering (ICECE), 2011 International Conference on.2011, pp.
418 -421.
5. Feng Xun, Ye Zhi-xia."Sunplus SPCE061A MCU Simulation PT2262 Coding".
Journal of Yunnan Normal University (Natural Sciences Edition), 2010. 30(4) . pp.
40-42.
6. Ki-Cheol Son, Jong-Yeol Lee. "The methods of android application speed up by using
NDK". Awareness Science and Technology (iCAST), 2011 3rd International Conference
on. Sept 2011, pp.382- 385.