0% found this document useful (0 votes)
57 views

Document

Uploaded by

dileeppatra
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Document

Uploaded by

dileeppatra
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 107

Wireless Multi-function Robot for

Military Application

CONTENTS

1. Abbreviations
2. Introduction
3. Block Diagram
4. Block Diagram Description
5. Schematic
6. Schematic Description
7. Hardware Components
8. Circuit Description
9. Software components
a. About Keil
b. Embedded ‘C’

10. Source Code


11. Conclusion (or) Synopsis
12. Bibliography
ABBREVIATIONS

Symbol Name

ACC Accumulator

B B register

PSW Program status word

SP Stack pointer

DPTR Data pointer 2 bytes

DPL Low byte

DPH High byte

P0 Port0

P1 Port1

P2 Port2

P3 Port3

IP Interrupt priority control

IE Interrupt enable control

TMOD Timer/counter mode control

TCON Timer/counter control

T2CON Timer/counter 2 control

T2MOD Timer/counter mode2 control

TH0 Timer/counter 0high byte

TL0 Timer/counter 0 low byte

TH1 Timer/counter 1 high byte

TL1 Timer/counter 1 low byte

TH2 Timer/counter 2 high byte

TL2 Timer/counter 2 low byte

SCON Serial control

SBUF Serial data buffer

PCON Power control


CHAPTER 1

INTRODUCTION

1. EMBEDDED SYSTEM:

An embedded system is a special-purpose system in which the computer is completely


encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose
computer, such as a personal computer, an embedded system performs one or a few predefined
tasks, usually with very specific requirements. Since the system is dedicated to specific tasks,
design engineers can optimize it, reducing the size and cost of the product. Embedded systems
are often mass-produced, benefiting from economies of scale.

Personal digital assistants (PDAs) or handheld computers are generally considered embedded
devices because of the nature of their hardware design, even though they are more expandable in
software terms. This line of definition continues to blur as devices expand. With the introduction
of the OQO Model 2 with the Windows XP operating system and ports such as a USB port —
both features usually belong to "general purpose computers", — the line of nomenclature blurs
even more.

Physically, embedded systems ranges 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.

In terms of complexity embedded systems can range from very simple with a single
microcontroller chip, to very complex with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.
FFigure No: 1.1 Special-Purpose System

1.2 Examples of Embedded Systems:

 Avionics, such as inertial guidance systems, flight control hardware/software and other
integrated systems in aircraft and missiles

 Cellular telephones and telephone switches

 Engine controllers and antilock brake controllers for automobiles

 Home automation products, such as thermostats, air conditioners, sprinklers, and security
monitoring systems

 Handheld calculators

 Handheld computers

 Household appliances, including microwave ovens, washing machines, television sets, DVD
players and recorders

 Medical equipment

 Personal digital assistant

 Videogame consoles

 Computer peripherals such as routers and printers.

 Industrial controllers for remote machine operation.


BLOCK DIAGRAM

ROBOT:

LCD
POWER SUPPLY

Arm7
GPS MODULE

PIR SENSOR

MOTOR DRIVER

GAS SENSOR

PROXIMITY SENSOR GSM/GPRS

BUZZER ULTRASONIC SENSOR

IR SENSOR
TEMPERATURE SENSOR

CELLPHONE AS VIDEO CAMERA

BLOCK DIAGRAM DESCRIPTION

Power Supply: This section is meant for supplying Power to all the sections mentioned above.It
basically consists of a Transformer to step down the 230V ac to 9V ac followed by diodes. Here
diodes are used to rectify the ac to dc. After rectification the obtained rippled dc is filtered using
a capacitor Filter. A positive voltage regulator is used to regulate the obtained dc voltage.
Microcontroller: This section forms the control unit of the whole project. This section basically
consists of a Microcontroller with its associated circuitry like Crystal with capacitors, Reset
circuitry, Pull up resistors (if needed) and so on. The Microcontroller forms the heart of the
project because it controls the devices being interfaced and communicates with the devices
according to the program being written.
LCD Display: This section is basically meant to show up the status of the project. This project
makes use of Liquid Crystal Display to display / prompt for necessary information.
Buzzer Section: This section consists of a Buzzer. The buzzer is used to alert / indicate the
completion of process. It is sometimes used to indicate the start of the embedded system by
alerting during start-up.

Driver circuit: 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.

DC Motor: DC motor is an output for this project. And DC motor is connected to


microcontroller. And this motor controlled by the microcontroller with the respective inputs
given by us. Its speed will be varied according to the speed set by the switches.

PIR sensor:

The PIR Sensor module allows you to sense motion. It is almost always used to detect the motion
of a human body within the sensor's range. It is often referred to used "PIR", "Pyroelectric",
"Passive Infrared" and "IR Motion" sensor. The module has an on-board pyroelectric sensor,
conditioning circuitry and a dome shaped Fresnel lens. The PIR sensor module provides an
output "HIGH" when a human body is detected within its range and an automatic Delay "LOW"
when the body leaves its range. The delay time is adjustable using the potentiometer on-board.
The minimum delay time that can be set is 5 seconds and maximum of 200 seconds.

Proximity Sensor:
A proximity sensor is a sensor able to detect the presence of nearby objects without any physical
contact. A proximity sensor often emits an electromagnetic field or a beam of electromagnetic
radiation, and looks for changes in the field or return signal

CHAPTER 2

ARM PROCESSOR

2.ARM PROCESSOR:

ARM stands for Advanced RISC Machines. It is a 32 bit processor core, used for high end
application.It is widely used in Advanced Robotic Applications.

Figure No: 2.1 ARM PROCESSOR

2.1. History and Development:

 ARM was developed at Acron Computers ltd of Cambridge, England between 1983 and
1985.

 RISC concept was introduced in 1980 at Stanford and Berkley.

 ARM ltd was found in 1990.

 ARM cores are licensed to partners so as to develop and fabricate new microcontrollers
around same processor cores.
2.1.1. Key features:

1. 16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.


2. 8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory. 128-bit
wide interface/accelerator enables high-speed 60 MHz operation.
3. In-System Programming/In-Application Programming (ISP/IAP) via on-chip boot loader
software. Single flash sector or full chip erase in 400 ms and programming of 256 bytes in 1
ms.
4. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-
chip Real Monitor software and high-speed tracing of instruction execution.
5. USB 2.0 Full-speed compliant device controller with 2 kB of endpoint RAM. In addition, the
LPC2146/48 provides 8 kB of on-chip RAM accessible to USB by DMA.
6. One or two (LPC2141/42 vs. LPC2144/46/48) 10-bit ADCs provide a total of 6/14 analog
inputs, with conversion times as low as 2.44 μs per channel.
7. Single 10-bit DAC provides variable analog output (LPC2142/44/46/48 only).
8. Two 32-bit timers/external event counters (with four capture and four compare channels
each), PWM unit (six outputs) and watchdog.
9. Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input.
10. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI
and SSP with buffering and variable data length capabilities.
11. Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses.
12. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
13. Up to 21 external interrupt pins available.
14. 60 MHz maximum CPU clock available from programmable on-chip PLL with settling time
of 100 μs.
15. On-chip integrated oscillator operates with an external crystal from 1 MHz to 25 MHz.
16. Power saving modes include idle and Power-down.
17. Individual enable/disable of peripheral functions as well as peripheral clock scaling for
additional power optimization.
18. Processor wake-up from Power-down mode via external interrupt or BOD.
19. Single power supply chip with POR and BOD circuits:
20. CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V tolerant I/O pads.
2.2 PIN DIAGRAM

Figure No : 2.2 PIN DIAGRAM


2.3 BLOCK DIAGRAM
Figure No: 2.3 BLOCK DIAGRAM

2.4. PIN DESCRIPTION:


2.4.1 CORE DATA PATH:

 Architecture is characterized by Data path and control path.

 Data path is organized in such a way that, operands are not fetched directly from memory
locations. Data items are placed in register files. No data processing takes place in memory
locations.

 Instructions typically use 3 registers. 2 source registers and 1 destination register.

 Barrel Shifter preprocesses data, before it enters ALU.

- Barrel Shifter is basically a combinational logic circuit, which can shift data to left or right by
arbitrary number of position in same cycle.

 Increment or Decrement logic can update register content for sequential access.

2.4.2 PIPELINE:

 In ARM 7, a 3 stage pipeline is used. A 3 stage pipeline is the simplest form of pipeline
that does not suffer from the problems such as read before write.

 In a pipeline, when one instruction is executed, second instruction is decoded and third
instruction will be fetched.

 This is executed in a single cycle.

2.4.3 REGISTER BANK:

 ARM 7 uses load and store Architecture.

 Data has to be moved from memory location to a central set of registers.

 Data processing is done and is stored back into memory.

 Register bank contains, general purpose registers to hold either data or address.

 It is a bank of 16 user registers R0-R15 and 2 status registers.

 Each of these registers is 32 bit wide.


2.4.4 DATA REGISTERS- R0-R15:

 R0-R12 - General Purpose Registers

 R13-R15 - Special function registers of which,

R13 - Stack Pointer, refers to entry pointer of Stack.

R14 - Link Register, Return address is put to this whenever a subroutine is called.

R15 - Program Counter

Depending upon application R13 and R14 can also be used as GPR. But not commonly used.

Figure No: 2.4 Regester Bank


In addition there are 2 status registers

 CPSR - Current program status register, status of current execution is stored.

 SPSR - Saved program Status register, includes status of program as well as processor.

2.4.5 CPSR:

CPSR contains a number of flags which report and control the operation of ARM7 CPU.

Figure No: 2.5 CPSR

CONDITIONAL CODE FLAGS

N - Negative Result from ALU

Z - Zero result from ALU

C - ALU operation carried out

V - ALU operation overflowed

INTERRUPT ENABLE BITS

I - IRQ, Interrupt Disable

F - FIQ, Disable Fast Interrupt

T- BIT

If T=0, Processor in ARM Mode.


T=1, Processor in THUMB Mode

2.4.6 MODE BITS

Specifies the processor Modes. Processor Modes will be discussed in the next part of this
tutorial. 

ARM features:

 Barrel Shifter in data path that maximize the usage of hardware available on the chip.

 Auto increment and Auto decrement addressing modes to optimize program loop. This
feature is not common in RISC architecture.

 Load and Store instruction to maximize data throughput.

 Conditional execution of instructions, to maximize execution throughput.

 2.5 VECTORED INTERRUPT CONTROLLER (VIC):

2.5.1 FEATURES:

 ARM Prime Cell™ Vectored Interrupt Controller

 32 interrupt request inputs

 16 vectored IRQ interrupts

 16 priority levels dynamically assigned to interrupt requests

 Software interrupt generation

2.5.2 DESCRIPTION:

The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs andProgrammable
assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The programmable
assignment scheme means that priorities of interrupts from the various peripherals can be
dynamically assigned and adjusted. Fast Interrupt request (FIQ) requests have the highest
priority. If more than one request is assigned to FIQ, the VIC ORs the requests to produce the
FIQ signal to the ARM Processor. The fastest possible FIQ latency is achieved when only one
request is classified as FIQ, because then the FIQ service routine can simply start dealing with
that Device. But if more than one request is assigned to the FIQ class, the FIQ service routine
can read a word from the VIC that identifies which FIQ source(s) is (are) requesting an Interrupt.
Vectored IRQs have the middle priority, but only 16 of the 32 requests can be assigned to this
category. Any of the 32 requests can be assigned to any of the 16 vectored IRQ slots, among
which slot 0 has the highest priority and slot 15 has the lowest. Non-vectored IRQs have the
lowest priority. The VIC ORs the requests from all the vectored and non-vectored IRQs to
produce the IRQ signal to the ARM processor. The IRQ service routine can start by reading a
register From the VIC and jumping there. If any of the vectored IRQs are requesting, the
VICProvides the address of the highest-priority requesting IRQs service routine, otherwise
itprovides the address of a default routine that is shared by all the non-vectored IRQs.
TheDefault routine can read another VIC register to see what IRQs are active.All registers in the
VIC are word registers. Byte and half word reads and write are notsupported.
2.5.3 REGISTER DESCRIPTION:
2.6. UNIVERSAL ASYNCHRONOUS RECEIVER/TRANSMITTER 0:
2.6.1FEATURES:

 16 byte Receive and Transmit FIFOs

 Register locations conform to ‘550 industry standard

 Receiver FIFO trigger points at 1, 4, 8, and 14 bytes

 Built-in fractional baud rate generator with autobauding capabilities.

 Mechanism that enables software and hardware flow control implementation

2.6.2 PIN DESCRIPTION:

Table No: 2.1 PIN DESCRIPTION

2.6.3 REGISTER DESCRIPTION:

Table No: 2.2 REGISTER DESCRIPTION

2.6.4 ARCHITECTURE:
The VPB interface provides a communications link between the CPU or host and the
UART0.The UART0 receiver block, U0RX, monitors the serial input line, RXD0, for valid
input. TheUART0 RX Shift Register (U0RSR) accepts valid characters via RXD0. After a valid
character is assembled in the U0RSR, it is passed to the UART0 RX Buffer Register FIFO to
await access by the CPU or host via the generic host interface.The UART0 transmitter block,
U0TX, accepts data written by the CPU or host and buffers the data in the UART0 TX Holding
Register FIFO (U0THR). The UART0 TX Shift Register (U0TSR) reads the data stored in the
U0THR and assembles the data to transmit via the serial output pin, TXD0. The UART0 Baud
Rate Generator block, U0BRG, generates the timing enables used by the UART0 TX block. The
U0BRG clock input source is the VPB clock (PCLK). The main clock is divided down per the
divisor specified in the U0DLL and U0DLM registers. This divided down clock is a 16x
oversample clock, NBAUDOUT. The interrupt interface contains registers U0IER and U0IIR.
The interrupt interface receives several one clock wide enables from the U0TX and U0RX
blocksStatus information from the U0TX and U0RX is stored in the U0LSR. Control information
for the U0TX and U0RX is stored in the U0LCR.
Figure No: 2.6 UART0 Block diagram
2.7 UNIVERSAL ASYNCHRONOUS RECEIVER/TRANSMITTER 1:

2.7.1 FEATURES:

 UART1 is identical to UART0, with the addition of a modem interface.

 16 byte Receive and Transmit FIFOs

 Register locations conform to ‘550 industry standard

 Receiver FIFO trigger points at 1, 4, 8, and 14 bytes

 Built-in fractional baud rate generator with autobauding capabilities.

 Mechanism that enables software and hardware flow control implementation

 Standard modem interface signals included with flow control (auto-CTS/RTS) fully
supported in hardware (LPC2144/6/8 only).

2.7.2 PIN DESCRIPTION:


2.7.3 REGISTER DESCRIPTION:

2.7.4 ARCHITECTURE:

The VPB interface provides a communications link between the CPU or host and the UART1.
The UART1 receiver block, U1RX, monitors the serial input line, RXD1, for valid input. The
UART1 RX Shift Register (U1RSR) accepts valid characters via RXD1. After a valid character
is assembled in the U1RSR, it is passed to the UART1 RX Buffer Register FIFO to await access
by the CPU or host via the generic host interface. The UART1 transmitter block, U1TX, accepts
data written by the CPU or host and buffers the data in the UART1 TX Holding Register FIFO
(U1THR). The UART1 TX Shift Register (U1TSR) reads the data stored in the U1THR and
assembles the data to transmit via the serial output pin, TXD1. The UART1 Baud Rate Generator
block, U1BRG, generates the timing enables used by the UART1 TX block. The U1BRG clock
input source is the VPB clock (PCLK). The main clock is divided down per the divisor specified
in the U1DLL and U1DLM registers. This divided down clock is a 16x oversample clock,
NBAUDOUT The modem interface contains registers U1MCR and U1MSR. This interface is
responsible for handshaking between a modem peripheral and the UART1. The interrupt
interface contains registers U1IER and U1IIR. The interrupt interface receives several one clock
wide enables from the U1TX and U1RX blocks. Status information from the U1TX and U1RX is
stored in the U1LSR. Control information for the U1TX and U1RX is stored in the U1LCR.

Figure No: 2.7 UART1 block diagram


2.8 ANALOG-TO-DIGITAL CONVERTER (ADC):

2.8.1 FEATURES:

 10 bit successive approximation analog to digital converter (one in LPC2141/2 and two
in LPC2144/6/8).

 Input multiplexing among 6 or 8 pins (ADC0 and ADC1).

 Power-down mode.

 Burst conversion mode for single or multiple inputs.

 Optional conversion on transition on input pin or Timer Match signal.

 Global Start command for both converters (LPC2144/6/8 only).

2.8.2 DESCRIPTION:

Basic clocking for the A/D converters is provided by the VPB clock. A programmable divider is
included in each converter, to scale this clock to the 4.5 MHz (max) clock needed by the
successive approximation process. A fully accurate conversion requires 11 of these clocks.

2.8.3 PIN DESCRIPTION:


2.8.4 REGISTER DESCRIPTION:
2.8.5 OPERATION:

HARDWARE-TRIGGERED CONVERSION:

If the BURST bit in the ADCR is 0 and the START field contains 010-111, the ADC will start a
conversion when a transition occurs on a selected pin or Timer Match signal. The choices
include conversion on a specified edge of any of 4 Match signals, or conversion on a specified
edge of either of 2 Capture/Match pins. The pin state from the selected pad or the selected Match
signal, XORed with ADCR bit 27, is used in the edge detection logic

INTERRUPTS:

An interrupt request is asserted to the Vectored Interrupt Controller (VIC) when the DONE bit is
1. Software can use the Interrupt Enable bit for the A/D Converter in the VIC to control whether
this assertion results in an interrupt. DONE is negated when the ADDR is read.

ACCURACY VS. DIGITAL RECEIVER:

The AIN function must be selected in corresponding Pin Select register (see "Pin Connect
Block" on page 75) in order to get accurate voltage readings on the monitored pin. For pin
hosting an ADC input, it is not possible to have a have a digital function selected and yet get valid
ADC readings. An inside circuit disconnects ADC hardware from the associated pin whenever a
digital function is selected on that pin.
2.9 REAL TIME CLOCK

2.9.1 FEATURES:

 Measures the passage of time to maintain a calendar and clock.


 Ultra Low Power design to support battery powered systems
 Provides Seconds, Minutes, Hours, Day of Month, Month, Year, Day of Week, and Day
of Year
 Dedicated 32 kHz oscillator or programmable prescaler from VPB clock.
 Dedicated power supply pin can be connected to a battery or to the main 3.3 V

2.9.2 DESCRIPTION:

On the LPC2141/2/4/6/8, the RTC can be clocked by a separate 32.768 KHz oscillator, or by a
programmable presale divider based on the VPB clock. Also, the RTC is powered by it’s, which
can be connected to a battery or to the same 3.3 V supply used by the rest of the device.

2.9.3 ARCHITECTURE:

Figure No: 2.8 RTC block diagram


2.9.4 REGISTER DESCRIPTION:

The RTC includes a number of registers. The address space is split into four sections by
functionality. The first eight addresses are the Miscellaneous Register Group. The second sets of
eight locations are the Time Counter Group. The third set of eight locations contains the Alarm
Register Group. The remaining registers control the Reference Clock Divider. The Real Time
Clock includes the register shown. Detailed descriptions of the registers follow.
2.10 RTC INTERRUPTS:

Interrupt generation is controlled through the Interrupt Location Register (ILR),


CounterIncrement Interrupt Register (CIIR), the alarm registers, and the Alarm Mask
Register(AMR). Interrupts are generated only by the transition into the interrupt state. The
ILRseparately enables CIIR and AMR interrupts. Each bit in CIIR corresponds to one of thetime
counters. If CIIR is enabled for a particular counter, then every time the counter is Incremented an
interrupt is generated. The alarm registers allow the user to specify a date and time for an
interrupt to be generated. The AMR provides a mechanism to mask alarm Compares. If all
nonmasked alarm registers match the value in their corresponding time counter, then an interrupt
is generated. The RTC interrupt can bring the microcontroller out of power-down mode if the
RTC is operating from its own oscillator on the RTCX1-2 pins. When the RTC interrupt is
enabled for wakeup and its selected event occurs, XTAL1/2 pins associated oscillator wakeup
cycle is started

2.11 MISCELLANEOUS REGISTER GROUP:

2.12 INTERRUPT LOCATION REGISTER (ILR - 0XE002 4000):

The Interrupt Location Register is a 2-bit register that specifies which blocks are generating an
interrupt. Writing a one to the appropriate bit clears.
2.13 CLOCK TICK COUNTER REGISTER (CTCR - 0XE002 4004):

The Clock Tick Counter is read only. It can be reset to zero through the Clock Control. Register
(CCR). The CTC consists of the bits of the clock divider counter compensation for target
vibration and minor surface irregularities that might otherwise cause false signals.
CHAPTER 3

HARDWARE EXPLAINATION

3.1 POWER SUPPLY:

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

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

Fig
ure: 3.14 components of a typical linear power supply
3.19.1 TRANSFORMER:

A transformer is an electrical device which is used to convert electrical power from one electrical
circuit to another without change in frequency.

Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase in output voltage, step-down transformers decrease in output
voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains
voltage to a safer low voltage. The input coil is called the primary and the output coil is called
the secondary. There is no electrical connection between the two coils; instead they are linked by
an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the
middle of the circuit symbol represent the core. Transformers waste very little power so the
power out is (almost) equal to the power in. Note that as voltage is stepped down current is
stepped up. The ratio of the number of turns on each coil, called the turn’s ratio, determines the
ratio of the voltages. A step-down transformer has a large number of turns on its primary (input)
coil which is connected to the high voltage mains supply, and a small number of turns on its
secondary (output) coil to give a low output voltage.

Figure.3.15.Transformer

An Electrical Transformer

Turns ratio = Vp/ VS = Np/NS

Power Out= Power In

VS X IS=VP X IP
Vp= primary (input) voltage
Np = number of turns on primary coil
Ip  = primary (input) current    

3.19.2.RECTIFIER:

A circuit which is used to convert a.c to dc is known as RECTIFIER. The process of conversion
a.c to d.c is called “rectification”

3.19.3 .TYPES OF RECTIFIERS:

 Half wave Rectifier

 Full wave rectifier

1. Centre tap full wave rectifier.

2. Bridge type full bridge rectifier.

3.19.4.Comparison of rectifier circuits:

Type of Rectifier

Parameter Half wave Full wave Bridge

Number of diodes 1 2 4

PIV of diodes Vm 2Vm Vm

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

Vdc, at 0.318Vm 0.636Vm 0.636Vm


no-load

Ripple factor 1.21 0.482 0.482

Ripple frequency f 2f 2f

Rectification efficiency 0.406 0.812 0.812

Transformer Utilization 0.287 0.693 0.812


Factor(TUF)

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

Table No: 3.8 Comparison of rectifier circuits

3.19.5 Full-wave Rectifier:

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

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

Figure No: 3.16(a) Bridge Rectifier

3.19.7. Operation:

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

Figure No: 3.16(b) Bridge Rectifier positive half cycle of secondary voltage
During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward biased
while D2 and D3 are in reverse biased as shown in the fig(c). The current flow direction is
shown in the fig (c) with dotted arrows.

Figure No: 3.16(c) Bridge Rectifier negative half cycle of secondary voltage

3.19.8.Filter:

A Filter is a device which removes the a.c component of rectifier output but allows the d.c
component to reach the load

3.19.9 Capacitor Filter:

We have seen that the ripple content in the rectified output of half wave rectifier is 121% or that
of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is not
acceptable for most of the applications. Ripples can be removed by one of the following methods
of filtering.

(a) A capacitor, in parallel to the load, provides an easier by –pass for the ripples voltage though
it due to low impedance. At ripple frequency and leave the d.c.to appears the load.

(b) An inductor, in series with the load, prevents the passage of the ripple current (due to high
impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c)

(c) Various combinations of capacitor and inductor, such as L-section filter section filter,
multiple section filter etc. which make use of both the properties mentioned in (a) and (b) above.
Two cases of capacitor filter, one applied on half wave rectifier and another with full wave
rectifier.

Filtering is performed by a large value electrolytic capacitor connected across the DC supply to
act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier
is falling. The capacitor charges quickly near the peak of the varying DC, and then discharges as
it supplies current to the output. Filtering significantly increases the average DC voltage to
almost the peak value (1.4 × RMS value).

To calculate the value of capacitor(C),

C = ¼*√3*f*r*Rl

Where,

f = supply frequency,

r = ripple factor,

Rl = load resistance

Note: In our circuit we are using 1000µF. Hence large value of capacitor is placed to reduce
ripples and to improve the DC component.

3.19.10 Regulator:

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

Figure No: 3.17 A Three Terminal Voltage Regulator

78XX:

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

3.19.11 Features:

• Output Current of 1.5A

• Output Voltage Tolerance of 5%

• Internal thermal overload protection

• Internal Short-Circuit Limited

• No External Component

• Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V
• Offer in plastic TO-252, TO-220 & TO-263

• Direct Replacement for LM78XX

3.2 LIQUID CRYSTAL DISPLAY

Liquid crystal displays (LCDs) have materials, which combine the properties of both liquids and
crystals. Rather than having a melting point, they have a temperature range within which the
molecules are almost as mobile as they would be in a liquid, but are grouped together in an
ordered form similar to a crystal.

An LCD consists of two glass panels, with the liquid crystal material sand witched in between
them. The inner surface of the glass plates are coated with transparent electrodes which define
the character, symbols or patterns to be displayed polymeric layers are present in between the
electrodes and the liquid crystal, which makes the liquid crystal molecules to maintain a defined
orientation angle. One each polarisers are pasted outside the two glass panels. These polarisers
would rotate the light rays passing through them to a definite angle, in a particular direction.

When the LCD is in the off state, light rays are rotated by the two polarisers and the liquid
crystal, such that the light rays come out of the LCD without any orientation, and hence the LCD
appears transparent. When sufficient voltage is applied to the electrodes, the liquid crystal
molecules would be aligned in a specific direction. The light rays passing through the LCD
would be rotated by the polarisers, which would result in activating/ highlighting the desired
characters.

The LCD’s are lightweight with only a few millimeters thickness. Since the LCD’s consume less
power, they are compatible with low power electronic circuits, and can be powered for long
durations. The LCD does don’t generate light and so light is needed to read the display. By using
backlighting, reading is possible in the dark. The LCD’s have long life and a wide operating
temperature range.
Changing the display size or the layout size is relatively simple which makes the LCD’s more
customers friendly. The LCDs used exclusively in watches, calculators and measuring
instruments are the simple seven-segment displays, having a limited amount of numeric data.

The recent advances in technology have resulted in better legibility, more information displaying
capability and a wider temperature range. These have resulted in the LCDs being extensively
used in telecommunications and entertainment electronics. The LCDs have even started
replacing the cathode ray tubes (CRTs) used for the display of text and graphics, and also in
small TV applications.

This section describes the operation modes of LCD’s then describe how to program and interface
an LCD to 8051 using Assembly and C.

3.1.1. LCD OPERATION:

In recent years the LCD is finding widespread use replacing LEDs (seven-segment LEDs or
other multisegment LEDs).This is due to the following reasons:

1. The declining prices of LCDs.


2. The ability to display numbers, characters and graphics. This is in contract to LEDs,
which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, there by relieving the CPU of the
task of refreshing the LCD. In the contrast, the LED must be refreshed by the CPU to
keep displaying the data.
4. Ease of programming for characters and graphics.

3.1.2. LCD PIN DESCRIPTION

The LCD discussed in this section has 14 pins. The function of each pin is given in table.

TABLE 1: PIN DESCRIPTION FOR LCD:

Pi symbol I/O Description


n
1 Vss -- Ground

2 Vcc -- +5V power supply

3 VEE -- Power supply to control contrast

4 RS I RS=0 to select command register

RS=1 to select

data register

5 R/W I R/W=0 for write

R/W=1 for read

6 E I/O Enable

7 DB0 I/O The 8-bit data bus

8 DB1 I/O The 8-bit data bus

9 DB2 I/O The 8-bit data bus

10 DB3 I/O The 8-bit data bus

11 DB4 I/O The 8-bit data bus

12 DB5 I/O The 8-bit data bus

13 DB6 I/O The 8-bit data bus

14 DB7 I/O The 8-bit data bus

Table No: 3.1 Pin description for LCD


Cod Command to LCD Instruction
e
Register
(hex
)

1 Clear display screen

2 Return home

4 Decrement cursor

6 Increment cursor

5 Shift display right

7 Shift display left

8 Display off, cursor off

A Display off, cursor on

C Display on, cursor off

E Display on, cursor on

F Display on, cursor blinking

10 Shift cursor position to left

14 Shift cursor position to right

18 Shift the entire display to the left

1C Shift the entire display to the right


80 Force cursor to beginning of 1st line

C0 Force cursor to beginning of 2nd line

38 2 lines and 5x7 matrix

Table No: 3.2 LCD command codes

3.1.3 USES:

The LCDs used exclusively in watches, calculators and measuring instruments are the simple
seven-segment displays, having a limited amount of numeric data. The recent advances in
technology have resulted in better legibility, more information displaying capability and a wider
temperature range. These have resulted in the LCDs being extensively used in
telecommunications and entertainment electronics. The LCDs have even started replacing the
cathode ray tubes (CRTs) used for the display of text and graphics, and also in small TV
applications.

3.2 LCD INTERFACING:

SENDING COMMANDS AND DATA TO LCDS WITH A TIME DELAY:


Figure No: 3.1 Interfacing of LCD to a micro controller

To send any command from table 2 to the LCD, make pin RS=0. For data, make RS=1.Then
sends a high –to-low pulse to the E pin to enable the internal latch of the LCD.
GPS Receiver Module:

Introduction

GPS receivers are generally used in smartphones, fleet management system,


military etc. for tracking or finding location.

Global Positioning System (GPS) is a satellite-based system that uses satellites and


ground stations to measure and compute its position on Earth.

GPS is also known as Navigation System with Time and Ranging (NAVSTAR) GPS.

GPS receiver needs to receive data from at least 4 satellites for accuracy purpose.
GPS receiver does not transmit any information to the satellites.

This GPS receiver is used in many applications like smartphones, Cabs, Fleet
management etc.
How GPS Works

GIF Source: Wikipedia

GPS receiver uses a constellation of satellites and ground stations to calculate


accurate location wherever it is located.

These GPS satellites transmit information signal over radio frequency (1.1 to 1.5
GHz) to the receiver. With the help of this received information, a ground station or
GPS module can compute its position and time.

How GPS Receiver Calculates its Position and Time

GPS receiver receives information signals from GPS satellites and calculates its
distance from satellites. This is done by measuring the time required for the signal
to travel from satellite to the receiver.
GPS Distance Calculation

Where,

Speed = Speed of Radio signal which is approximately equal to the speed of light i.e.

Time = Time required for a signal to travel from the satellite to the receiver.

By subtracting the sent time from the received time, we can determine the travel
time.
GPS Signal Time Difference

To determine distance, both the satellite and GPS receiver generate the same
pseudocode signal at the same time.

The satellite transmits the pseudocode; which is received by the GPS receiver.

These two signals are compared and the difference between the signals is the
travel time.

Now, if the receiver knows the distance from 3 or more satellites and their location
(which is sent by the satellites), then it can calculate its location by
using Trilateration method.

GPS Module

GPS Receiver
GPS receiver module gives output in standard (National Marine Electronics
Association) NMEA string format. It provides output serially on Tx pin with default
9600 Baud rate.

This NMEA string output from GPS receiver contains different parameters
separated by commas like longitude, latitude, altitude, time etc. Each string starts
with ‘$’ and ends with carriage return/line feed sequence.

E.g.

$GPGGA,184237.000,1829.9639,N,07347.6174,E,1,05,2.1,607.1,M,-64.7,M,,0000*7D

$GPGSA,A,3,15,25,18,26,12,,,,,,,,5.3,2.1,4.8*36

$GPGSV,3,1,11,15,47,133,46,25,44,226,45,18,37,238,45,26,34,087,40*72

$GPGSV,3,2,11,12,27,184,45,24,02,164,26,29,58,349,,05,26,034,*7F

$GPGSV,3,3,11,21,25,303,,02,11,071,,22,01,228,*40

$GPRMC,184237.000,A,1829.9639,N,07347.6174,E,0.05,180.19,230514,,,A*64
 

Pin Description
GPS Receiver Module

VCC: Power Supply 3.3 – 6 V

GND: Ground

TX: Transmit data serially which gives information about location, time etc.

RX: Receive Data serially. It is required when we want to configure GPS module.


 

Check GPS module

Before Interfacing GPS module with PIC18F4550 microcontroller, we can check the
output of GPS module. From that string, we can extract information like longitude,
latitude, time which is helpful to find location and timing information.

To do this, connect this GPS module to the PC via USB to Serial converter or DB9
connector. Also, it is necessary to keep antenna of GPS module on proper location.
GPS Serial Interface

1. Now open any serial terminal e.g. Realterm, Hyper terminal, Putty etc. on
PC/laptop.

2. Open the PORT with 9600 baud rate.

3. The terminal will show data coming from GPS receiver module.

The output data from GPS receiver module displaying on a serial terminal as
follows.

In the above string, the NMEA string starting with “$GPGGA” is most popularly used.
It provides us Time, Longitude, Latitude and Altitude along with directions. This
information is helpful to find Time and Location.

E.g.

$GPGGA,184241.000,1829.9639,N,07347.6174,E,1,05,2.1,607.1,M,-
64.7,M,,0000*7C

Name Example Units Description


Message ID $GPGGA   GGA Protocol Header

UTC Time 184241.000   hhmmss.sss

Latitude 1829.9639   ddmm.mmmm

N/S Indicator N   N=North, S=South

Longitude 07347.6174   dddmm.mmmm

E/W Indicator E   E=East, W=West

Position Fix Indicator 1   Fix GPS SPS mode

Satellites Used 05   Range 0 to 12

HDOP 2.1   Horizontal Dilution of Precision

MSL Altitude 607.1 Meters Mean Sea Level

Units M Meters  

Geoid Separation 64.7 Meters  

Units M Meters  

Age of Diff. Corr. -   Null field if DGPS is not used

Diff. Ref Station ID 0000    

Checksum *7C    

Carriage return Line Feed <CR><LF>   End of message transmission

SIM900A GSM/GPRS Module:

Introduction

SIM900A Modem can work with any GSM network operator SIM card just like a
mobile phone with its own unique phone number.

SIM900A GSM/GPRS modem is plug and play modem with RS232 serial


communication supported. Hence Advantage of using this modem will be that its
RS232 port can be used to communicate and develop embedded applications.
Applications like SMS Control, data transfer, remote control and logging can be
developed. SIM900 modem supports features like voice call, SMS, Data/Fax, GPRS
etc.

SIM900A modem uses AT commands to work with supported features.

Note that to be connected to a cellular network, the modem requires a SIM card
provided by a network provider.

Power Requirement

This board requires external power supply of ~12V and can draw up to ~2A of
current at its peak.

Indicators

It has two LED indicators as,

ON: It shows that the Modem is getting powered and is switched on.

NET: This network LED blinks when the modem is communicating with the radio
network.

Network LED
When modem is powered up, network LED blink every second and after network
registration it will start to blink after every 3 seconds. This shows that the modem is
registered with the network.

To test modem, connect board serially to PC and send “ATE0” or “AT” through serial
terminal. If “OK” response is received from the modem, then it means all is well.

AT Command Reference

There are many AT commands for SIM900A modem, kindly go through ‘SIM900 AT
Command Manual’.

Interfacing GSM with PC/Laptop

 Before interfacing SIM900A GSM module with PIC18F4550 microcontroller, we can


check GSM module output for various AT commands on PC/Laptop.
 To do this, connect GSM module to the PC/laptop via USB to Serial converter as
shown below.

Sim900A Serial Interface

 Insert SIM Card


 Connect power supply to the SIM900A GSM module. 
 Now, there is one Network LED on GSM module which blinks continuously every
second on power up. When the SIMregisters in network then this LED blinks after
every 3 sec. It takes 10-60 second to register in network.
 Now send AT commands and check the response.
 Every time we have to write command and send it by Enter key<CR>. You will always
see the response in form of

<CR><LF><Response><CR><LF>

            In following table, only responses are present, <CR><LF> are removed


intentionally.

Basic AT Command

There some basic AT commands which are used as follows,

Command Description Response

AT Checking communication OK

ATE0 or ATE1 Turn off /ON echo OK

e.g.: SIM900 R11.0


ATI Product Identification
OK

AT+GSN Product serial number identification IMEI no.


(IMEI)

Manufacturer Name
AT+GMI Manufacturer Name
E.g. SIMCOM_LTD

Model no.
AT+GMM Model Identification
E.g. SIMCOM_900A

+CSMINS: <n>, <SIM


inserted>
AT+CSMINS? SIM Inserted Status Reporting
0: not inserted

1: inserted

Service Provider Name


AT+CSPN? Get Service Provider Name from SIM
E.g. +CSPN: “!dea”, 1

Calling

To use calling service following AT commands are used.

Command
Description Response
 

ATD<Mob. OK (if successful), BUSY (if busy), NO


Dial / call a number
No.>; CARRIER (if  no connection)

ATA Answer a call OK

ATH Hang up call OK

Redial Last Telephone OK (if successful), BUSY (if busy),NO CARRIER


ATDL
Number Used (if  no connection)

Message

To use SMS service following AT commands are used.

Command Description Response


AT+CMGF=<index> Select message OK

index- 0: PDU       1: Text format  

> ”Type message here” press ‘ctrl+z’ to


AT+CMGS=”9881xxxxxx end msg or ‘ESC’ to exit without sending
Send message

OK

+CMGR: “Message Header”


Read message at
AT+CMGR=<index> Message Body
that index
OK

Delete message
AT+CMGD=<index> OK (if present at that index)
at that index

AT+CMGDA=”DEL ALL” Delete all SMS OK

HTTP (Hypertext Transfer Protocol)

To use HTTP function using SIM900 modem follow below AT commands. Two
methods are there namely,

GET: to get data from server.

POST: to post data to server.

First we need to connect to GPRS by configure bearer profile using AT command as,

Demonstration             Syntax             ExpectedResponse

AT+SAPBR=3,1,"Contype","GPRS
OK
"
Configure bearer
 
profile 1  
OK
AT+SAPBR=3,1,"APN","internet"

To open a GPRS
AT+SAPBR =1,1         OK
context.
+SAPBR:
  AT+SAPBR=2,1 1,1,"10.89.193.1"

OK

To close a GPRS
AT+SAPBR =0,1         OK
context. 

Note: Enter Access Point Name (APN) of corresponding network service provider.
E.g. here we have entered “internet” which is APN of IDEA network.

Now let’s see AT commands for GET method,

HTTP GET method

Demonstration             Syntax             ExpectedResponse

Initiate http service AT+HTTPINIT OK

AT+HTTPPARA= “CID”,1
OK
Set parameters for  
 
HTTP session
AT+HTTPPARA=
OK
“URL”,”api.thingspeak.com”

GET session start AT+HTTPACTION=0 OK

+HTTPACTION:0,200,100
GET successfully AT+SAPBR =0,1        
0

+HTTPREAD: 1000
Read the data of HTTP
AT+HTTPREAD Read data….
server
OK

Terminate http service AT+HTTPTERM OK

Note: Enter http client URL. e.g. here we have entered “api.thingspeak.com”.

Now let’s see AT commands for POST method,


HTTP POST method

Demonstration             Syntax             Expected Response

Initiate http service AT+HTTPINIT OK

AT+HTTPPARA= “CID”,1 OK

Set parameters for HTTP session AT+HTTPPARA= “URL”,”  


www.google.com” OK

POST the data whose size is DOWNLOAD


100Bytes and the maximum Enter data of exact size
latency time for inputting is mentioned in syntax
10000ms. It is recommended to AT+HTTPDATA=100,10000
set the latency time long enough OK
to download all the Data in the All data has been
latency time. received

POST session start AT+HTTPACTION=1 OK

POST successfully   +HTTPACTION:1,200,0

Terminate http service AT+HTTPTERM OK

TCP (Transmission Control Protocol)

TCP is communication protocol of internet. There are two modes of connection


used for SIM900A TCP/IP application,

 Single Connection
-  Can establish only one connection.
 Multi Connection
-  Can establish 8 connections.

There are two TCP/IP application modes,

 Transparent Mode
 Non-Transparent (Normal) Mode

Note, when in multi connection mode SIM900A can work only in Non-transparent
mode.

Let’s see TCP Client connection AT commands

Demonstration Syntax Expected Response

To select
connection AT+CIPMUX=0 OK
mode

Sets apn, For single connection


username and OK
password AT+CSTT=”APN",”USERNAME”,”PASSWORD”

Bring up
wireless AT+CIICR OK
connection

Local IP
Get local IP AT+CIFSR
e.g.“10.81.14.12”

for single connection,


Start-up TCP
AT+CIPSTART=”TCP”,”api.thingspeak.com”,”8 CONNECT OK
connection
0”

…Enter data and


Send data AT+CIPSEND substitute CTRL+Z
(0x1A) ….

SEND OK

Close the For quick close,


CLOSE OK
connection AT+CIPCLOSE=1

Deactivate GPRS AT+CIPSHUT SHUT OK


ULTRASONIC OBSTACLE SENSOR:

Introduction

The ultrasonic sensor works on the principle of SONAR and RADAR system which is
used to determine the distance to an object.

An ultrasonic sensor generates the high-frequency sound (ultrasound) waves.


When this ultrasound hits the object, it reflects as echo which is sensed by the
receiver as shown in below figure.

Ultrasonic Working Principle

By measuring the time required for the echo to reach to the receiver, we can
calculate the distance. This is the basic working principle of Ultrasonic module to
measure distance.
HC-SR-04 Ultrasonic Module

Ultrasonic Module

HC-SR-04 has an ultrasonic transmitter, receiver and control circuit.

In ultrasonic module HCSR04, we have to give trigger pulse, so that it will generate
ultrasound of frequency 40 kHz. After generating ultrasound i.e. 8 pulses of 40 kHz,
it makes echo pin high. Echo pin remains high until it does not get the echo sound
back. So the width of echo pin will be the time for sound to travel to the object and
return back. Once we get the time we can calculate distance, as we know the speed
of sound.

HC-SR04 can measure up to range from 2 cm - 400 cm.

 
HC-SR04 Pin Description

VCC - +5 V supply

TRIG – Trigger input of sensor. Microcontroller applies 10 us trigger pulse to the


HC-SR04 ultrasonic module.

ECHO–Echo output of sensor. Microcontroller reads/monitors this pin to detect the


obstacle or to find the distance.

GND – Ground

HC-SR04 Working Principle

HC-SR04 Ultrasonic Module Timing Diagram


1. We need to transmit trigger pulse of at least 10 us to the HC-SR04 Trig Pin.
2. Then the HC-SR04 automatically sends Eight 40 kHz sound wave and wait for rising
edge output at Echo pin.
3. When the rising edge capture occurs at Echo pin, start the Timer and wait for falling
edge on Echo pin.
4. As soon as the falling edge is captured at the Echo pin, read the count of the Timer.
This time count is the time required by the sensor to detect an object and return
back from an object.

Now how to calculate distance?

We know that,

The speed of sound waves is 343 m/s.

GAS SENSOR:
 A sensor is a technological device that detects / senses a signal, physical condition and
chemical compounds.

 It is also defined as any device that converts a signal from one form to another.

Sensors are mostly electrical or electronic.

 Gas sensor is a subclass of chemical sensors.

 Gas sensor measures the concentration of gas in its vicinity. Gas sensor interacts with a
gas to measure its concentration. Each gas has a unique breakdown voltage i.e. the
electric field at which it is ionized. Sensor identifies gases by measuring these voltages.
The concentration of the gas can be determined by measuring the current discharge in the
device.

applications
 Process control industries

 Environmental monitoring

 Boiler control

 Fire detection

 Alcohol breath tests

 Detection of harmful gases in mines

 Home safety

 Grading of agro-products like coffee and spices

Gas sensing technologies:

 Metal Oxide Based Gas Sensors

 Capacitance Based Gas Sensors

 Acoustic Wave Based Gas Sensors

 Calorimetric Gas Sensors

 Optical gas sensors

 Electrochemical gas sensors

types

1. Metal Oxide Based Gas Sensors

 Metal oxide sensors are also known as chemiresistors.

 The detection principle of resistive sensors is based on change of the resistance of a thin
film upon adsorption of the gas molecules on the surface of a semiconductor.

 The gas-solid interactions affect the resistance of the film because of the density of
electronic species in the film.

Capacitance Based Gas Sensors


 They measure the change in dielectric constant of films between the electrodes as a
function of the gas concentration.

 The capacitive sensor relies on inter-digitated electrode structures, which correspond to


the two plates of a standard capacitor, to monitor changes of the dielectric coefficient of
the film.

 The simple theory behind it is if the dielectric constant of the film is lower than that of
the analyte, the capacitance will increase and vice versa.

Acoustic Wave Based Gas Sensors

 Sound based gas sensors are known as acoustic wave based gas sensors.

 To launch the acoustic waves, this type of sensor use piezoelectric material either in the
thin film form or in bulk form which has one or more transducers on its surface.

Carbon monoxide gas sensor

 It can either be battery-operated or AC powered.

 Mostly the sensor will not sound an alarm at lower concentrations (e.g. 100 ppm). The
alarm will sound within a few minutes at 400 ppm. So the function is specific to
concentration-time. Figure shows simple carbon monoxide sensor.

Carbon monoxide gas sensor (Contd.)

Carbon monoxide sensor can be of different types such as:

 Semiconductor sensor

 Electrochemical sensor

 Digital sensor
 Biomimetic sensor (chem-optical or gel cell sensor)

LM35 Temperature Sensor:

Introduction

LM35 Temperature Sensor

 LM35 is a temperature measuring device having an analog output voltage


proportional to the temperature.
 It provides output voltage in Centigrade (Celsius). It does not require any external
calibration circuitry.
 The sensitivity of LM35 is 10 mV/degree Celsius. As temperature increases, output
voltage also increases.

            E.g. 250 mV means 25°C.

 It is a 3-terminal sensor used to measure surrounding temperature ranging from


-55 °C to 150 °C.
 LM35 gives temperature output which is more precise than thermistor output.

 
Pin Description

VCC: Supply Voltage (4V – 30V)

Out: It gives analog output voltage which is proportional to the temperature (in
degree Celsius).

GND: Ground

Application Setup
IR Communication:

Introduction

IR LED and IR Photodiode

 IR light is like visible light but it is invisible to our eyes, because of which they are
suitable in application of wireless communication.
 The band for IR (Infrared) in electromagnetic spectrum is 300GHz to 430 THz and
wavelength range of around 700nm to 1mm.
 Along with the IR LED some other sources like sun, light bulbs, human and animal
bodies etc. also emit infrared energy.
 IR communication is used for short and medium distance applications.

Principle of Working

 IR LEDs transmit digital (logical 1 and 0) data in the form of infrared light.
 Logical 1 is emitted by keeping IR LED ON and logical 0 by keeping it OFF.
 This ON and OFF sequence of data is collected by IR photodiode at receiver end.

 
Types of IR communication 

IR Communication Types

1) Point to point communication : In point to point communication, line of sight is


required between transmitter and receiver devices.

2) Diffuse communication : In diffuse communication, no need to keep


transmitter and receiver in straight line of sight. It can be done by reflecting or
bouncing the transmitted signal from surfaces like wall, ceilings etc.

Simple IR Communication using IR Photodiode Receiver

 In simple IR communication, whatever data (1 or 0) present at transmitter end will


be transmitted as it is without any modulation technique.
 Receiver collects the transmitted data (1 or 0) as it is without any demodulation or
filter technique.
Basic IR Communication

 The only limitations of this basic communication are short distance and interference
from IR energy of the surroundings.

IR Communication using Modulation

In modulation type of IR communication, IR light is modulated with carrier


frequencies to get better distance available.

Also, it provides better immunity to surrounding IR interferences. Generally, TSOP


series receivers are used to receive modulated IR light.

IR Transmitter
 For IR transmission, IR LED of wavelength 940 nm to 950 nm are commonly used.
 When we transmit the data to the IR receiver, at the same time the IR receiver also
receives IR rays from the surroundings. These IR rays from the surroundings can
distort the transmitted data.
 To avoid such surrounding interferences, IR signal can be modulated with carrier
frequencies. The commonly used carrier frequencies are 30kHz, 36kHz, 38kHz,
56kHz etc.
 In the IR communication, NEC code, Toshiba Micom Format, Sharp Code, RC5 Code,
RC6 Code, R–2000 Code, Sony Format (SIRCS) etc. protocols are used.
 Also, simple RS232 serial communication protocol can be used for IR
communication. This protocol uses one start bit, 8-bit data, one parity bit (optional)
and one stop bit format. Now, IR data is modulated to IR signal at 38kHz as shown in
figure below.

Fig: Serial data modulating at 38kHz

IR Receiver

 At receiver end, IR receiver receives data at 38kHz of carrier frequency.


 For IR filter, epoxy package is designed.
 This module is designed in such a way that any unexpected output pulses due to
noise or disturbance signal are avoided.
 Generally, TSOP series Receiver are used which support reception of various
transmitted code.
 E.g. In TSOP1738, continuous data rate is possible up to 2400 bps.
 This demodulated output signal is received by microcontroller.
 The demodulated output data of TSOP is shown in figure below.
Fig: Output data of TSOP1738

3.14 DC GEARED MOTOR:

High efficiency, high quality low cost DC motor with gearbox for robotics applications. Very
easy to use and available in standard size.Nut and threads on shaft to easily connect and internal
threaded shaft for easily connecting it to wheel.

3.14.1 Features

 45 RPM 12V DC motors with Gearbox

 5kgcm torque

 3000RPM base motor

 6mm shaft diameter with internal hole

 125gm weight

 Same size motor available in various rpm


 No-load current = 60 mA(Max), Load current = 300 mA(Max)

Figure: 3.11 Dc geared motor

3.15 L293D Motor Driver IC:

Since two motors are used to drive The back wheels of the robot independently, there is a need
for Two H-bridges. Instead of implementing the above H-bridge control Circuit twice, an
alternative is to use an integrated circuit (IC), which provides more than one

H-bridges. One such IC is L293D, which has 2 H-Bridges in it. It can supply 600Ma continuous
and 1.2A peak Currents. It is suitable for switching applications up to 5 kHz. These Features
make it ideal for our application. Another option is to use IC L298, which can drive 2A
continually and 3A peak currents. The Diagram of L293D is shown in Figure 2It can be observed
from the figure that L293D has a similar configuration to the circuit in

Figure 1
Figure:3.12 L293D Motor Driver IC

3.15.1.Motor Driver Connections: The motor driver requires 2 control inputs for each motor.
Since we drive 2 motors, we need 4 controls

Figure: 3.13 Motor Driver Connections

Inputs from the microcontroller. Since it has many pins which can be configured as outputs,
there are many options for implementation. For example, in our robot the last 4 bits of Port B
(RB4, RB5, RB6, and RB7 - Pins 37 to 40) are used to control the rotation direction of the
motors. The enable pins of the motor driver are connected to the PWM outputs of the
microcontroller (Pins 16and 17). This is because, as was mentioned above, by changing the
width of the pulse (implying changing the enable time of the driver) one can change the speed of
the motor. The truth table for motor driver is as shown in Table II, where H = high, L = low, and
Z =high output impedance state.

Since the motors are reverse aligned, in order to have the robot Move forward they must be
configured such that one of them turns forward and the other one turns backward. In case of any
requirement for the robot to move backward, it is sufficient to just reverse the connections.

1.4 Buzzer
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household
appliances such as a microwave ovens, & game shows.

The word "buzzer" comes from the rasping noise that buzzers made when they were electromechanical
devices, operated from stepped-down AC line voltage at 50 or 60 cycles. Other sounds commonly used to
indicate that a button has been pressed are a ring or a beep.

The "Piezoelectric sound components" introduced herein operate on an innovative principle utilizing
natural oscillation of piezoelectric ceramics. These buzzers are offered in lightweight compact sizes from
the smallest diameter of 12mm to large Piezo electric sounders. Today, piezoelectric sound components
are used in many ways such as home appliances, OA equipment, audio equipment telephones, etc. And
they are applied widely, for example, in alarms, speakers, telephone ringers, receivers, transmitters, beep
sounds, etc.

Fig: Buzzers

PIR Sensor
PIR Sensor

All living objects, whose body temperature is more than 0oC, emit the heat in form of infrared radiation
through their body, also called as thermal radiations. This Radiated energy is invisible to human eye.
These Signals can be detected by using PIR sensor which is specially designed for such purpose.

Grid eye illusion


In Passive Infrared (PIR) Sensor, passive word indicates PIR Sensor does not generate or radiate any
energy for detection purposes.

PIR Sensors don't detect or measure "HEAT"; they detect the infrared radiation emitted or reflected from
objects.

They are small, inexpensive, low power and easy to use. They are commonly found at home, medical,
factories etc. areas.
PIR Sensor Working

PIR Sensor Blocks

PIR Element

 PIRs are basically made of a pyroelectric sensor, which can detect levels of infrared radiation.
 Above figure of PIR element shows the round metal can with a rectangular crystal in the centre.
 Every object emits some low-level radiation, and the hotter objects emits more radiations.
 The sensor is split in two slots, which are wired up so that they cancel each other out.
 If one half sees more or less IR radiation than the other, the output will swing high or low.
 Input signals from both terminals of PIR element are amplified using amplifier circuit and
compared using comparator circuit.
 The PIR element is covered by lens to increase range of operation.

At Idle Position 

 PIR motion sensor uses element RE200B for infrared detection. Both slots of this sensor are
connected to differential amplifier.
 When the sensor is idle, both slots detect same amount of IR.
 So, there is no error signal between differential inputs. The output of comparator circuit is zero.

Object in Motion

 When any warm object passes in front of the sensor, it intercepts one slot of the PIR sensor. This
causes a positive differential change between the two slots. This change is indicated by Part A in
below figure.
 When the warm body leaves the sensing area, the sensor generates negative differential change.
This change is indicated by Part B in below figure.
Differential changes between two slots

 Both these changes in pulse are the detection of warm body which radiate infrared signals.

Pin Description

Pin Diagram of PIR Sensor

Pin 1 – GND

We have to connect this pin to Ground.

Pin 2 – Output

This pin gives output (3.5V) when the motion is detected.

Pin 3 – VCC

This pin provides supply voltage(+5v) to PIR element and internal circuit.
Modes of Operations
This sensor has two modes of operations:

1. Single Trigger Mode

Single trigger mode timing diagram

 To select Single Trigger mode, the jumper setting on PIR sensor must be set on LOW.
 In case of Single Triggered Mode, Output goes HIGH when motion is detected.
 After specific delay (tsel) the output goes to LOW even if the object is in motion.
 The output is LOW for some time and again goes HIGH if object remains in motion.
 This delay (tsel) is provided by user using the potentiometer. This potentiometer is on board of
PIR sensor module.
 In this way, the PIR sensor gives HIGH/LOW pulses if object is in continuous motion.

2. Repeat Trigger Mode

Repeat trigger mode timing diagram


 To select Repeat Trigger mode, the jumper setting on PIR sensor must be set on HIGH.
 In case of Repeat Triggered Mode, Output goes HIGH when motion is detected.
 The output of PIR sensor is HIGH until the object is in motion.
 When object stops motion, or disappears from the sensor area, the PIR continues its HIGH state
up to some specified delay (tsel).
 We can provide this delay (tsel) by adjusting the potentiometer. This potentiometer is on board of
PIR sensor module.
 In this way, the PIR sensor gives HIGH pulse if object is in continuous motion.

 Clockwise Movement makes PIR more Sensitive.

Lenses

PIR Detector with Fresnel Lenses

 Two things are important while manufacturing PIR sensor: Low cost and High Sensitivity.
 Both these things can be magically achieved by using Lens cap.
 The lenses increase range of operation; increases sensitivity and change pattern of Sensing vary
easily.

PROXIMITY SENSOR:
A proximity sensor is a sensor able to detect the presence of nearby objects without any physical
contact. A proximity sensor often emits an electromagnetic field or a beam of electromagnetic
radiation, and looks for changes in the field or return signal.

A proximity sensor is a sensor able to detect the presence of nearby objects without any physical
contact.

A proximity sensor often emits an electromagnetic field or a beam of electromagnetic


radiation (infrared, for instance), and looks for changes in the field or return signal. The object
being sensed is often referred to as the proximity sensor's target. Different proximity sensor
targets demand different sensors. For example, a capacitive proximity sensor or photoelectric
sensor might be suitable for a plastic target; an inductive proximity sensor always requires a
metal target.[citation needed]

Proximity sensors can have a high reliability and long functional life because of the absence of
mechanical parts and lack of physical contact between the sensor and the sensed object.

Proximity sensors are also used in machine vibration monitoring to measure the variation in
distance between a shaft and its support bearing. This is common in large
steam turbines, compressors, and motors that use sleeve-type bearings.

International Electro technical Commission (IEC) 60947-5-2 defines the technical details of


proximity sensors.

A proximity sensor adjusted to a very short range is often used as a touch switch.

Proximity sensors
IP Web Camera

An Internet Protocol camera, or IP camera, is a type of digital video camera that receives
control data and sends image data via the Internet. They are commonly used for surveillance but
unlike analog closed-circuit television (CCTV) cameras, they require no local recording device,
only a local area network. Most IP cameras are webcams, but the term IP
camera or netcam usually applies only to those that can be directly accessed over a network
connection, usually used for surveillance.

Some IP cameras require support of a central network video recorder (NVR) to handle the


recording, video and alarm management. Others are able to operate in a decentralized manner
with no NVR needed, as the camera is able to record directly to any local or remote storage
media. 
3.20. SOFTWARE DESCRIPTION:

Software’s used is:

 KEIL µVision using Embedded C programming


 Express PCB for lay out design
 Express SCH for schematic design

3.20.1.Express PCB

Express PCB is a Circuit Design Software and PCB manufacturing service. One can learn almost
everything you need to know about Express PCB from the help topics included with the
programs given.

Details: Express PCB, Version 5.6.0

3.20.2.Express SCH:

The Express SCH schematic design program is very easy to use. This software enables the user
to draw the Schematics with drag and drop options.

A Quick Start Guide is provided by which the user can learn how to use it.

Details: Express SCH, Version 5.6.0

3.21.EMBEDDED C:

The programming Language used here in this project is an Embedded C Language. This
Embedded C Language is different from the generic C language in few things like

a) Data types

b) Access over the architecture addresses.

The Embedded C Programming Language forms the user friendly language with access over Port
addresses, SFR Register addresses etc.
3.21.1.Embedded C Data types:

Data Types Size in Bits Data Range/Usage

unsigned char 8-bit 0-255

signed char 8-bit -128 to +127

unsigned int 16-bit 0 to 65535

signed int 16-bit -32,768 to +32,767

Table No: 3.9 Embedded C Data types

3.21.2.Signed char:

o Used to represent the – or + values.

o As a result, we have only 7 bits for the magnitude of the signed number, giving us values
from -128 to +127.

3.22.KEIL µVision using Embedded C programming

3.22.1 ABOUT KEIL SOFTWARE:

It is possible to create the source files in a text editor such as Notepad, run the Compiler on each
C source file, specifying a list of controls, run the Assembler on each Assembler source file,
specifying another list of controls, run either the Library Manager or Linker (again specifying a
list of controls) and finally running the Object-HEX Converter to convert the Linker output file
to an Intel Hex File. Once that has been completed the Hex File can be downloaded to the target
hardware and debugged. Alternatively KEIL can be used to create source files; automatically
compile, link and covert using options set with an easy to use user interface and finally simulate
or perform debugging on the hardware with access to C variables and memory. Unless you have
to use the tolls on the command line, the choice is clear. KEIL Greatly simplifies the process of
creating and testing an embedded application.

3.22.2.Projects:

The user of KEIL centers on “projects”. A project is a list of all the source files required to build
a single application, all the tool options which specify exactly how to build the application, and –
if required – how the application should be simulated. A project contains enough information to
take a set of source files and generate exactly the binary code required for the application.
Because of the high degree of flexibility required from the tools, there are many options that can
be set to configure the tools to operate in a specific manner. It would be tedious to have to set
these options up every time the application is being built; therefore they are stored in a project
file. Loading the project file into KEIL informs KEIL which source files are required, where they
are, and how to configure the tools in the correct way. KEIL can then execute each tool with the
correct options. It is also possible to create new projects in KEIL. Source files are added to the
project and the tool options are set as required. The project can then be saved to preserve the
settings. The project is reloaded and the simulator or debugger started, all the desired windows
are opened. KEIL project files have the extension

3.22.3.Simulator/Debugger:

The simulator/ debugger in KEIL can perform a very detailed simulation of a micro controller
along with external signals. It is possible to view the precise execution time of a single assembly
instruction, or a single line of C code, all the way up to the entire application, simply by entering
the crystal frequency. A window can be opened for each peripheral on the device, showing the
state of the peripheral. This enables quick trouble shooting of misconfigured peripherals.
Breakpoints may be set on either assembly instructions or lines of C code, and execution may be
stepped through one instruction or C line at a time. The contents of all the memory areas may be
viewed along with ability to find specific variables. In addition the registers may be viewed
allowing a detailed view of what the microcontroller is doing at any point in time.
3.24.ARM SOFTWARE:

3.24.1About Keil ARM:

1. Click on the Keil u Vision3 Icon on Desktop

2. The following fig will appear

3. Click on the Project menu from the title bar


4. Then Click on New Project
5. Save the Project by typing suitable project name with no extension in u r own folder sited
in either C:\ or D:\

6. Then Click on save button above.


7. Select the component for u r project. i.e.NXP……
8. Click on the + Symbol beside of NXP

9. Select LPC2148 as shown below

10. Then Click on “OK”


11. The Following fig will appear
12. Then Click YES
13. Now your project is ready to USE
14. Now double click on the Target1, you would get another option “Source group 1” as
shown in next page.
15. Click on the file option from menu bar and select “new”

16. The next screen will be as shown in next page, and just maximize it by double clicking on
its blue boarder.
17. Now start writing program in either in “C” or “ASM”
18. For a program written in Assembly, then save it with extension “. asm” and for “C”
based program save it with extension “ .C”

19. Now right click on Source group 1 and click on “Add files to Group Source”
20. Now you will get another window, on which by default “C” files will appear

21. Now select as per your file extension given while saving the file
22. Click only one time on option “ADD”

23. Now Press function key F7 to compile. Any error will appear if so happen.

24. If the file contains no error, then press Control+F5 simultaneously.

25. The new window is as follows


26. Then Click “OK”

27. Now Click on the Peripherals from menu bar, and check your required port as shown in
fig below
28. Drag the port a side and click in the program file

29. Now keep Pressing function key “F11” slowly and observe.

30. You are running your program successfully


Flash magic

Flash Magic is a PC tool for programming flash based microcontrollers from NXP using a serial
or Ethernet protocol while in the target hardware. The figures below show how the baud rate is
selected for the microcontroller, how are the registers erased before the device is programmed.

Figure 4.4 Dumping of the code into Microcontroller


Figure 4.5 Dump process finished

If dumping process of the hex file is completed, then the controller will work as per our
requirement
CONCLUSION

The project “Human Detection in Disaster Zones Using Manually Controlled


Robots” has been successfully designed and tested.
Integrating features of all the hardware components used have developed 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 and with the help of growing technology the
project has been successfully implemented.
REFERENCES
Books
[1]. ARM7TDMI datasheet ARM
[2]. LPC2119/2129/2194/2292/2294 User Manual Philips
[3]. ARM System on chip architecture Steve Furber
[4]. Architecture Reference Manual David Seal
[5]. ARM System developers guide Andrew N. Sloss,
Domonic Symes,
[6]. Chris Wright
[7]. Micro C/OS-II Jean J. Labrosse
GCC The complete reference Arthur Griffith
Websites
[1]. http://www.arm.com
[2]. http://www.philips.com
[3]. http://www.lpc2000.com
[4]. http://www.semiconductors.philips.com/
[5]. http://ieeexplore.ieee.org
[6]. http://ww.hitex.co.uk
[7]. http://www.keil.co.uk
[8]. http://www.ucos-ii.com
[9]. http://www.ristancase.com
[10]. http://gcc.gnu.org/onlinedocs/gcc/Evaluation Boards And Modules
[11]. http://www.knox.com

You might also like