BLUETOOTH CONTROLLED SOLAR POWERED ROBOT VEHICLE


BLUETOOTH CONTROLLED SOLAR POWERED

ROBOT VEHICLE

ABSTRACT

The purpose of this project is to build a solar powered Robot with Infrared sensor.
This Robot/car automatically senses the presence of obstacles in its path and changes its
direction of movement. The obstacle detection mechanism is done by an IR sensor that makes
uses of IR waves to find the presence of an obstacle in its path. This Robot is designed in
such a way that there is no requirement of manual attention towards it. It makes use of the
Infrared sensors to detect the obstacle present in its expected trajectory and dynamically
changes the trajectory to be followed. The robot can be operated through Bluetooth via
Android phone to control its direction wirelessly.
This project includes Microcontroller based control system, Blue Link Bluetooth
module, solar powered DC motors and Infrared Sensor. This autonomous Robot senses the
obstacles in its path by continuously transmitting the Infrared waves. If any obstacle comes in
its vicinity then the Infrared waves get reflected back to the robot. The Infrared receiver fitted
on the Robot senses these Infrared waves and this information is passed onto the
Microcontroller. Now the Microcontroller takes necessary action like taking the diversion,
reversing the Robot direction etc. The power required to drive DC motors is supplied from a
battery which is powered by solar panel. The Microcontroller is programmed using
Embedded C language..c

 

CONTENTS

Chapter 1...................................................................................................................................1
1 INTRODUCTION......................................................................................................................1
1.1 Project outline..................................................................................................................1
1.2 Software’s used ................................................................................................................1
1.3 Hardware.........................................................................................................................1
1.4 Block Diagram...................................................................................................................2
Chapter 2...................................................................................................................................3
2 ATMEGA32 MICROCONTROLLER ............................................................................................3
2.0 Features...........................................................................................................................3
2.1 Pin configuration ..............................................................................................................4
2.1.0 Atmega 32 Internal Block Daigram............................................................................5
2.1.1 Pin discription ............................................................................................................6
2.1.2 Alternate PORT function............................................................................................7
2.1.3 Usage of PORTs..........................................................................................................8
2.1.4 USART Registers.........................................................................................................9
Chapter 3.................................................................................................................................12
3 DC MOTORS ..........................................................................................................................12
3.0 Introduction...................................................................................................................12
3.1 Principle of Operation ....................................................................................................12
Chapter 4.................................................................................................................................14
4 MOTOR DRIVER (L293D) .......................................................................................................14
4.1 Pin configuration of L293D.............................................................................................14
4.2 Specifications.................................................................................................................15
4.3 Electrical Characteristic’s ...............................................................................................15
4.4 Operation of L293D ........................................................................................................16
4.5 L293D Interface with microcontroller............................................................................17
Chapter 5.................................................................................................................................18
5 BLUE LINK (Bluetooth module) .............................................................................................18
5.1 Introduction...................................................................................................................18
vii
5.2 Features.........................................................................................................................19
5.3 Pin configuration ............................................................................................................19
5.4 Data transfer to microcontroller....................................................................................20
5.5 Blue term application .....................................................................................................20
Chapter 6.................................................................................................................................22
6. OBSTACLE DETECTING SENSOR (IR SENSOR) .......................................................................22
6.1 Introduction of IR sensor................................................................................................22
6.2 Features.........................................................................................................................22
6.3 Specifications.................................................................................................................22
6.4 Operation .......................................................................................................................23
Chapter 7.................................................................................................................................25
7. SOLAR POWER SUPPLY.........................................................................................................25
7.1 How Silicon makes a Solar Cell.......................................................................................25
7.2 Photovoltaic Cells (Converting Photons to Electrons) ...................................................26
7.3 Solar Cell Efficiency ........................................................................................................27
7.4 Solar Panel......................................................................................................................29
Chapter 8.................................................................................................................................30
8. MECHANICAL PARTS OF ROBOT VEHICLE ............................................................................30
Chapter 9.................................................................................................................................31
9 ISP (IN SYSTEM PROGRAMMING) .........................................................................................31
9.0 Introduction...................................................................................................................31
9.1 The programming interface ...........................................................................................31
9.2 Pin configuration ............................................................................................................32
Chapter 10...............................................................................................................................34
10 SOFTWARE ..........................................................................................................................34
10.1 AVR Studio compilation process ..................................................................................34
10.2 Source Code .................................................................................................................39
REFERENCES .............................................................................................................................43
1

Chapter 1

1 INTRODUCTION

A robot is a re-programmable multifunctional manipulator. The project
aim is to develop a mobile phone controlled robot vehicle using Bluetooth. Bluetooth is a
high end wireless technology designed for short range communications with high means of
integrity. The main criterion is to provide flexibility and convenience in controlling the robot
vehicle by the resident from any location within the Bluetooth vicinity.
The robot vehicle is monitored by the microcontroller, the microcontroller then converts the
data which is transmitted from Blue link module. The Blue link receives data from the mobile
phone using Blue term app.
This project is designed with microcontroller, driver chips with motors, solar panel for power
supply and Bluetooth module for controlling of robot.
Solar panel consists of number of silicon cells, when sun light falls on this panel it generate
the voltage signals then these voltage signals given to the microcontroller board. Depends on
the panel board size the generated voltage amount is increased.

1.1 Project outline

 A brief introduction to internal architecture of microcontroller.
 An over view of programming of microcontroller
 Microcontroller interfacing with Bluetooth
 Microcontroller interfacing to motors and programming
 Ir sensor interfacing with microcontroller and programming
 Solar power supply

1.2 Software’s used

 Avr studio compiler for compiling and to load the programs

1.3 Hardware

 Atemga32 microcontroller
 5 volts dc motors & LM293D motor driver chip
 Solar panel
 Bluetooth module & IR sensor

1.4 Block Diagram

Chapter 2

2 ATMEGA32 MICROCONTROLLER

2.0 Features

 High-performance, Low-power Atmel® AVR® 8-bit Microcontroller

 Advanced RISC Architecture
– 131 Powerful Instructions – Most Single-clock Cycle Execution
– 32 × 8 General Purpose Working Registers
– Fully Static Operation
– Up to 16 MIPS Throughput at 16MHz
– On-chip 2-cycle Multiplier

 High Endurance Non-volatile Memory segments
– 32Kbytes of In-System Self-programmable Flash program memory
– 1024Bytes EEPROM
– 2Kbytes Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C
– Optional Boot Code Section with Independent Lock Bits

 In-System Programming by On-chip Boot Program

 Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode
– Real Time Counter with Separate Oscillator
– Four PWM Channels
– 8-channel, 10-bit ADC
– 8 Single-ended Channels
– 7 Differential Channels in TQFP Package Only
– 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x
– Byte-oriented Two-wire Serial Interface
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
 Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down
 I/O and Packages
– 32 Programmable I/O Lines
– 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
 Operating Voltages
– 2.7V - 5.5V for ATmega32L
– 4.5V - 5.5V for ATmega32
 Speed Grades
– 0 - 8MHz for ATmega32L
– 0 - 16MHz for ATmega32
 Power Consumption at 1MHz, 3V, 25°C
– Active: 1.1mA
– Idle Mode: 0.35mA
– Power-down Mode: < 1μA

2.1 Pin configuration

2.1.0 Atmega 32 Internal Block Daigram


2.1.1 Pin discription

 VCC: Digital supply voltage.
 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
 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 C (PC7...PC0): Port C is an 8-bit bi-directional I/O port with internal pullup
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 D (PD7...PD0) :Port D is an 8-bit bi-directional I/O port with internal pullup
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.
 RESET: 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: Output from the inverting Oscillator amplifier.
 AVCC: 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: AREF is the analog reference pin for the A/D Converter.

2.1.2 Alternate PORT function

 Port B Special functions
 Port C Special functions

Port D Special functions

2.1.3 Usage of PORTs

 Configuring PORTs
Each port has Data Direction Register, which will allow configure the lines of the
ports as input or output.
7 bit DDRX 0 bit
By putting a 1 in a particular bit position of the DDR register of a port you are configuring
the port line corresponding to that bit s output.
By putting 0 in a particular bit position of the DDR register of a port you are configuring the
port line corresponding to that bit s input.
 Writing to PORTs
After configuring the ports assign 0 or 1 to the port lines .Each port has separate register
called PORTX which will enable to make individual lines in the port high or low.
7 bit PORTX 0 bit
LOW-0,
HIGH-1
0 0 0 0 1 1 1 1
0 1 0 1 0 1 1 0
9
 Reading from PORTs
After configuring the ports the status of the lines connected to the ports can be read.
To do this the register PINX associated with each port.
7 bit PINX 0 bit
If the above register is for PORTB, the following piece of code will read the PORTB pins:
Unsigned char status;
Status=PINB;
The value of status will be 0XD5
When switches are connected to port lines, their status can be read using PINX register.

2.1.4 USART Registers

UDR Register
The USART Transmit Data Buffer Register and USART Receive Data Buffer Registers
share the same I/O address referred to as USART Data Register or UDR. The Transmit Data
Buffer Register (TXB) will be the destination for data written to the UDR Register location.
Reading the UDR Register location will return the contents of the Receive Data Buffer
Register (RXB).
Transmitter (writing TXEN to zero) will not become effective until ongoing and pending
transmissions are completed (that is, when the Transmit Shift Register and Transmit Buffer
Register do not contain data to be transmitted).
When disabled, the Transmitter will no longer override the TxD port .
1 1 0 1 0 1 0 1
10
UCSRC Register
 Bit 7 – URSEL: Register Select
This bit selects between accessing the UCSRC or the UBRRH Register. It is read as one
when reading UCSRC. The URSEL must be one when writing the UCSRC.
 Bit 2:1 – UCSZ1:0: Character Size
The UCSZ1:0 bits combined with the UCSZ2 bit in UCSRB sets the number of data bits
(Character Size) in a frame the Receiver and Transmitter use.
UBBR Register
The UBRRH Register shares the same I/O location as the UCSRC Register.
 Bit 15 – URSEL: Register Select
This bit selects between accessing the UBRRH or the UCSRC Register. It is read as zero
when reading UBRRH. The URSEL must be zero when writing the UBRRH.
 Bit 14:12 – Reserved Bits
These bits are reserved for future use. For compatibility with future devices, these bit must be
written to zero when UBRRH is written.
 Bit 11:0 – UBRR11:0: USART Baud Rate Register
This is a 12-bit register which contains the USART baud rate. The UBRRH contains the four
most significant bits, and the UBRRL contains the eight least significant bits of the USART
baud rate. Ongoing transmissions by the Transmitter and Receiver will be corrupted if the
baud rate is changed. Writing UBRRL will trigger an immediate update of the baud rate
prescaler.

Chapter 3

3 DC MOTORS

3.0 Introduction

A dc motor is a mechanically commutated electric motor powered from direct
current (DC). The stator is stationary in space by definition and therefore its current. The
current in the rotor is switched by the commutator to also be stationary in space. This is how
the relative angle between the stator and rotor magnetic flux is maintained near 90 degrees,
which generates the maximum torque.
DC motors have a rotating armature winding (winding in which a voltage is
induced) but non-rotating armature magnetic field and a static field winding (winding that
produce the main magnetic flux) or permanent magnet. Different connections of the field and
armature winding provide different inherent speed/torque regulation characteristics. The
speed of a DC motor can be controlled by changing the voltage applied to the armature or by
changing the field current. The introduction of variable resistance in the armature circuit or
field circuit allowed speed control. Modern DC motors are often controlled by power
electronics systems called DC drives.
The introduction of DC motors to run machinery eliminated the need for local
steam or internal combustion engines, and line shaft drive systems. DC motors can operate
directly from rechargeable batteries, providing the motive power for the first electric vehicles.

3.1 Principle of Operation

In any electric motor, operation is based on simple electromagnetism. A current-carrying
conductor generates a magnetic field; when this is then placed in an external magnetic field, it
will experience a force proportional to the current in the conductor, and to the strength of the
external magnetic field. As you are well aware of from playing with magnets as a kid,
opposite (North and South) polarities attract, while like polarities (North and North, South
and South) repel. The internal configuration of a DC motor is designed to harness the
magnetic interaction between a current-carrying conductor and an external magnetic field to
generate rotational motion.
Let's start by looking at a simple 2-pole DC electric motor (here red represents a magnet or
winding with a "North" polarization, while green represents a magnet or winding with a
"South" polarization).
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator, field
magnet(s), and brushes. In most common DC motors the external magnetic field is produced
by high-strength permanent magnets1. The stator is the stationary part of the motor -- this
includes the motor casing, as well as two or more permanent magnet pole pieces. The rotor
(together with the axle and attached commutator) rotates with respect to the stator. The rotor
consists of windings (generally on a core), the windings being electrically connected to the
commutator. The above diagram shows a common motor layout -- with the rotor inside the
stator (field) magnets.
The geometry of the brushes, commutator contacts, and rotor windings are such that when
power is applied, the polarities of the energized winding and the stator magnet(s) are
misaligned, and the rotor will rotate until it is almost aligned with the stator's field magnets.
As the rotor reaches alignment, the brushes move to the next commutator contacts, and
energize the next winding. Given our example two-pole motor, the rotation reverses the
direction of current through the rotor winding, leading to a "flip" of the rotor's magnetic field,
driving it to continue rotating.

Chapter 4

4 MOTOR DRIVER (L293D)

L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as
current amplifiers since they take a low-current control signal and provide a higher-current
signal. This higher current signal is used to drive the motors.
4.1 Pin configuration of L293D
Pin No Function Name
1 Enable pin for Motor 1; active high Enable 1,2
2 Input 1 for Motor 1 Input 1
3 Output 1 for Motor 1 Output 1
4 Ground (0V) Ground
5 Ground (0V) Ground
6 Output 2 for Motor 1 Output 2
7 Input 2 for Motor 1 Input 2
8 Supply voltage for Motors; 9-12V (up to 36V) Vcc 2
9 Enable pin for Motor 2; active high Enable 3,4
10 Input 1 for Motor 1 Input 3
11 Output 1 for Motor 1 Output 3
12 Ground (0V) Ground
13 Ground (0V) Ground
14 Output 2 for Motor 1 Output 4
15 Input2 for Motor 1 Input 4
16 Supply voltage; 5V (up to 36V) Vcc 1

 L293D has 2 Channels .One channel is used for one motor.
 Channel 1 - Pin 1 to 8, Channel 2 - Pin 9 to 16
 Enable Pin is use to enable or to make a channel active .Enable pin is also called as
Chip Inhibit Pin.
 All Input (Pin No. 2, 7,10and 15) of L293D IC is the output from microcontroller
(ATmega8)
 All Output (Pin No. 3, 6,11and 14) of L293D IC goes to the input of Right and Left
motor through RMC (4 pin Connector).

4.2 Specifications

 Featuring Unit rode L293 and L293D
 Products Now From Texas Instruments
 Wide Supply-Voltage Range: 4.5 V to 36 V
 Separate Input-Logic Supply
 Internal ESD Protection
 Thermal Shutdown
 High-Noise-Immunity Inputs
 Functional Replacements for SGS L293 and
 SGS L293D
 Output Current 1 A Per Channel
 (600 mA for L293D)
 Peak Output Current 2 A Per Channel
 (1.2 A for L293D)
 Output Clamp Diodes for Inductive
 Transient Suppression (L293D)

4.3 Electrical Characteristic’s


Supply voltage (Vss) is the Voltage at which we wish to drive the motor. Generally we
prefer 6V for dc motor and 6 to 12V for gear motor, depending upon the rating of the motor.
Logical Supply Voltage will decide what value of input voltage should be considered as
high or low .So if we set Logical Supply Voltage equals to +5V, then -0.3V to 1.5V will be
considered as Input Low Voltage and 2.3 V to 5V will be considered as Input High Voltage.

4.4 Operation of L293D

 

 One channel corresponds to one motor.
 Enable pin should be high for activate the corresponding channel.
 Input 1 corresponds to Output 1.
 If Enable 1=High (1)
Input1 =High (1), Output1=Vss
input1 =Low (0), Output1=0
 If Enable 1=Low (0)
Input1 =High (1), Output1=0
Input1 =Low (0), Output1=0
 Means if Enable pin low, the output will be at 0 always. If its high output depend on
input

 Similarly Input 2 corresponds to Output 2, Input 3 corresponds to Output 3 and Input
4 corresponds to Output 4.

4.5 L293D Interface with microcontroller

L293D contains two inbuilt H-bridge driver circuits. In its common mode of
operation, two DC motors can be driven simultaneously, both in forward and reverse
direction. The motor operations of two motors can be controlled by input logic at pins 2 & 7
and 10 & 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will
rotate it in clockwise and anticlockwise directions, respectively.
Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start
operating. When an enable input is high, the associated driver gets enabled. As a result, the
outputs become active and work in phase with their inputs. Similarly, when the enable input
is low, that driver is disabled, and their outputs are off and in the high-impedance state.

Chapter 5

5 BLUE LINK (Bluetooth module)

5.1 Introduction

Blue LINK is a compact Bluetooth Module (5V Serial TTL).
The module has built-in Voltage regulator and 3V3 to 5V level converter that can be
used to interface with 5V Microcontrollers.
The module has only 7 pins (Standard 2.54mm berg strip) VCC, GND, TX, RX and
RESET, RTS, CTS.
The module is factory configured in Transparent Mode and hence there is no command
required for normal operation.
Blue Link Module:
The Blue LINK is a Drop-in replacement for wired serial connections, transparent usage.
It can be use simply for serial port replacement to establish connection between
MCU and GPS, PC to Robot etc. Any serial stream from 9600 to 115200 bps can be passed
seamlessly from PC/PDA/MOBILE to your target board.

5.2 Features

 Support Master & Slave Mode
 5-Pin Standard Berg strip
 Bluetooth core V 2.0 compliant
 SPP (Serial Port Profile) support
 Support UART interface to host system
 Serial communications @ 9600-115200bps
 No Setup/Initial command required
 Breadboard Compatible
 Onboard Status and Power LED
 Encrypted connection
 Frequency: 2.4~2.524 GHz
 Built-in Chip antenna
 Power Supply: 5V
 Dimension: 55mm x 19mm x 3.2 mm
 Operating Temperature: -40 ~ +70C

5.3 Pin configuration


INTERFACING WITH MICROCONTROLLER:

5.4 Data transfer to microcontroller

The Blue LINK should be connected to the UART of the microcontroller (Baud
Rate9600). Commands received from the mobile phone directly it transfers to the
microcontroller.
Precautions:
 This is a single unit only. Needs USB dongle to connect computer
 Do not attach this device directly to a PC RS232 Port. It needs an RS232 to TTL
converter circuit if you need to attach this to a computer.

5.5 Blue term application

 

Description
 This is an open source application
 VT-100 terminal emulator for communicating with any serial device using a
Bluetooth serial adapter.
 The RFCOMM/SPP protocol emulates serial communications over Bluetooth.
Connecting to Blue Link
 Power on the control card. Pair blue link module with the blue term application.
After connecting with the blue link send the commands to move the robot vehicle.

Chapter 6

6. OBSTACLE DETECTING SENSOR (IR SENSOR)

6.1 Introduction of IR sensor

The basic concept of IR(infrared) obstacle detection is to transmit the IR
signal(radiation) in a direction and a signal is received at the IR receiver when the IR
radiation bounces back from a surface of the object.
The object can be any thing which has certain shape and size, the IR LED transmits the IR
signal on to the object and the signal is reflected back from the surface of the object. The
reflected signals are received by an IR receiver. The IR receiver can be a photodiode /
phototransistor or a ready made module which decodes the signal.

6.2 Features

 1 KHz Modulated IR transmitter LEDs
 Ambient light protected IR receiver
 3 pin easy interface connector
 Indicator LED
 Up to 10cm range for white object
 Can differentiate between dark and light colors
 Active Low on object detection

6.3 Specifications

 Power Supply: 5V DC Power Consumption: 50mA max.
 Detection range 10 cm
 Operation range varies according to color of the object, light color has more range.

 Detection Indicator LED
 Digital output. Active with logic “02
Using the Sensor
 Connect regulated DC power supply of 5 Volts. These wires are also marked on PCB
as +5V and GND.
 To test sensors you only need power the sensor by connect two wires +5V and GND.
You can leave the output wire as it is. When LED is off the output is at 5V.
 Bring any object nearby the Sensor and the LED will light up and output becomes 0V.
 The output is active low and can be given directly to microcontroller for interfacing
applications.

6.4 Operation

Basic Idea is to send infrared light through IR LEDs which is then reflected by any object
in front of sensor. One of the biggest problems that can cause the malfunctioning an IR
proximity sensor, is the ambient light and surrounding sources of IR like the sun and halogen
lamps that can cause false triggering of the sensor due to emission of infrared light. To avoid
getting false detection the solution is to send pulses of IR light at a certain frequency instead
of a constant beam, and build a receiver that would only detect IR pulses of the same exact
frequency, cutting of all pulses of higher or lower frequency. The kind of device capable of
filtering signals this way is called a band pass filter. There are a lot of types of band pass
filters, a whole branch of electricity is dedicated to this subject. The central frequency is fixed
by the constructor usually at 1 kHz IR receiver filters all the source of light except the the
1Khz IR signal. It all starts by
Generating the 1 KHz pulses of electricity that are fed to an IR LED, emitting 1 KHz
pulses of Infra Red light. A weaker signal but with the same frequency is reflected from an
eventual obstacle to the IR receiver, it passes through the IR-PASS filter, which will
eliminate other sources of light which are not IR (visible light). The IR-PASS filter still
detects a lot of noise due to other sources of IR light like the sun for example, so the signals
received by the diode are fed to another stage composed of an active filter to select the 1Khz
IR signals among all others, amplify it and demodulate it, providing a clean logic output (5 or
0 volts).
As show in waveforms, the value on the OUT pin of IR sensor will be:
1. +5V (Logic 1) (Active HIGH), when there is no an obstacle in the detectable range.
2. 0V (Logic 0) (Active LOW), when there is an obstacle in the detectable range.
When the obstacle detected, the LED on the IR sensor board will GLOW that indicates an
obstacle presents within the range. If no obstacle presents within the detectable range it will
not GLOW (just turn OFF).

Chapter 7

7. SOLAR POWER SUPPLY

Solar power is the conversion of sunlight into electricity. Sunlight can be
converted directly into electricity using photovoltaic (PV), or indirectly with concentrated
solar power (CSP) Other technologies also exist, such as Stirling engine dishes which use a
Stirling cycle engine to power a generator. Photovoltaic were initially used to power small
and medium-sized applications, from the calculator powered by a single solar cell to off-grid
homes powered by a photovoltaic array.
A solar cell (also called a photovoltaic cell) is an electrical device that converts
the energy of light directly into electricity by the photovoltaic effect. It is a form of
photoelectric cell (in that it’s electrical characteristics e.g. current, voltage, or resistance vary
when light is incident upon it) which, when exposed to light, can generate and support an
electric current without being attached to any external voltage source.

7.1 How Silicon makes a Solar Cell

Silicon has some special chemical properties, especially in its crystalline form.
An atom of silicon has 14 electrons, arranged in three different shells. The first two shells
which hold two and eight electrons respectively are completely full. The outer shell, however,
is only half full with just four electrons. A silicon atom will always look for ways to fill up its
last shell, and to do this, it will share electrons with four nearby atoms. It's like each atom
holds hands with its neighbors, except that in this case, each atom has four hands joined to
four neighbors. That's what forms the crystalline structure, and that structure turns out to be
important to this type of PV cell.

Solar cell:

The only problem is that pure crystalline silicon is a poor conductor of electricity because
none of its electrons are free to move about, unlike the electrons in more optimum conductors
like copper. To address this issue, the silicon in a solar cell has impurities other atoms
purposefully mixed in with the silicon atoms which changes the way things work a bit. We
usually think of impurities as something undesirable, but in this case, our cell wouldn't work
without them. Consider silicon with an atom of phosphorous here and there, maybe one for
every million silicon atoms. Phosphorous has five electrons in its outer shell, not four. It still
bonds with its silicon neighbor atoms, but in a sense, the phosphorous has one electron that
doesn't have anyone to hold hands with. It doesn't form part of a bond, but there is a positive
proton in the phosphorous nucleus holding it in place.
When energy is added to pure silicon, in the form of heat for example, it can cause
a few electrons to break free of their bonds and leave their atoms. A hole is left behind in
each case. These electrons, called free carriers, then wander randomly around the crystalline
lattice looking for another hole to fall into and carrying an electrical current. However, there
are so few of them in pure silicon, that they aren't very useful.
But our impure silicon with phosphorous atoms mixed in is a different story. It
takes a lot less energy to knock loose one of our "extra" phosphorous electrons because they
aren't tied up in a bond with any neighboring atoms. As a result, most of these electrons do
break free, and we have a lot more free carriers than we would have in pure silicon. The
process of adding impurities on purpose is called doping, and when doped with phosphorous,
the resulting silicon is called N-type ("n" for negative) because of the prevalence of free
electrons. N-type doped silicon is a much better conductor than pure silicon.
The other part of a typical solar cell is doped with the element boron, which has
only three electrons in its outer shell instead of four, to become P-type silicon. Instead of
having free electrons, P-type ("p" for positive) has free openings and carries the opposite
(positive) charge.

7.2 Photovoltaic Cells (Converting Photons to Electrons)

The solar cells that you see on calculators and satellites are also called photovoltaic
(PV) cells, which as the name implies (photo meaning "light" and voltaic meaning
"electricity"), convert sunlight directly into electricity. A module is a group of cells connected
electrically and packaged into a frame (more commonly known as a solar panel).
Photovoltaic cells are made of special materials called semiconductors such as
silicon, which is currently used most commonly. Basically, when light strikes the cell, a
certain portion of it is absorbed within the semiconductor material. This means that the
energy of the absorbed light is transferred to the semiconductor. The energy knocks electrons
loose, allowing them to flow freely.
The solar cell works in three steps:
- Photons in sunlight hit the solar panel and are absorbed by semiconducting materials, such
as silicon.
- Electrons (negatively charged) are knocked loose from their atoms, causing an electricpotential
difference. Current starts flowing through the material to cancel the potential and
this electricity is captured. Due to the special composition of solar cells, the electrons are
only allowed to move in a single direction.
- An array of solar cells converts solar energy into a usable amount of direct current (DC)
electricity.
PV cells also all have one or more electric field that acts to force electrons freed by
light absorption to flow in a certain direction. This flow of electrons is a current, and by
placing metal contacts on the top and bottom of the PV cell, we can draw that current off for
external use, say, to power a calculator. This current, together with the cell's voltage (which is
a result of its built-in electric field or fields), defines the power (or wattage) that the solar cell
can produce.

7.3 Solar Cell Efficiency


Semiconductors with band gap between 1 and 1.5eV, or near-infrared light, have the greatest
potential to form an efficient cell.
Table: Confirmed terrestrial cell and sub module efficiencies measured under the global
AM1.5 spectrum (1000 W/m2) at 25°C (IEC 60904–3: 2008, ASTM G-173-03 global).

7.4 Solar Panel

Efficiency of Mono crystalline silicon: 25%

Technical Specifications

 Open Circuit Voltage (Voc) : 5.4V ±8%
 Short Circuit Current (Isc) : 400ma ±8%
 Max Power Voltage (Vm) : 5.0V ±8%
 Max Power Current (Im) : 360mA ±8%
 Max Power (Pm) : 1.8W ±8%

Chapter 8

8. MECHANICAL PARTS OF ROBOT VEHICLE


Chapter 9

9 ISP (IN SYSTEM PROGRAMMING)

9.0 Introduction

In-System Programming allows programming and reprogramming of any AVR
microcontroller positioned inside the end system. Using a simple Three-wire SPI interface,
the In-System Programmer communicates serially with the AVR microcontroller,
reprogramming all non-volatile memories on the chip. In-System Programming eliminates
the physical removal of chips from the system. This will save time, and money, both during
development in the lab, and when updating the software or parameters in the field. This
application note shows how to design the system to support In-System Programming. It also
shows how a low-cost In-System Programmer can be made, that will allow the target AVR
microcontroller to be programmed from any PC equipped with a regular 9-pin serial port.
Alternatively, the entire In-System Programmer can be built into the system allowing it to
reprogram itself.

9.1 The programming interface

For In-System Programming, the programmer is connected to the target using as few
wires as possible. To program any AVR microcontroller in any target system, a simple Sixwire
interface is used to connect the programmer to the target PCB. Figure below shows the
connections needed. The Serial Peripheral Interface (SPI) consists of three wires: Serial
Clock (SCK), Master In – Slave Out (MISO) and Master Out – Slave In (MOSI). When
programming the AVR, the In-System Programmer always operates as the Master, and the
target system always operate as the Slave. The In-System Programmer (Master) provides the
clock for the communication on the SCK Line. Each pulse on the SCK Line transfers one bit
from the Programmer (Master)to the Target (Slave) on the Master Out – Slave In (MOSI)
line. Simultaneously, each pulse on the SCK Line transfers one bit from the target (Slave) to
the Programmer (Master) on the Master In – Slave out (MISO) line.

Connections Required

All the required connections are shown in below table

9.2 Pin configuration

SCK- When programming the AVR in Serial mode, the In-System Programmer supplies
clock information on the SCK pin. This pin is always driven by the programmer, and the
target system should never attempt to drive this wire when target reset is active. Immediately
after the Reset goes active, this pin will be driven to zero by the programmer. During this first
phase of the programming cycle, keeping the SCK Line free from pulses is critical, as pulses
will cause the target AVR to loose synchronization with the programmer. When in
synchronization, the second byte ($53), will echo back when issuing the third byte of the
programming enable instruction. If the $53 did not echo back, give Reset a positive pulse,
and issue a new Programming Enable command. Note that all four bytes of the of the
Programming Enable command must be sent before starting a new transmission. The target
AVR microcontroller will always set up its SCK pin to be an input with no pull up whenever
Reset is active. See also the description of the Reset wire.
MOSI- When programming the AVR in Serial mode, the In-System Programmer supplies
data to the target on the MOSI pin. This pin is always driven by the programmer, and the
target system should never attempt to drive this wire when target reset is active. The target
AVR microcontroller will always set up its MOSI pin to be an input with no pull up
whenever Reset is active. See also the description of the Reset wire.
MISO- When Reset is applied to the target AVR microcontroller, the MISO pin is set up to
be an input with no pull up. Only after the “Programming Enable” command has been
correctly transmitted to the target will the target AVR microcontroller set its MISO pin to
become an output. During this first time, the In-System programmer will apply its pull up to
keep the MISO line stable until it is driven by the target microcontroller.
VCC- When programming the target microcontroller, the programmer outputs need to stay
within the ranges specified in the DC Characteristics to easily adapt to any target voltage, the
programmer can draw all power required from the target system. This is allowed as the In-
System Programmer will draw very little power from the target system, typically no more
than 20 mA. The programmer shown in this application note operates in this mode. As an
alternative, the target system can have its power supplied from the programmer through the
same connector used for the communication. This would allow the target to be programmed
without applying power to the target externally.
34

Chapter 10

10 SOFTWARE

10.1 AVR Studio compilation process

 Open AVR Studio6, below figure will be displayed on the screen.
 Click on the “New Project”. Then below dialog box will be displayed.
 Select AVR GCC. Then give the Project name, Initial name and give location for
project to be saved.
 Click “OK”. Then below dialog box will be displayed.
 Select AVR simulator, ATmega32 and click on finish. Enter source code in the
compiler

 Build the source code & save the program
 When the built is successful it its intimated the build has gone through with 0
warnings. This display will be in build window.

 Now go to Tools. Then ‘Device Programming’
Then below dialog box will be displayed. Select “AVRISP mk!!”, Then “USB”. Click on
CONNECT.

 Then below dialog box will be displayed. Go to main and select device as ATmega32.
Now select program, then Click on Erase Device. . Now select the file location and
click on the Program. Then program will be loaded into microcontroller

10.2 Source Code



REFERENCES

 www.atmel.com/Images/doc2486.pdf - United States
 http://www.rhydolabz.com/index.php?currency=GBP&main_page=product_info&pro
ducts_id=479
 https://play.google.com/store/apps/details?id=es.pymasde.blueterm&hl=en
 Some content has been taken from http://ieeexplore.ieee.org /Xplore
if u like the post just say thank u in comment box.

No comments:

Post a Comment

its cool