Document
Document
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’
Symbol Name
ACC Accumulator
B B register
SP Stack pointer
P0 Port0
P1 Port1
P2 Port2
P3 Port3
INTRODUCTION
1. EMBEDDED SYSTEM:
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
Avionics, such as inertial guidance systems, flight control hardware/software and other
integrated systems in aircraft and missiles
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
Videogame consoles
ROBOT:
LCD
POWER SUPPLY
Arm7
GPS MODULE
PIR SENSOR
MOTOR DRIVER
GAS SENSOR
IR SENSOR
TEMPERATURE SENSOR
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.
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.
ARM was developed at Acron Computers ltd of Cambridge, England between 1983 and
1985.
ARM cores are licensed to partners so as to develop and fabricate new microcontrollers
around same processor cores.
2.1.1. Key features:
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.
- 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.
Register bank contains, general purpose registers to hold either data or address.
R14 - Link Register, Return address is put to this whenever a subroutine is called.
Depending upon application R13 and R14 can also be used as GPR. But not commonly used.
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.
T- BIT
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.
2.5.1 FEATURES:
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:
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:
Standard modem interface signals included with flow control (auto-CTS/RTS) fully
supported in hardware (LPC2144/6/8 only).
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.
2.8.1 FEATURES:
10 bit successive approximation analog to digital converter (one in LPC2141/2 and two
in LPC2144/6/8).
Power-down mode.
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.
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.
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:
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:
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:
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
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”
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
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”
Type of Rectifier
Number of diodes 1 2 4
Ripple frequency f 2f 2f
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.
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
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).
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.
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:
• No External Component
• Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V
• Offer in plastic TO-252, TO-220 & TO-263
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.
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:
The LCD discussed in this section has 14 pins. The function of each pin is given in table.
RS=1 to select
data register
6 E I/O Enable
2 Return home
4 Decrement cursor
6 Increment cursor
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.
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 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
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.
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
GND: Ground
TX: Transmit data serially which gives information about location, time etc.
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.
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
Units M Meters
Units M Meters
Checksum *7C
Introduction
SIM900A Modem can work with any GSM network operator SIM card just like a
mobile phone with its own unique phone number.
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
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’.
<CR><LF><Response><CR><LF>
Basic AT Command
AT Checking communication OK
Manufacturer Name
AT+GMI Manufacturer Name
E.g. SIMCOM_LTD
Model no.
AT+GMM Model Identification
E.g. SIMCOM_900A
1: inserted
Calling
Command
Description Response
Message
Delete message
AT+CMGD=<index> OK (if present at that index)
at that index
To use HTTP function using SIM900 modem follow below AT commands. Two
methods are there namely,
First we need to connect to GPRS by configure bearer profile using AT command as,
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.
AT+HTTPPARA= “CID”,1
OK
Set parameters for
HTTP session
AT+HTTPPARA=
OK
“URL”,”api.thingspeak.com”
+HTTPACTION:0,200,100
GET successfully AT+SAPBR =0,1
0
+HTTPREAD: 1000
Read the data of HTTP
AT+HTTPREAD Read data….
server
OK
Note: Enter http client URL. e.g. here we have entered “api.thingspeak.com”.
AT+HTTPPARA= “CID”,1 OK
Single Connection
- Can establish only one connection.
Multi Connection
- Can establish 8 connections.
Transparent Mode
Non-Transparent (Normal) Mode
Note, when in multi connection mode SIM900A can work only in Non-transparent
mode.
To select
connection AT+CIPMUX=0 OK
mode
Bring up
wireless AT+CIICR OK
connection
Local IP
Get local IP AT+CIFSR
e.g.“10.81.14.12”
>
SEND OK
Introduction
The ultrasonic sensor works on the principle of SONAR and RADAR system which is
used to determine the distance to an object.
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
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 Pin Description
VCC - +5 V supply
GND – Ground
We know that,
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.
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
Home safety
types
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.
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.
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.
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.
Semiconductor sensor
Electrochemical sensor
Digital sensor
Biomimetic sensor (chem-optical or gel cell sensor)
Introduction
Pin Description
Out: It gives analog output voltage which is proportional to the temperature (in
degree Celsius).
GND: Ground
Application Setup
IR Communication:
Introduction
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
The only limitations of this basic communication are short distance and interference
from IR energy of the surroundings.
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.
IR Receiver
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
5kgcm torque
125gm weight
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
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.
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 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 1 – GND
Pin 2 – Output
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:
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.
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.
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.
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.
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.
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.
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
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:
3.21.2.Signed char:
o As a result, we have only 7 bits for the magnitude of the signed number, giving us values
from -128 to +127.
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:
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.
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.
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.
If dumping process of the hex file is completed, then the controller will work as per our
requirement
CONCLUSION