Académique Documents
Professionnel Documents
Culture Documents
SUBMITTED BY
P SHIVANI 14261A1435
R PRIYANKA 14261A1438
M JAGADEESH 14261A1427
K ROHITH 14261A1440
TOPICS
Certificates
Acknowledgement
CHAPTER 1: INTRODUCTION
4. 1 Express PCB
4.2 Arduino Compiler
4.3 Proteus
4.4 Procedural steps for compilation, simulation and dumping
3
CHAPTER 1: INTRODUCTION
1.1Introduction:
This project aims at designing a live Robot which is capable of seed sowing and grass cutting .
which will drill the soil and sow the seeds .this robot has two modes of operations like auto mode and
manual mode, in auto mode it moves in particular grid by help of sensors This robot is capable of
receiving few sets of command instructions in the form of bluetooth tones with help of android app
and performs the necessary actions. Bluetooth module receive the commands These tones are
generated by the keys present over the pad of the mobile phone. Every individual key generates a
unique tone. This tones are considered as the inputs for the robot i.e. this keypad can be used as a
remote to control the motion of the robot.
There will be a dedicated Bluetooth at the receiver module i.e. with the robot. The only thing
the user has to do is to send the commands for android app receive the commands for Bluetooth send
the information for microcontroller to the direction in which the robot need to move. The tone
generated by the key is received and decoded with the help of a bluetooth decoder.
The mobile unit which is dedicated at the robot is interfaced with an intellectual device connect
to Micro controller so that it takes the responsibility of decoding the tones received and perform the
corresponding predefined tasks. The micro controller is also interfaced with a DC motor in order to
move the robot in different directions. The ON and OFF of the DC motor depends on the direction it
has to move which is the complete responsibility of the controller to take those intelligent decisions.
4
CHAPTER 2: EMBEDDED SYSTEMS
Embedded systems are controlled by one or more main processing cores that are
typically either microcontrollers or digital signal processors (DSP). The key characteristic, however, is
being dedicated to handle a particular task, which may require very powerful processors. For example,
air traffic control systems may usefully be viewed as embedded, even though they involve mainframe
computers and dedicated regional and national networks between airports and radar sites. (Each radar
probably includes one or more embedded systems of its own.)
Since the embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the reliability and performance.
Some embedded systems are mass-produced, benefiting from economies of scale.
Physically embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants. Complexity varies from low, with a single microcontroller chip, to
very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure.
In general, "embedded system" is not a strictly definable term, as most systems have
some element of extensibility or programmability. For example, handheld computers share some
elements with embedded systems such as the operating systems and microprocessors which power
them, but they allow different applications to be loaded and peripherals to be connected. Moreover,
even systems which don't expose programmability as a primary feature generally need to support
software updates. On a continuum from "general purpose" to "embedded", large application systems
will have subcomponents at most points even if the system as a whole is "designed to perform one or
a few dedicated functions", and is thus appropriate to call "embedded". A modern example of
embedded system is shown in fig: 2.1.
5
Fig 2.1:A modern example of embedded system
Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded
systems programming is not like normal PC programming. In many ways, programming for an
embedded system is like programming PC 15 years ago. The hardware for the system is usually
chosen to make the device as cheap as possible. Spending an extra dollar a unit in order to make
things easier to program can cost millions. Hiring a programmer for an extra month is cheap in
comparison. This means the programmer must make do with slow processors and low memory, while
at the same time battling a need for efficiency not seen in most PC applications. Below is a list of
issues specific to the embedded field.
2.1.1 History:
One of the first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's
inception, the Apollo guidance computer was considered the riskiest item in the Apollo project as it
employed the then newly developed monolithic integrated circuits to reduce the size and weight. An
6
early mass-produced embedded system was the Autonetics D-17 guidance computer for
the Minuteman missile, released in 1961. It was built from transistor logic and had a hard disk for
main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with a
new computer that was the first high-volume use of integrated circuits.
2.1.2 Tools:
Debugging tools are another issue. Since you can't always run general programs on
your embedded processor, you can't always run a debugger on it. This makes fixing your program
difficult. Special hardware such as JTAG ports can overcome this issue in part. However, if you stop
on a breakpoint when your system is controlling real world hardware (such as a motor), permanent
equipment damage can occur. As a result, people doing embedded programming quickly become
masters at using serial IO channels and error message style debugging.
2.1.3 Resources:
To save costs, embedded systems frequently have the cheapest processors that can do
the job. This means your programs need to be written as efficiently as possible. When dealing with
large data sets, issues like memory cache misses that never matter in PC programming can hurt you.
Luckily, this won't happen too often- use reasonably efficient algorithms to start, and optimize only
when necessary. Of course, normal profilers won't work well, due to the same reason debuggers don't
work well.
Memory is also an issue. For the same cost savings reasons, embedded systems usually
have the least memory they can get away with. That means their algorithms must be memory efficient
(unlike in PC programs, you will frequently sacrifice processor time for memory, rather than the
reverse). It also means you can't afford to leak memory. Embedded applications generally use
deterministic memory techniques and avoid the default "new" and "malloc" functions, so that leaks
can be found and eliminated more easily. Other resources programmers expect may not even exist.
7
For example, most embedded processors do not have hardware FPUs (Floating-Point Processing
Unit). These resources either need to be emulated in software, or avoided altogether.
Embedded systems frequently control hardware, and must be able to respond to them
in real time. Failure to do so could cause inaccuracy in measurements, or even damage hardware such
as motors. This is made even more difficult by the lack of resources available. Almost all embedded
systems need to be able to prioritize some tasks over others, and to be able to put off/skip low priority
tasks such as UI in favor of high priority tasks like hardware control.
The uses of embedded systems are virtually limitless, because every day new products
are introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much cheaper. So
when implementing a new form of control, it's wiser to just buy the generic chip and write your own
custom software for it. Producing a custom-made chip to handle a particular task or set of tasks costs
far more time and money. Many embedded computers even come with extensive libraries, so that
"writing your own software" becomes a very trivial task indeed. From an implementation viewpoint,
there is a major difference between a computer and an embedded system. Embedded systems are often
required to provide Real-Time response. The main elements that make embedded systems unique are
its reliability and ease in debugging.
2.2.1 Debugging:
8
An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via a
JTAG or Nexus interface. This allows the operation of the microprocessor to be controlled
externally, but is typically restricted to specific debugging capabilities in the processor.
An in-circuit emulator replaces the microprocessor with a simulated equivalent, providing full
control over all aspects of the microprocessor.
A complete emulator provides a simulation of all aspects of the hardware, allowing all of it to
be controlled and modified, and allowing debugging on a normal PC.
Unless restricted to external debugging, the programmer can typically load and run software
through the tools, view the code running in the processor, and start or stop its operation. The
view of the code may be as assembly code or source-code.
2.2.2 Reliability:
Embedded systems often reside in machines that are expected to run continuously for
years without errors and in some cases recover by themselves if an error occurs. Therefore the
software is usually developed and tested more carefully than that for personal computers, and
unreliable mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
The system cannot safely be shut down for repair, or it is too inaccessible to repair. Examples
include space systems, undersea cables, navigational beacons, bore-hole systems, and
automobiles.
The system must be kept running for safety reasons. "Limp modes" are less tolerable. Often
backup s are selected by an operator. Examples include aircraft navigation, reactor control
9
systems, safety-critical chemical factory controls, train signals, engines on single-engine
aircraft.
The system will lose large amounts of money when shut down: Telephone switches, factory
controls, bridge and elevator controls, funds transfer and market making, automated sales and
service.
In this design, the software simply has a loop. The loop calls subroutines, each of which
manages a part of the hardware or software.
Some embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be generated
10
for example by a timer in a predefined frequency, or by a serial port controller receiving a byte. These
kinds of systems are used if event handlers need low latency and the event handlers are short and
simple.
Usually these kinds of systems run a simple task in a main loop also, but this task is not
very sensitive to unexpected delays. Sometimes the interrupt handler will add longer tasks to a queue
structure. Later, after the interrupt handler has finished, these tasks are executed by the main loop.
This method brings the system close to a multitasking kernel with discrete processes.
Cooperative Multitasking:
Primitive Multitasking:
In this type of system, a low-level piece of code switches between tasks or threads
based on a timer (connected to an interrupt). This is the level at which the system is generally
considered to have an "operating system" kernel. Depending on how much functionality is required, it
introduces more or less of the complexities of managing multiple tasks running conceptually in
parallel.
As any code can potentially damage the data of another task (except in larger systems
using an MMU) programs must be carefully designed and tested, and access to shared data must be
controlled by some synchronization strategy, such as message queues, semaphores or a non-blocking
synchronization scheme.
11
Microkernels And Exokernels:
A microkernel is a logical step up from a real-time OS. The usual arrangement is that
the operating system kernel allocates memory and switches the CPU to different threads of execution.
User mode processes implement major functions such as file systems, network interfaces, etc.
In general, microkernels succeed when the task switching and intertask communication
is fast, and fail when they are slow. Exokernels communicate efficiently by normal subroutine calls.
The hardware, and all the software in the system are available to, and extensible by application
programmers. Based on performance, functionality, requirement the embedded systems are divided
into three categories:
These systems takes the input in the form of electrical signals from transducers or
commands from human beings such as pressing of a button etc.., process them and produces desired
output. This entire process of taking input, processing it and giving output is done in standalone mode.
Such embedded systems comes under stand alone embedded systems
Embedded systems which are used to perform a specific task or operation in a specific
time period those systems are called as real-time embedded systems. There are two types of real-time
embedded systems.
These embedded systems follow an absolute dead line time period i.e.., if the tasking is
not done in a particular time period then there is a cause of damage to the entire equipment.
Eg: consider a system in which we have to open a valve within 30 milliseconds. If this valve is
not opened in 30 ms this may cause damage to the entire equipment. So in such cases we use
embedded systems for doing automatic operations.
12
Eg: Consider a TV remote control system ,if the remote control takes a few milliseconds delay it will
not cause damage either to the TV or to the remote control. These systems which will not cause damage when
they are not operated at considerable time period those systems comes under soft real-time embedded systems.
Eg:
Consider a web camera that is connected to the computer with internet can be used to
spread communication like sending pictures, images, videos etc.., to another computer
with internet connection throughout anywhere in the world.
Whenever a person comes near the door, it captures the image of a person and sends to
the desktop of your computer which is connected to internet. This gives an alerting message with
image on to the desktop of your computer, and then you can open the door lock just by clicking the
mouse. Fig: 2.2 shows the network communications in embedded systems.
13
2.3.5 Different types of processing units:
The central processing unit (c.p.u) can be any one of the following microprocessor,
microcontroller, digital signal processing.
Among these Microcontroller is of low cost processor and one of the main advantage of
microcontrollers is, the components such as memory, serial communication interfaces, analog
to digital converters etc.., all these are built on a single chip. The numbers of external
components that are connected to it are very less according to the application.
Microprocessors are more powerful than microcontrollers. They are used in major applications
with a number of tasking requirements. But the microprocessor requires many external
components like memory, serial communication, hard disk, input output ports etc.., so the
power consumption is also very high when compared to microcontrollers.
Digital signal processing is used mainly for the applications that particularly involved with
processing of signals
Today a lot of industries are using embedded systems for process control. In industries
we design the embedded systems to perform a specific operation like monitoring temperature,
pressure, humidity ,voltage, current etc.., and basing on these monitored levels we do control other
devices, we can send information to a centralized monitoring station.
Fig2.6: Robot
In critical industries where human presence is avoided there we can use robots which
are programmed to do a specific operation.
15
2.4.5 Computer networking:
16
3.1 Introduction:
In this chapter the block diagram of the project and design aspect of independent
modules are considered. Block diagram is shown in fig: 3.1:
3. Crystal oscillator
5. Led indicator
6. Bluetooth
3.2 ARDUINO:
The Arduino is a family of microcontroller boards to simplify electronic design, prototyping and
experimenting for artists, hackers, hobbyists, but also many professionals. People use it as brains for
their robots, to build new digital music instruments, or to build a system that lets your house plants
tweet you when they’re dry. Arduinos (we use the standard Arduino Uno) are built around an ATmega
microcontroller — essentially a complete computer with CPU, RAM, Flash memory, and input/output
pins, all on a single chip. Unlike, say, a Raspberry Pi, it’s designed to attach all kinds of sensors,
LEDs, small motors and speakers, servos, etc. directly to these pins, which can read in or output
digital or analog voltages between 0 and 5 volts. The Arduino connects to your computer via USB,
where you program it in a simple language (C/C++, similar to Java) from inside the free Arduino IDE
by uploading your compiled code to the board. Once programmed, the Arduino can run with the USB
link back to your computer, or stand-alone without it — no keyboard or screen needed, just power.
18
Figure 4.2 Structure of Arduino Board
Looking at the board from the top down, this is an outline of what you will see (parts of the
board you might interact with in the course of normal use are highlighted)
19
Figure 3.2 Arduino Board
Starting clockwise from the top center:
Analog Reference pin (orange)
Digital Ground (light green)
Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for digital i/o
(Digital Read and Digital Write) if you are also using serial communication (e.g. Serial.begin).
Toggles External Power and USB Power (place jumper on two pins closest to desired supply) -
SV1 (purple)
USB (used for uploading sketches to the board and for serial communication between the
board and the computer; can be used to power the board) (yellow)
20
WT11 Bluetooth module. On the Arduino Mini and LilyPad Arduino, they are intended for use
with an external TTL serial module (e.g. the Mini-USB Adapter).
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attach Interrupt() function for
details.
PWM: 3, 5, 6, 9, 10, and 11 Provide 8-bit PWM output with the analog Write() function. On
boards with an ATmega8, PWM output is available only on pins 9, 10, and 11.
BT Reset: 7. (Arduino BT-only) Connected to the reset line of the bluetooth module.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication, which,
although provided by the underlying hardware, is not currently included in the Arduino
language.
LED: 13. On the Diecimila and LilyPad, there is a built-in LED connected to digital pin 13.
When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
3.3.2 Analog Pins
In addition to the specific functions listed below, the analog input pins support 10-bit analog-
to-digital conversion (ADC) using the analog Read() function. Most of the analog inputs can also be
used as digital pins: analog input 0 as digital pin 14 through analog input 5 as digital pin 19. Analog
inputs 6 and 7 (present on the Mini and BT) cannot be used as digital pins.
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library
(documentation on the Wiring website).
3.3.3 Power Pins
VIN (sometimes labeled "9V"): The input voltage to the Arduino board when it's using an
external power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin. Also note that the Lily Pad has no VIN pin and accepts only a
regulated input.
5V: The regulated power supply used to power the microcontroller and other components on
the board. This can come either from VIN via an on-board regulator, or be supplied by USB or
another regulated 5V supply.
3V3 (Diecimila-only) : A 3.3 volt supply generated by the on-board FTDI chip.
21
3.3.4 Other Pins
AREF: Reference voltage for the analog inputs. Used with analog Reference().
Reset: (Diecimila-only) Bring this line LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.
3.5 Atmega328
3.5.1 Pin diagram
22
Figure 3.5 Pin Configuration of Atmega328
23
Pin Description
VCC:
GND:
Ground.
Port A (PA7-PA0):
Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-
directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up
resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics
with both high sink and source capability. When pins PA0 to PA7 are used as inputs and are
externally pulled low, they will source current if the internal pull-up resistors are activated. The
Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running.
Port B (PB7-PB0):
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 externally pulled 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. Port B also serves the functions of various special features of the
ATmega32.
Port C (PC7-PC0):
24
Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port C 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. If the JTAG interface is enabled, the pull-up resistors on pins
PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs. The TD0 pin is tri-
stated unless TAP states that shift out data are entered. Port C also serves the functions of the
JTAG interface.
Port D (PD7-PD0):
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
resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even
if the clock is not running. Port D also serves the functions of various special features of the
ATmega32.
A low level on this pin for longer than the minimum pulse length will generate a reset, even if the
clock is not running. Shorter pulses are not guaranteed to generate a reset.
XTAL1:
Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
AVCC:
25
AVCC is the supply voltage pin for Port A and the A/D Converter. 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.
AREF:
3.5.2 Features
1.8-5.5V operating range
Up to 20MHz
Part: ATMEGA328P-AU
1kB EEPROM
2 8-bit Timer/Counters
16-bit Timer/Counter
6 PWM Channels
Serial USART
Watchdog timer
Analog comparator
26
23 IO lines
27
Figure 3.5 Block Diagram
3.6.1 Overview
This section discusses the AVR core architecture in general. The main function of the CPU
core is to ensure correct program execution. The CPU must therefore be able to access memories,
28
perform calculations, control peripherals, and handle interrupts.
29
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 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-, Y-, 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- 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 Status Register. 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.
3.6.2 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
30
signed/unsigned multiplication and fractional format. See the “Instruction Set” section for a detailed
description.
3.6.3 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.
The AVR Status Register – SREG is defined as:
31
The Half Carry Flag H indicates a Half Carry in some arithmetic operations The Half Carry
Flag H indicates a Half Carry in some arithmetic operations. Half Carry Is useful in BCD arithmetic.
See the “Instruction Set Description” for detailed information.
Bit 4 – S: Sign Bit, S = N V
The S-bit is always an exclusive or between the Negative Flag N and the Two s Complement
Overflow Flag V. See the Instruction Set Description for detailed information.
Bit 3 V: Twos Complement Overflow Flag
The Twos Complement Overflow Flag V supports two’s complement arithmetic.
Bit 2 – N: Negative Flag
The Negative Flag N indicates a negative result in an arithmetic or logic operation.
Bit 1 – Z: Zero Flag
The Zero Flag Z indicates a zero result in an arithmetic or logic operation.
Bit 0 – C: Carry Flag
The Carry Flag C indicates a carry in an arithmetic or logic operation.
3.6.4 General Purpose Register File
The Register File is optimized for the AVR Enhanced RISC instruction set. In order to achieve
the required performance and flexibility, the following input/output schemes are supported by the
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
Most of the instructions operating on the Register File have direct access to all registers, and
most of them are single cycle instructions. As shown in Figure 6-2, each register is also assigned a
data memory address, mapping them directly into the first32 locations of the user data space.
Although not being physically implemented as SRAM locations, this memory organization provides
32
great flexibility in access of the registers, as the X-, Y-, and Z-pointer registers can be set to index any
register.
Figure 4.8 Structure of the 32 general purpose working registers in the CPU
33
Figure 3.9 X-, Y-,
and Z-Registers
In the different addressing modes these address registers have functions as fixed displacement,
automatic increment, and automatic decrement.
3.6.5 Stack Pointer
The Stack is mainly used for storing temporary data, for storing local variables and for storing
return addresses after interrupts and subroutine calls. Note that the Stack is implemented as growing
from higher to lower memorylocations. The Stack Pointer Register always points to the top of the
Stack. The Stack Pointer points to the data SRAM Stack area where the Subroutine and Interrupt
Stacks are located. A Stack PUSH command will decrease the Stack Pointer.
The Stack in the data SRAM must be defined by the program before any subroutine calls are
executed or interrupts are enabled. Initial Stack Pointer value equals the last address of the internal
SRAM and the Stack Pointer must be set to point above start of the SRAM
Table 4.1 Stack Pointer instructions
34
The AVR ATmega128A Stack Pointer is implemented as two 8-bit registers in the I/O space.
The number of bits actually used is implementation dependent. Note that the data space in some
implementations of the AVR architecture is so small that only SPL is needed. In this case, the SPH
Register will not be present.SPH and SPL - Stack Pointer High and Low Register.
Figure 3.10
SPH and SPL - Stack Pointer High and Low Register
3.6.6 Interrupt Response Time
The interrupt execution response for all the enabled AVR interrupts is four clock cycles
minimum. After four clock cycles the program vector address for the actual interrupt handling routine
is executed. During this four clock cycle period, the Program Counter is pushed onto the Stack. The
vector is normally a jump to the interrupt routine, and this jump takes three clock cycles. If an
interrupt occurs during execution of a multi-cycle instruction, this instruction is completed before the
interrupt is served. If an interrupt occurs when the MCU is in sleep mode, the interrupt execution
response time is increased by four clock cycles. This increase comes in addition to the start-up time
from the selected sleep mode.
35
as 2/4/8/16K x 16. For software security, the Flash Program memory space is divided into two
sections, Boot Loader Section and Application Program Section. The Flash memory has an endurance
of at least 10,000 write/erase cycles. The ATmega328 Program Counter (PC) is 11/12/13/14 bits wide,
thus addressing the 2/4/8/16K program memory locations.
SRAM Data Memory:
ATmega328 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/2303 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/2048 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- or Z register.
When using register indirect addressing modes with automatic pre-decrement and post-
increment, the address registers X, Y, and Z are decremented or incremented. The 32 general purpose
working registers, 64 I/O Registers, 160 Extended I/O Registers, and the 512/1024/1024/2048 bytes
of internal data SRAM in the ATmega328 are all accessible through all these addressing modes.
When the IVSEL bit in MCUCR is set, Interrupt Vectors will be moved to the start of the Boot
Flash Section. The address of each Interrupt Vector will then be the address in this table added to the
start address of the Boot Flash Section.Table below shows reset and Interrupt Vectors placement for
the various combinations of BOOTRST and IVSEL settings. If the program never enables an interrupt
source, the Interrupt Vectors are not used, and regular program code can be placed at these locations.
This is also the case if the Reset Vector is in the Application section while the Interrupt Vectors are in
the Boot section or vice versa.
37
Table 4.3 Reset and Interrupt Vectors Placement in ATmega328 and ATmega328P
38
3.7.1 Arduino Characteristics
Power
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically. External (non-USB) power can come either from an AC-
to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-
positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector. The board can operate on an external supply of 6 to 20 volts. If
supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.
The power pins are as follows:
VIN: The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can supply
voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the
VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND. Ground pins.
IOREF. This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working
with the 5V or 3.3V.
Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).
39
Serial Communication:
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board
channels this serial communication over USB and appears as a virtual com port to software on the
computer. The '16U2 firmware uses the standard USB COM drivers, and no external driver is needed.
However, on Windows, a .inf file is required. The Arduino software includes a serial monitor which
allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the
board will flash when data is being transmitted via the USB-to-serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's digital pins. The
ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire
library to simplify use of the I2C bus. For SPI communication, use the SPI library.
3.8 Conclusion
In this chapter Arduino, ATmega328, and also about the Embedded system and its application
was dicussed.
40
Fig 3.3.2 Regulated Power Supply
The basic circuit diagram of a regulated power supply (DC O/P) with led connected as
load is shown in fig: 3.3.3.
Fig 3.3.3 Circuit diagram of Regulated Power Supply with Led connection
41
The components mainly used in above figure are
230V AC MAINS
TRANSFORMER
BRIDGE RECTIFIER(DIODES)
CAPACITOR
VOLTAGE REGULATOR(IC 7805)
RESISTOR
LED(LIGHT EMITTING DIODE)
The detailed explanation of each and every component mentioned above is as follows:
Transformation: The process of transforming energy from one device to another is called
transformation. For transforming energy we use transformers.
Transformers:
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled conductors without changing its frequency. A varying current in the first
or primary winding creates a varying magnetic flux in the transformer's core, and thus a
varying magnetic field through the secondary winding. This varying magnetic field induces a
varying electromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutual
induction.
If a load is connected to the secondary, an electric current will flow in the secondary
winding and electrical energy will be transferred from the primary circuit through the transformer to
the load. This field is made up from lines of force and has the same shape as a bar magnet.
42
If the current is increased, the lines of force move outwards from the coil. If the current
is reduced, the lines of force move inwards.
If another coil is placed adjacent to the first coil then, as the field moves out or in, the
moving lines of force will "cut" the turns of the second coil. As it does this, a voltage is induced in the
second coil. With the 50 Hz AC mains supply, this will happen 50 times a second. This is called
MUTUAL INDUCTION and forms the basis of the transformer.
The input coil is called the PRIMARY WINDING; the output coil is the SECONDARY
WINDING. Fig: 3.3.4 shows step-down transformer.
For example, if the secondary has half the primary turns; the secondary will have half
the primary voltage.
Another example is if the primary has 5000 turns and the secondary has 500 turns, then
the turn’s ratio is 10:1.
If the primary voltage is 240 volts then the secondary voltage will be x 10 smaller = 24
volts. Assuming a perfect transformer, the power provided by the primary must equal the power taken
by a load on the secondary. If a 24-watt lamp is connected across a 24 volt secondary, then the
primary must supply 24 watts.
43
To aid magnetic coupling between primary and secondary, the coils are wound on a
metal CORE. Since the primary would induce power, called EDDY CURRENTS, into this core, the
core is LAMINATED. This means that it is made up from metal sheets insulated from each other.
Transformers to work at higher frequencies have an iron dust core or no core at all.
Note that the transformer only works on AC, which has a constantly changing current
and moving field. DC has a steady current and therefore a steady field and there would be no
induction.
Some transformers have an electrostatic screen between primary and secondary. This is
to prevent some types of interference being fed from the equipment down into the mains supply, or in
the other direction. Transformers are sometimes used for IMPEDANCE MATCHING.
Step Up transformer:
In case of step up transformer, primary windings are every less compared to secondary
winding.
Because of having more turns secondary winding accepts more energy, and it releases more voltage at
the output side.
Incase of step down transformer, Primary winding induces more flux than the
secondary winding, and secondary winding is having less number of turns because of that it accepts
less number of flux, and releases less amount of voltage.
A battery is a type of linear power supply that offers benefits that traditional line-
operated power supplies lack: mobility, portability and reliability. A battery consists of multiple
electrochemical cells connected to provide the voltage desired. Fig: 3.3.5 shows Hi-Watt 9V battery
44
Fig 3.3.5: Hi-Watt 9V Battery
The most commonly used dry-cell battery is the carbon-zinc dry cell battery. Dry-cell
batteries are made by stacking a carbon plate, a layer of electrolyte paste, and a zinc plate alternately
until the desired total voltage is achieved. The most common dry-cell batteries have one of the
following voltages: 1.5, 3, 6, 9, 22.5, 45, and 90. During the discharge of a carbon-zinc battery, the
zinc metal is converted to a zinc salt in the electrolyte, and magnesium dioxide is reduced at the
carbon electrode. These actions establish a voltage of approximately 1.5 V.
The lead-acid storage battery may be used. This battery is rechargeable; it consists of
lead and lead/dioxide electrodes which are immersed in sulfuric acid. When fully charged, this type of
battery has a 2.06-2.14 V potential (A 12 volt car battery uses 6 cells in series). During discharge, the
lead is converted to lead sulfate and the sulfuric acid is converted to water. When the battery is
charging, the lead sulfate is converted back to lead and lead dioxide A nickel-cadmium battery has
become more popular in recent years. This battery cell is completely sealed and rechargeable. The
electrolyte is not involved in the electrode reaction, making the voltage constant over the span of the
batteries long service life. During the charging process, nickel oxide is oxidized to its higher oxidation
state and cadmium oxide is reduced. The nickel-cadmium batteries have many benefits. They can be
stored both charged and uncharged. They have a long service life, high current availabilities, constant
voltage, and the ability to be recharged. Fig: 3.3.6 shows pencil battery of 1.5V.
45
RECTIFICATION:
Rectifiers:
A rectifier is an electrical device that converts alternating current (AC) to direct current
(DC), a process known as rectification. Rectifiers have many uses including as components of power
supplies and as detectors of radio signals. Rectifiers may be made of solid-state diodes, vacuum tube
diodes, mercury arc valves, and other components.
A device that it can perform the opposite function (converting DC to AC) is known as
an inverter.
When only one diode is used to rectify AC (by blocking the negative or positive
portion of the waveform), the difference between the term diode and the term rectifier is merely one
of usage, i.e., the term rectifier describes a diode that is being used to convert AC to DC. Almost all
rectifiers comprise a number of diodes in a specific arrangement for more efficiently converting AC to
DC than is possible with only one diode. Before the development of silicon semiconductor rectifiers,
vacuum tube diodes and copper (I) oxide or selenium rectifier stacks were used.
The Bridge rectifier circuit is shown in fig: 3.3.7, which converts an ac voltage to dc
voltage using both half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the
figure. The circuit has four diodes connected to form a bridge. The ac input voltage is applied to the
diagonally opposite ends of the bridge. The load resistance is connected between the other two ends of
the bridge.
For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas
diodes D2 and D4 remain in the OFF state. The conducting diodes will be in series with the load
resistance RL and hence the load current flows through RL.
46
For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series with the load
resistance RL and hence the current flows through RL in the same direction as in the previous half
cycle. Thus a bi-directional wave is converted into a unidirectional wave.
Input Output
DB107:
Now -a -days Bridge rectifier is available in IC with a number of DB107. In our project
we are using an IC in place of bridge rectifier. The picture of DB 107 is shown in fig: 3.3.8.
Features:
Filtration:
The process of converting a pulsating direct current to a pure direct current using filters
is called as filtration.
Filters:
Introduction to Capacitors:
48
Fig 3.3.9:Construction Of a Capacitor Fig 3.3.10:Electrolytic Capaticor
Units of Capacitance:
Operation of Capacitor:
First, let's consider the case of a "coupling capacitor" where the capacitor is used to
connect a signal from one part of a circuit to another but without allowing any direct current to flow.
49
However, if there is a steady current, only the initial short burst
will flow until the "floating ball valve" closes and stops further
flow.
So a coupling capacitor allows "alternating current" to pass through because the ball
valve doesn't get a chance to close as the waves go up and down. However, a steady current quickly
fills the tank so that all flow stops.
A capacitor will pass alternating current but (apart from an initial surge) it will not pass
d.c.
Regulation:
Voltage Regulator:
A voltage regulator (also called a ‘regulator’) with only three terminals appears to be a
simple device, but it is in fact a very complex integrated circuit. It converts a varying input voltage
into a constant ‘regulated’ output voltage. Voltage Regulators are available in a variety of outputs like
5V, 6V, 9V, 12V and 15V. The LM78XX series of voltage regulators are designed for positive input.
50
For applications requiring negative input, the LM79XX series is used. Using a pair of ‘voltage-
divider’ resistors can increase the output voltage of a regulator circuit.
It is not possible to obtain a voltage lower than the stated rating. You cannot use a 12V
regulator to make a 5V power supply. Voltage regulators are very robust. These can withstand over-
current draw due to short circuits and also over-heating. In both cases, the regulator will cut off before
any damage occurs. The only way to destroy a regulator is to apply reverse voltage to its input.
Reverse polarity destroys the regulator almost instantly. Fig: 3.3.11 shows voltage regulator.
Resistors:
A resistor is a two-terminal electronic component that produces a voltage across its terminals
that is proportional to the electric current passing through it in accordance with Ohm's law:
V = IR
Resistors are elements of electrical networks and electronic circuits and are ubiquitous in most
electronic equipment. Practical resistors can be made of various compounds and films, as well as
resistance wire (wire made of a high-resistivity alloy, such as nickel/chrome).
The primary characteristics of a resistor are the resistance, the tolerance, maximum working
voltage and the power rating. Other characteristics include temperature coefficient, noise, and
inductance. Less well-known is critical resistance, the value below which power dissipation limits the
maximum permitted current flow, and above which the limit is applied voltage. Critical resistance is
determined by the design, materials and dimensions of the resistor.
51
Resistors can be made to control the flow of current, to work as Voltage dividers, to
dissipate power and it can shape electrical waves when used in combination of other components.
Basic unit is ohms.
Theory of operation:
Ohm's law:
The behavior of an ideal resistor is dictated by the relationship specified in Ohm's law:
V = IR
Ohm's law states that the voltage (V) across a resistor is proportional to the current (I)
through it where the constant of proportionality is the resistance (R).
Power dissipation:
The power dissipated by a resistor (or the equivalent resistance of a resistor network) is
calculated using the following:
52
3.4. LED:
Working:
The structure of the LED light is completely different than that of the light bulb.
Amazingly, the LED has a simple and strong structure. The light-emitting semiconductor material is
what determines the LED's color. The LED is based on the semiconductor diode.
When a diode is forward biased (switched on), electrons are able to recombine with
holes within the device, releasing energy in the form of photons. This effect is called
electroluminescence and the color of the light (corresponding to the energy of the photon) is
determined by the energy gap of the semiconductor. An LED is usually small in area (less than
1 mm2), and integrated optical components are used to shape its radiation pattern and assist in
reflection. LED’s present many advantages over incandescent light sources including lower energy
53
consumption, longer lifetime, improved robustness, smaller size, faster switching, and greater
durability and reliability. However, they are relatively expensive and require more precise current and
heat management than traditional light sources. Current LED products for general lighting are more
expensive to buy than fluorescent lamp sources of comparable output. They also enjoy use in
applications as diverse as replacements for traditional light sources in automotive lighting
(particularly indicators) and in traffic signals. The compact size of LED’s has allowed new text and
video displays and sensors to be developed, while their high switching rates are useful in advanced
communications technology. The electrical symbol and polarities of led are shown in fig: 3.4.3.
No UV Rays
Visual signal application where the light goes more or less directly from the LED to the human
eye, to convey a message or meaning.
Illumination where LED light is reflected from object to give visual response of these objects.
Generate light for measuring and interacting with processes that do not involve the human visual
system. BLUE TOOTH Module:
‘Bluetooth’, the short-range radio link technology designed to "connect" an array of devices
including mobile phones, PC’s, and PDA’s, and the strategic decisions that Motorola should make in
incorporating this nascent technology into its product portfolio. The purpose of this paper will be to
provide a high-level overview of the technology to the head of Motorola's Communications
Enterprise, and prepare this corporate officer to be strategically and functionally conversant in the
technology with subordinates that have direct responsibility for integrating Bluetooth into Motorola's
product lines. The first sections of the paper detail the background of the Bluetooth technology and its
associated Special-Interest Group, or SIG, (a conglomeration of firms that has sought to reduce
market uncertainty, thereby expediting the diffusion of Bluetooth devices). Bluetooth’s perceived
strengths over other wireless connectivity technologies are also discussed and some macro-level
threats that may impede Bluetooth diffusion are outlined. The remainder of the paper details potential
Bluetooth markets (in terms of consumer and corporate applications) and examines Motorola's current
Bluetooth product offerings (a cell phone battery and computer PCMCIA card each enabled with a
Bluetooth chip). Finally, the paper provides guidance for Motorola's Bluetooth application
development strategies regarding the applications outlined in the SIG's specifications, namely
emphasizing those applications that leverage existing complementary assets, and those that are critical
to Bluetooth adoption regardless of prior expertise.
3.5.1 History
55
personal digital assistants for the first wave. For instance, this technology could enable Palm Pilots to
synchronize with each other, PCs, or with a mobile phone. This effort to provide a wide range of
wireless data and voice communication to disparate devices may have a significant impact on the way
people synchronize and share data, in that the time and ease of communicating improves radically. To
date, no other effort has been so comprehensive, incorporating potentially dozens of devices with
eclectic user groups (most notably the home and business user). Given an increasing desire amongst
consumer and commercial users for mobility and connectivity, Bluetooth proponents expect that the
demand for Bluetooth technology will lead to its rapid adoption. Dataquest estimates that two-thirds
of all new mobile phone handsets will utilize Bluetooth by 2004. That amounts to more than 570
million phones, as compared to less than 1% this year, or 1.2 million phones (See Exhibit 1). Most
believe that the growth and ultimate success of Bluetooth, much like fax machines and email, will be
dependent on Metcalfe’s Law, which states that the value of a system increases proportionately to the
number of nodes in that system.
The Bluetooth SIG started out with a better strategy than many other technology innovators. It
marketed the Bluetooth concept and membership heavily, accentuating the potential of the technology
to hardware and software developers and manufacturers. Unlike some earlier groups, this SIG
encouraged broad membership, as it charges no fees to join—no royalties, guarantees, or promises.
This open standard has enabled the original five-member group to reach more than 2,108 members to
date; there is massive momentum behind this initiative. More striking, the SIG has focused on a
global roadmap from the onset, supporting country-specific local laws and restrictions, thus lowering
hurdles at the point of initialization. The members of the SIG clearly understand that Bluetooth will
create a "Mix and Match" market, and have worked to unite a broad range of manufacturers under one
standard and minimize the uncertainty for manufacturers and consumers. From G. Moore's "Chasm"
perspective, the users are any firms that can utilize the technology, and SIG has attained critical mass
amongst these “users.” The manufacturer is the critical component of the adoption cycle, rather than
the consumer, because the benefits of the Bluetooth technology are dependent on the availability of a
complementary variety of Bluetooth enabled devices. Accordingly, the support from a wide
assortment of device manufacturers is essential to ensure widespread customer adoption.
Consequently, the SIG has dramatically shortened the product adoption cycle and created market
momentum that will surmount the chasm between early and mainstream markets.
Bluetooth itself is a low-power, short-range radio that will operate on average from 10 meters
to 100 meters. These radios are built on silicon using the most common chip fabrication technology, a
56
CMOS (complimentary metal oxide silicon) process, although some will be built on silicon-
germanium wafers. The module, which essentially is a commodity radio, also includes a baseband
hardware link controller, a link management interface, and software applications to run the module.
The Bluetooth SIG expects the modules will cost $25-$30 each through the end of 2000. Thereafter,
the price is expected to decrease as the volumes increase, possibly to as low as $5-$10 per module.
3.5.2 Advantages
Bluetooth has the potential to improve personal communications (consumer and corporate)
and productivity by creating personal networks between all of a user's electronic devices. It operates
in the unlicensed, internationally available 2.45GHz band and is a much more robust technology than
other wireless technologies used for similar applications, most notably infrared-- which requires a line
of sight link between communicating devices. Bluetooth’s multidirectional capability makes the
technology adaptable to a multitude of applications. Additionally, Bluetooth can enable up to eight
devices at one time, forming a ‘piconet’, communicating amongst themselves (See Exhibit 2).
3.5.3 Disadvantages
First and foremost, for Bluetooth to become widely adopted, the incremental costs for enabling
Bluetooth technology need to decline significantly. As mentioned, Bluetooth’s success is network
constrained - if it is not widely adopted, its usefulness and capabilities are limited, much like
applications like ICQ. Unlike ICQ, the cost for manufacturers to incorporate Bluetooth chipsets into
devices and the subsequent costs to consumers are presently quite high--at its current cost levels,
wide-scale adoption is not likely. While prices are anticipated to drop to the $5 per device level,
industry analysts believe that the $1 price point is needed for the technology to become truly
ubiquitous (i.e. in a variety of CE products, not simply limited to cell phones and PDAs).
57
In the software and hardware industries, certain companies have been known to take open,
clearly defined standards, and modify them slightly, and then claim that the modified standard was
proprietary. In this way, standards have fragmented and products that should be compatible have not
been. New applications have also failed to be correctly aligned with the traditional and ‘revised’
standards, leading to compatibility and design confusion concerns. A positive for the Bluetooth
platform is its capability to support the robust, versatile TCP/IP platform.
It should be noted that this paper will not attempt to address the threats that extend somewhat
beyond Motorola's operational parameters (in the sense that Motorola cannot dictate the usage
parameters of unlicensed spectrum, nor control the development activities of independent business
entities). The paper assumes that most companies will adhere to the SIG specifications and that the
Bluetooth architecture will withstand bandwidth congestion; it then focuses on the potential markets
and immediate development strategies that Motorola should undertake to effectively incorporate
Bluetooth into the company's product portfolio and speed Bluetooth on its way to widespread
adoption.
3.5.4 Applications
According to Stephens, Inc., given Bluetooth’s status as an embryonic technology, the market
for Bluetooth-enabled devices has been characterized as “very much in its infancy stage.”
Nonetheless, there are numerous applications that Bluetooth enables in the marketplace. The
following delineates the potential markets for the Bluetooth under two broad categories, Consumer
and Corporate.
Consumer Market:
58
The SIG is initially launching Bluetooth as a cable replacement technology that is easy to use
and highly mobile. Accordingly, the most viable market will be the consumer market, which can be
divided into two separate areas: (i) Domestic applications (ii) Personal communications.
Domestic applications: encompass wireless connectivity for devices within the home environment
such as home entertainment equipment. This could be as simple as replacing infrared remote controls
for televisions and hi-fis with a Bluetooth device that obviates the need for line of sight
communication. Another example is a Bluetooth enabled DVD player that will automatically connect
itself to the TV, VCR, speakers et al without coaxial cables. The potential utilization of Bluetooth
includes the eventual wireless control of a multitude of domestic devices from lighting to security
systems.
Personal communications: covers applications that enhance the way individuals address their
communications needs. Per the Ovum report, the salient Bluetooth application can be effectively
described as “hidden computing”. This encompasses three elements: (i) Automatic file synchronizer:
Bluetooth permits users to automatically synchronize elements of their desktops, laptops, PDAs and
cellular phones. This includes automatic updating of the address book and calendars with changes in
one device automatically changed on another once the two come within range of each other. (ii)
Briefcase trick: a Bluetooth connection permits access to e-mail without taking the laptop out of its
case. When the laptop receives an e-mail, it will alert the user via their cellular phone. The user can
then browse all incoming e-mails via the cellular phone. (iii) Forbidden message: this allows an e-
mail composed on a laptop to be automatically sent to the user's cellular phone when the latter is
switched on. This is particularly useful for business travelers who cannot send e-mails while on a
plane - cellular phones must be switched off. This feature can also be utilized in other places where
mobile phones are not permitted, such as hospitals.
Corporate Market:
Some of the applications enumerated for the consumer market are also applicable to the
corporate world, especially automatic file synchronization. The following are other viable corporate
areas for Bluetooth:
Wireless Office Infrastructure: using Bluetooth to connect all desktop devices wirelessly. The
mouse, keyboard and desktop monitor can all be connected to the PC without wires, allowing
59
greater flexibility. This can also eliminate the need for connecting the PC to the printer and the
LAN
LAN-in-a-box applications: Bluetooth enables small groups of workers to establish their own
LAN while off-site, for example, for consulting engagements or audits
Shared Sites: constitute large sites where there is heavy use of computing equipment and high
traffic volumes need to be catered for. Therefore, installing or moving a wired LAN can be highly
disruptive. Bluetooth can eliminate this. Segments within this market include financial/securities
markets, government offices and departments, hospitals and universities
Difficult to wire environments: wireless connectivity via Bluetooth is effective where cabling can
cause problems. Public access locations where cabling runs the risk of being damaged such as
airports, department stores or hospitals. Industrial sites with potentially dangerous environments
such as extreme temperatures. Listed buildings with restrictions on building modifications
Current State: Motorola is not currently working on applications that would allow a Bluetooth enabled
keyboard, mouse, or other serial device to connect wirelessly with a computer.
60
Relevance to Motorola’s Current Business Model/Complementary Assets: These products are low-
tech and low margin. Motorola does not have the expertise nor the complementary assets required in
manufacturing, marketing, or distributing these types of products.
Competitive Environment: Motorola would face fierce competition from established companies such
as Microsoft and Logitech.
Strategic Recommendation: Motorola would have to re-tool manufacturing facilities that are
producing high margin products in order to produce the low margin serial devices. Motorola would
also have to absorb the costs associated with traveling up the learning curve before it could attain a
similar cost base to its competitors. Additionally, avoiding head-to-head competition with Microsoft
is almost always a good strategy. Therefore, Motorola should not devote resources to developing
serial port applications.
Headsets:
Current State: Motorola is currently working on applications that would allow a Bluetooth enabled
cellular phone to connect with a wireless headset.
Competitive Environment: Motorola will face competition from the traditional cellular phone
manufacturers, such as Ericsson and Nokia, because all manufacturers will need to offer a wireless
headset to complement their phones.
Strategic Recommendation: Motorola should invest the necessary resources to get to market quickly
with a high-quality wireless headset. This application will also allow cellular phone customers to
experience the benefits of Bluetooth in a familiar, easy-to-use product with obvious benefits.
Current State: Motorola is not working on a stand-alone wireless modem/fax application that utilizes
Bluetooth.
61
Relevance to Motorola’s Current Business Model/Complementary Assets: Motorola has robust
experience and complementary assets in both wireless technology and wireline modem
manufacturing.
Competitive Environment: The market for wireless modems, connected by cable from the PC to
(usually) a cell phone with modem capability is not large because current performance level's are in
the 14.4 Kbps range. Demand is expected to increase as wireless data rates increase between the
wireless modem devices and the cellular infrastructure.
Strategic Recommendation: Motorola should not invest in developing standalone wireless modem
devices. They should continue to focus on the development process for high-speed, cellular phone-
based wireless modems with Bluetooth interface capability. Motorola should increase development
expenditures, as necessary, to ensure that cell phone/modem's availability coincides with the
availability of high-speed cellular data infrastructure (projected for the first half of 2002).
Current State: Motorola is not presently working on Bluetooth enabled access point connections to
company Intranets.
Competitive Environment: There are already competing formats for wireless LAN access such as
Hiper LAN and IEEE802.11. These products/standards permit data transmissions at speeds much
faster than Bluetooth and over much longer distances.
Strategic Recommendation: Because of its lack of complementary assets and experience, Motorola
should not invest resources in developing Bluetooth products aimed at this market.
3.8 Advantages:
62
Bluetooth has a lot to offer with an increasingly difficult market place. Bluetooth helps to
bring with it the promise of freedom from the cables and simplicity in networking that has yet to be
matched by LAN (Local Area Network).
In the key marketplace, of wireless and handheld devices, the closest competitor to Bluetooth
is infrared. Infrared holds many key features, although the line of sight it provides doesn't go through
walls or through obstacles like that of the Bluetooth technology.
Unlike infrared, Bluetooth isn't a line of sight and it provides ranges of up to 100 meters.
Bluetooth is also low power and low processing with an overhead protocol. What this means, is that
it's ideal for integration into small battery powered devices. To put it short, the applications with
Bluetooth are virtually endless.
3.9 Disadvantages:
Bluetooth has several positive features and one would be extremely hard pressed to find
downsides when given the current competition. The only real downsides are the data rate and security.
Infrared can have data rates of up to 4 MBps, which provides very fast rates for data transfer, while
Bluetooth only offers 1 MBps.
For this very reason, infrared has yet to be dispensed with completely and is considered by
many to be the complimentary technology to that of Bluetooth. Infrared has inherent security due to
its line of sight.
The greater range and radio frequency (RF) of Bluetooth make it much more open to
interception and attack. For this reason, security is a very key aspect to the Bluetooth specification.
Although there are very few disadvantages, Bluetooth still remains the best for short range
wireless technology. Those who have tried it love it, and they know for a fact that Bluetooth will be
around for years to come.
A dc motor uses electrical energy to produce mechanical energy, very typically through
the interaction of magnetic fields and current-carrying conductors. The reverse process, producing
electrical energy from mechanical energy, is accomplished by an alternator, generator or dynamo.
63
Many types of electric motors can be run as generators, and vice versa. The input of a DC motor is
current/voltage and its output is torque (speed).
The DC motor has two basic parts: the rotating part that is called the armature and the stationary part
that includes coils of wire called the field coils. The stationary part is also called the stator. Figure
shows a picture of a typical DC motor, Figure shows a picture of a DC armature, and Fig shows a
picture of a typical stator. From the picture you can see the armature is made of coils of wire wrapped
around the core, and the core has an extended shaft that rotates on bearings. You should also notice
that the ends of each coil of wire on the armature are terminated at one end of the armature. The
termination points are called the commutator, and this is where the brushes make electrical contact to
bring electrical current from the stationary part to the rotating part of the machine.
Operation:
The DC motor you will find in modem industrial applications operates very similarly
to the simple DC motor described earlier in this chapter. Figure 12-9 shows an electrical diagram of a
simple DC motor. Notice that the DC voltage is applied directly to the field winding and the brushes.
The armature and the field are both shown as a coil of wire. In later diagrams, a field resistor will be
added in series with the field to control the motor speed.
When voltage is applied to the motor, current begins to flow through the field coil
from the negative terminal to the positive terminal. This sets up a strong magnetic field in the field
winding. Current also begins to flow through the brushes into a commutator segment and then through
an armature coil. The current continues to flow through the coil back to the brush that is attached to
64
other end of the coil and returns to the DC power source. The current flowing in the armature coil sets
up a strong magnetic field in the armature.
The magnetic field in the armature and field coil causes the armature to begin to rotate.
This occurs by the unlike magnetic poles attracting each other and the like magnetic poles repelling
each other. As the armature begins to rotate, the commutator segments will also begin to move under
the brushes. As an individual commutator segment moves under the brush connected to positive
voltage, it will become positive, and when it moves under a brush connected to negative voltage it
will become negative. In this way, the commutator segments continually change polarity from positive
to negative. Since the commutator segments are connected to the ends of the wires that make up the
field winding in the armature, it causes the magnetic field in the armature to change polarity
continually from north pole to south pole. The commutator segments and brushes are aligned in such a
way that the switch in polarity of the armature coincides with the location of the armature's magnetic
field and the field winding's magnetic field. The switching action is timed so that the armature will not
65
lock up magnetically with the field. Instead the magnetic fields tend to build on each other and
provide additional torque to keep the motor shaft rotating.
When the voltage is de-energized to the motor, the magnetic fields in the armature and
the field winding will quickly diminish and the armature shaft's speed will begin to drop to zero. If
voltage is applied to the motor again, the magnetic fields will strengthen and the armature will begin
to rotate again.
When the enable input is low, those drivers are disabled and their outputs are off and in
the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge)
reversible drive suitable for solenoid or motor applications. On the L293, external high-speed output
clamp diodes should be used for inductive transient suppression. A VCC1 terminal, separate from
VCC2, is provided for the logic inputs to minimize device power dissipation. The L293and L293D is
characterized for operation from 0°C to 70°C.
66
Fig 3.6.1: L293D IC Fig 3.6.2: L293D Pin
Diagram
67
Fig 3.6.3: Internal structure of L293D.
Features of L293D:
Breadboards are great for prototyping equipment as it allows great flexibility to modify
a design when needed; however the final product of a project, ideally should have a neat PCB, few
cables, and survive a shake test. Not only is a proper PCB neater but it is also more durable as there
are no cables which can yank loose.
Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very easy to use, but it
does have several limitations.
Express PCB has been used to design many PCBs (some layered and with surface-mount
parts. Print out PCB patterns and use the toner transfer method with an Etch Resistant Pen to make
boards. However, Express PCB does not have a nice print layout. Here is the procedure to design in
Express PCB and clean up the patterns so they print nicely.
Express PCB comes with a less then exciting list of parts. So before any project is started
head over to Audio logic and grab the additional parts by morsel, ppl, and tangent, and extract them
into your Express PCB directory. At this point start the program and get ready to setup the workspace
to suit your style.
Click View -> Options. In this menu, setup the units for “mm” or “in” depending on how
you think, and click “see through the top copper layer” at the bottom. The standard color scheme of
red and green is generally used but it is not as pleasing as red and blue.
When a project is first started you will be greeted with a yellow outline. This yellow outline
is the dimension of the PCB. Typically after positioning of parts and traces, move them to their final
position and then crop the PCB to the correct size. However, in designing a board with a certain size
constraint, crop the PCB to the correct size before starting.
Fig: 4.1 show the toolbar in which the each button has the following functions:
The select tool: It is fairly obvious what this does. It allows you to move and manipulate
parts. When this tool is selected the top toolbar will show buttons to move traces to the top /
bottom copper layer, and rotate buttons.
69
The zoom to selection tool: does just that.
The place pad: button allows you to place small soldier pads which are useful for board
connections or if a part is not in the part library but the part dimensions are available. When
this tool is selected the top toolbar will give you a large selection of round holes, square holes
and surface mount pads.
The place component: tool allows you to select a component from the top toolbar and then by
clicking in the workspace places that component in the orientation chosen using the buttons
next to the component list. The components can always be rotated afterwards with the select
tool if the orientation is wrong.
The place trace: tool allows you to place a solid trace on the board of varying thicknesses. The
top toolbar allows you to select the top or bottom layer to place the trace on.
The Insert Corner in trace: button does exactly what it says. When this tool is selected,
clicking on a trace will insert a corner which can be moved to route around components and
other traces.
The remove a trace button is not very important since the delete key will achieve the same
result.
Before starting a project there are several ways to design a PCB and one must be
chosen to suit the project’s needs.
When making a PCB you have the option of making a single sided board, or a double
sided board. Single sided boards are cheaper to produce and easier to etch, but much harder to
design for large projects. If a lot of parts are being used in a small space it may be difficult to make
a single sided board without jumpering over traces with a cable. While there’s technically nothing
wrong with this, it should be avoided if the signal travelling over the traces is sensitive (e.g. audio
signals).
70
A double sided board is more expensive to produce professionally, more difficult to
etch on a DIY board, but makes the layout of components a lot smaller and easier. It should be noted
that if a trace is running on the top layer, check with the components to make sure you can get to its
pins with a soldering iron. Large capacitors, relays, and similar parts which don’t have axial leads
can NOT have traces on top unless boards are plated professionally.
When using a double sided board you must consider which traces should be on what
side of the board. Generally, put power traces on the top of the board, jumping only to the bottom if
a part cannot be soldiered onto the top plane (like a relay), and vice- versa.
Some projects like power supplies or amps can benefit from having a solid plane to use
for ground. In power supplies this can reduce noise, and in amps it minimizes the distance between
parts and their ground connections, and keeps the ground signal as simple as possible. However,
care must be taken with stubborn chips such as the TPA6120 amplifier from TI. The TPA6120
datasheet specifies not to run a ground plane under the pins or signal traces of this chip as the
capacitance generated could effect performance negatively.
PIC C is not much different from a normal C program. If you know assembly, writing
a C program is not a crisis. In PIC, we will have a main function, in which all your application
specific work will be defined. In case of embedded C, you do not have any operating system running
in there. So you have to make sure that your program or main file should never exit. This can be done
with the help of simple while (1) or for (;;) loop as they are going to run infinitely.
We have to add header file for controller you are using, otherwise you will not be able
to access registers related to peripherals.
4.3 Proteus:
Proteus is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller and this is done by the Proteus.
Proteus is a programmer which itself contains a microcontroller in it other than the one which is to be
programmed. This microcontroller has a program in it written in such a way that it accepts the hex file
from the pic compiler and dumps this hex file into the microcontroller which is to be programmed. As
the Proteus programmer requires power supply to be operated, this power supply is given from the
power supply circuit designed and connected to the microcontroller in proteus. The program which is
to be dumped in to the microcontroller is edited in proteus and is compiled and executed to check any
errors and hence after the successful compilation of the program the program is dumped in to the
microcontroller using a dumper.
72
Open Aurduno C compiler.
You will be prompted to choose a name for the new project, so create a separate folder where
all the files of your project will be stored, choose a name and click save.
Installing the Drivers for the Arduino Uno (from Arduino.cc)
Plug in your board and wait for Windows to begin it’s driver installation
process
After a few moments, the process will fail, despite its best efforts
While in the Control Panel, navigate to System and Security. Next, click
on System
Look under Ports (COM & LPT). You should see an open port named
“Arduino UNO (COMxx)”. If there is no COM & LPT section, look under
‘Other Devices’ for ‘Unknown Device’
Right click on the “Arduino UNO (COMxx)” or “Unknown Device” port and
choose the “Update Driver Software” option
Next, choose the “Browse my computer for Driver software” option
73
Finally, navigate to and select the Uno’s driver file, named
“ArduinoUNO.inf”, located in the “Drivers” folder of the Arduino Software
download (not the “FTDI USB Drivers” sub-directory). If you cannot see
the .inf file, it is probably just hidden. You can select the ‘drivers’ folder
with the ‘search sub-folders’ option selected instead.
Windows will finish up the driver installation from there
Open the Blink example sketch by going to: File > Examples > 1.Basics >
Blink
74
Select the type of Arduino board you’re using: Tools > Board > your
board type
75
Select the serial/COM port that your Arduino is attached to: Tools > Port
> COMxx
If you’re not sure which serial device is your Arduino, take a look at the
available ports, then unplug your Arduino and look again. The one that
disappeared is your Arduino.
With your Arduino board connected, and the Blink sketch open, press
the ‘Upload’ button
76
After a second, you should see some LEDs flashing on your Arduino,
followed by the message ‘Done Uploading’ in the status bar of the Blink
sketch.
If everything worked, the onboard LED on your Arduino should now be
blinking! You just programmed your first Arduino!
77
CHAPTER 5: PROJECT DESCRIPTION
78
Fig 5.1: Schematic diagram of Mobile phone controlled four legged walking robot
79
CHAPTER 6: ADVANTAGES AND DISADVANTAGES
Advantages:
80
CHAPTER 7: RESULTS
7.1 Result:
The project is Designed for “Mobile controlled robot” such that Robot can
move in either directions such as in Forward or Backward by the predefined keys assigned in the
mobile Android App which is communicated through Bluetooth.In this the servomotor is used to open
the seed dispenser cap.
7.2 Conclusion:
Integrating features of all the hardware components used have been developed in it.
Presence of every module has been reasoned out and placed carefully, thus contributing to the best
working of the unit. Secondly, using highly advanced IC’s with the help of growing technology, the
project has been successfully implemented. Thus the project has been successfully designed and
tested.
Future Scope:
Our project “solar based seed sowing robot” is mainly intended to design a walking
robot which can be able to walk on uneven surfaces also. This project uses a bluetooth and a Robot to
be operated. The bluetooth and Robot are interfaced to the micro controller. The micro controller is
programmed in such a way that a specified key pressed in the mobile transmits the data which is
received by the bluetooth , which is fed as input to the controller which in turn moves the Robot in
specified direction.
This project can be extended by using wireless technologies like RF, Zigbee, which
increases the operating distance and by interfacing a video camera to this system, we can have the
images. Also, by interfacing sensor it helps in detecting human presence in restricted areas.
81
By connecting wireless camera to the robot, then we can see the outer world from our
personal computer only by using GPRS and GPS. We can use this robot at so many fields and we can
use to handle so many situations.
By connecting bomb detector to the robot, we can send it to anywhere i.e (battle field,
forests, coal mines, to anyplace) by using our personal computer and we can able to detect the bomb
at field, here sensor detects the bomb and gives information to micro controller and it gives the
information to transceiver and it sends the information to the personal computer.
By connecting temperature sensor to the robot we can get the temperature of dangerous
zones in personal computer itself instead of sending human to there and facing problems at field we
can send robot to there and sensor will detect the temperature and it gives information to the micro
controller and micro controller gives the information to the transceiver from that we can get the data
at pc side.
By connecting smoke sensor to the robot we can get the information related
concentration of smoke or gases in respective field’s i.e. (coal mines, dangerous zones, etc). sensor
sense the information and it give to the micro controller and it gives to the transceiver and from that
we get the information in personal computer.
By connecting firing instrument and wireless camera to the robot we can fire the target
from pc. Here by using camera we can see the opposite target and we can fire the target from personal
computer by pressing selected button and we can easily handle the situations like Mumbai terrorist’s
attack without loss of human life’s and we can decrease our soldiers effort too.
82
REFERENCES
1. www.wikipedia.com
2. www.allaboutcircuits.com
3. www.microchip.com
4. www.howstuffworks.com
Books referred:
6. Embedded C –Michael.J.Pont.
83