SlideShare a Scribd company logo
1 of 65
Download to read offline
Monitoring robot using GPRS and Bluetooth
Department of ECE 1 H.K.B.K.C.E
CHAPTER 1
INTRODUCTION
The robot manipulator has been an essential tool for the development of the automated
industry. In the near future these robots will be accompanied by intelligent mobile robots that
will assist us in many different areas, including transportation, cleaning, mining photography or
agriculture. Such intelligent robots incorporate increased flexibility and need the ability to plan
their actions and to execute them in a safe way. In order to operate in a changing and partially
unpredictable environment, these robots also need the ability to detect when the execution does
not proceed as planned, and to correctly identify the causes of the failure. An execution
monitoring system is a system that allows the robot to detect and classify these failures.
1.1Proposed System:
Server-Side:
The server PC is designed to monitor the place by viewing the video being streamed from
the mobile. The server has the privilege to move the robot remotely i.e. left, right, front and back
to have the person in focus. The PIR could also be controlled by turning it on/off.
Client-Side:
At the client end, the Android C++ is responsible for the communication between the
robot and the mobile through Bluetooth. There is an option for controlling the PIR sensor i.e. to
turn on/off. The PIR sensor senses for any motion in the affected area and when the motion is
detected, the PC is intimated by the mobile through socket communication as well as starts
capturing the images.
The mobile streams the video to the server such that the robot can be moved in all the
directions i.e. front, back, left and right to monitor the place as well as to focus to view the status
of the alive person.
Monitoring robot using GPRS and Bluetooth
Department of ECE 2 H.K.B.K.C.E
1.2 Project requirements:
1.2.1 Hardware Requirements
 Smart phone with Android OS and Bluetooth enabled
 ULN 2003A
 Bluetooth
 DC Motor
 PIC Micro controller
 Relays
 PIR Sensor
1.2.2 Software Requirements
 JDK 1.6 or above
 Android Operating System(GPRS enabled)
 Android emulator
 Android Bluetooth
 Wireless Tool Kit 2.5.2
 Embedded C
 MPLAB
1.2.3 PC Requirements
 PIII Processor
 40GB HDD
 256MB RAM
Monitoring robot using GPRS and Bluetooth
Department of ECE 3 H.K.B.K.C.E
1.3 Block Diagram:
Socket Communication(GPRS)
1.3.1 Detailed Block diagram
Figure 1.1 block diagram of proposed project
BT Enabled android
OS cell
PC
BT
Communication
PIRSensor
Blue tooth
Module
PIC
Controller
Cell
Phone
modem
Driver unit
for MotorRobot
Wheels
PIR
Sensor
PC
Monitoring robot using GPRS and Bluetooth
Department of ECE 4 H.K.B.K.C.E
CHAPTER 2
OVERVIEW ON ROBOTICS
2.1 Introduction
The Robot Institute of America defines a robot as a programmable, multifunctional
manipulator designed to move material, parts, tools, or specialized devices, through variable
programmed motions, for the performance of a variety of tasks.It can also be defined as an
electro-mechanical contraption that is designed for performing a certain task or a certain set of
tasks repeatedly without fail. The chief feature of robots that distinguishes them from purely
mechanical or purely electronic devices is in the property of self-locomotion, limited
intelligence, and in the element of automation built into them.
Robotics means the study and application of robot technology.The Merriam Webster
Dictionary, 1998, defines Robotics as ―technology dealing with the design, construction, and
operation of robots‖. It is a fast emerging technology which is a merging point of many diverse
fields of Science such as Electronics, Electrical, Computers, Mechanicals,and Material Science
etc and has been hugely responsible for domestic and industrial automation revolution. Because
of rapid change in the industries requirements of performance and speed, with the progression
towards the 21st
century, the current state automation is being fast replaced by Robotization.
Monitoring robot using GPRS and Bluetooth
Department of ECE 5 H.K.B.K.C.E
2.2 Types of Robots
There are different types of robot that are widely used nowadays for variety of
applications. Some of them are:
1. Mobile Robots
A mobile robot is a machine which can move as a whole in a controlled way with
some degree of autonomy. A mobile robot‘s possible motions can be analyzed in terms of
degree of freedom: it may fly or float in three-dimensional medium or it may be confined
to a follow a surface or it may be confined to a track or pipe. Most mobile robots so far,
like land vehicles in general, have used wheels since this is the simplest method of
locomotion.
2. Pick and place manipulator
Pick and place manipulator or limited sequence manipulators, use mechanical
stops to set two stopping positions on each axis. The joint must travel backwards and
forwards between these two end stops, whose positions can be adjusted when the
machine is set up. They are fast and relatively cheap. They are limited to transfer of parts
from one place to another.
3. Point to point robots
Point to point robots have servo positions control of each axis and can go through
a sequence of specified points. The path between these points is unspecified. There can
be any number of stopping positions in each axis. The program for such a robot consists
of a series of points; for each point all the joint angles must be specified. It is really just a
pick and place machine with arbitrarily large number of programmable positions.
4. Continuous path robots
Continuous path robots do not go through a finite list of target points but can,
ideally, execute a smooth path of any shape, with continuous variation of speed as the
arm moves along the path. This requires not only servo control of the velocity of each
joint but that several joints move at once in a coordinated way, whereas for a point to
point robot it is possible ,although not compulsory, to move one joint at a time.
Monitoring robot using GPRS and Bluetooth
Department of ECE 6 H.K.B.K.C.E
2.3 Overview of Mobile Robots
As a result a brief overview on the concepts of mobile robot is mentioned here which
includes arrangement of wheels, navigation for land vehicles, route planning and control and
coordination.
Figure 2.1 Mobile Robot
 ARRANGEMENTS OF WHEELS AND TRACKS
There are three fundamental ways of steering a wheeled or tracked vehicle by ground
reaction and they need two wheels.
- In the least restricted way all the wheels or tracks can be turned together or differentially,
resulting in translational or rotational motion or a combination. Such a vehicle can rotate about
its own center. Three wheels are often are used.
- The second way, used by caterpillar tractors and some AGV‘s, is differential steering of a
pair of fixed wheels or tracks. Again it allows rotation on the spot but the vehicle cannot move
sideways.
- The third way it to pivot on wheel or group of wheels while others remain fixed. This
method is used by cars and bicycles. This arrangement is rarely found in robots as turned around
in a confined space or passing through a narrow gap tends to need complex back-and-forth
manoeurving.
Monitoring robot using GPRS and Bluetooth
Department of ECE 7 H.K.B.K.C.E
 NAVIGATION FOR LAND VEHICLES
Navigation is used here to mean determining the position of a mobile robot. It is
sometimes defined to include route planning and following. There are many possible methods,
some of which are listed below:
- Tele-operation
If the operator can see the vehicle directly or see its surroundings through an on-board
television camera, the robot need have no autonomous ability.
- Dead reckoning
Odometry (travelled- distance measurement) by counting the wheel revolution together
with direction finding using a magnetometer or gyrocompass, or differential wheel rotation, is
often used for wheeled indoor robots. Dead reckoning is of little use on rough ground except as a
coarse or emergency method.
- Tracking from a fixed base
Triangulation using radar, optical or acoustic methods can be used to locate the vehicle
relative to fixed stations and the information can be transmitted to the vehicle. A related
technique is for the radar or other sensor to be on the vehicle and to detect beacons which may be
lights, reflectors or transponders.
- Satellite navigation
The equipment for a satellite navigation system, which uses radio transponders to
measure the distance to satellites of accurately known position, is small enough to fit to some
larger mobile robots.
Monitoring robot using GPRS and Bluetooth
Department of ECE 8 H.K.B.K.C.E
 ROUTE PLANNING
Assuming that the problem of navigation can be solved, a mobile robot, except when
teleported, must work out a route to its current destination. Route planning can be regarded as a
branch of Artificial Intelligence.
 CONTROL AND COMMUNICATION
Mobile robots generally have a hierarchical control structure in which on- board
software handles the lowest levels such as interrogating sensors and driving motors, and often
the intermediate levels such as following a path or even planning a route.
The highest level of control is often remote control by human operator. In this case the
on-board software must be able to receive commands by radio or some other link and to carry
them out, maintaining a safe course of action even when communication is interrupted.
Communication is usually by radio, infrared or cable. Each has its problem. A cable can
become entangled, limits range and imposes drag, but is cheap and simple and is sometimes
useful as a way of pulling the robot out of a dangerous place if its own mobility fails.
If radio is used it may need bandwidth for television signals, and so it has to be ultrahigh
frequency or microwave and there may be legal restrictions on its use and problems of
obstruction and interference.
An antenna pointing mechanism may be necessary. Infrared is strictly a line-of-sight
method and so is even more prone to obstruction than radio, but is immune to most forms of
interference. A combination of methods is needed for the highest reliability.
Monitoring robot using GPRS and Bluetooth
Department of ECE 9 H.K.B.K.C.E
2.4 Applications of Mobile Robots
The correlation between the applications and the physical forms of mobile robots is not
perfect, but for most applications only one or two physical types are common. This section lists
the main application of robot surface vehicles and in each case describes the types of robot used.
 Education and Research – Mobile robots such as turtle types connected as peripherals
to microcomputers are used to enliven the teaching of programming, of computer
principles, and of elementary geometry and other aspects of mathematics.
 Remote Handling – Mobile robots for remote handling of radioactive, explosive and
other dangerous materials are generally teleoperated. They have been built with
internal combustion engines for long-endurance outdoor use, but most are electric,
powered by batteries.
 Military Mobile Robots – These robots are currently being designed around multi-
wheeled (six being common) chassis, or with tracks. These robots will have to able to
recognize targets, threats and friendly units.
 Fire- fighting and Rescue – Robots are potentially attractive for inspecting dangerous
areas in fire and for providing a fire-proof vehicle which can be sent through a fire to
rescue people.
 Construction – Legged robots for surveying the sea- bed in preparation for bridge
construction has been proposed.
 The use of mobile robot in the mining activity and planetary exploration has been
proposed such as mine clearance, as decoys etc.
Monitoring robot using GPRS and Bluetooth
Department of ECE 10 H.K.B.K.C.E
2.5 Advantages of Mobile robots
Speed – These robots can process information much more quickly than humans. This means they
are good for controlling machinery that might need to be adjusted instantly.
Repetition – Mobile robots are automated systems that can do the same task over and over again
without getting bored, needing breaks or making mistakes.
Accuracy – These robots can do very detailed work and follow precise instructions without
error.
Safety – Mobile robots can work in places where it would be unsafe to put a human, for
example, in a nuclear power plant, under water or in space.
Efficiency - They get more done than humans but cost less to operate. This is because they do
not need breaks, wages, holidays, canteens, heating and lighting. The quality of the work done is
always of the same standard being materials are not wasted due to human error.
Adaptability - Automated systems can be reprogrammed to do different tasks. For example, the
Survobot is performing subdivision of plots with a constraint of 3 inches, as a result of which it
can be at present used for small area calculations. It can be reprogrammed for bigger area
calculation as well.
So we understood how advantageous mobile robots are present day scenario.
Monitoring robot using GPRS and Bluetooth
Department of ECE 11 H.K.B.K.C.E
CHAPTER 3
LITERATURE SURVEY
The definition we have chosen for a ―robot‖ requires the device to obtain data about its
environment, make a decision, and then take action accordingly. This does not exclude the
option of a robot being semi-autonomous (having aspects which are controlled by a human and
others which it does on its own). A good example of this is a sophisticated underwater robot; a
human controls the basic movements of the robot while an on-board processor measures and
reacts to underwater currents in order to keep the robot in the same position without drifting. A
camera onboard the robot sends video back to the human while onboard sensors may track the
water temperature, pressure and more. If the robot loses communication with the surface, an
autonomous program may kick-in causing it to surface. If you want to be able to send and/or
receive commands from your robot, you will need to determine its level of autonomy and if you
want it to be tethered, wireless or fully autonomous.
3.1 Tethered
3.1.1Direct Wired Control
The easiest way to control a vehicle is with a handheld controller physically connected to the
vehicle using a cable (i.e. a tether). Toggle switches, knobs, levers, joysticks and buttons on this
controller allow the user to control the vehicle without the need to incorporate complex
electronics. In this situation, the motors and a power source can be connected directly with a
switch in order to control its forward/backwards rotation. Such vehicles usually have no
intelligence and are considered to be more ―remote controlled machines‖ than ―robots‖.
Figure 3.1 direct wired control
Monitoring robot using GPRS and Bluetooth
Department of ECE 12 H.K.B.K.C.E
Advantages
 The robot is not limited to an operating time since it can be connected directly to the
mains
 There is no worry about loss of signal
 Minimal electronics and minimal complexity
 The robot itself can be light weight or have added payload capacity
 The robot can be physically retrieved if something goes wrong (very important for
underwater robots)
Disadvantages
 The tether can get caught or snagged (and potentially cut)
 Distance is limited by the length of the tether
 Dragging a long tether adds friction and can slow or even stop the robot from moving.
3.1.2 Wired computer control
The next step is to incorporate a microcontroller into the vehicle but continue to use a tether.
Connecting the microcontroller to one of your computer‘s I/O ports (e.g. a USB port) allows you
to control its actions using a keyboard (or keypad), joystick or other peripheral device. Adding a
microcontroller to a project also may require you to program how the robot reacts to the input.
Instead of using a laptop or desktop computer, netbooks are often a desirable choice because of
their low price, small size and low weight.
Figure 3.2 wired computer control
Monitoring robot using GPRS and Bluetooth
Department of ECE 13 H.K.B.K.C.E
Advantages
 Same advantages as with direct wired control
 More complex behaviors can be programmed or mapped to single buttons or commands.
 Larger controller choice (mouse, keyboard, joystick, etc.)
 Added onboard intelligence means it can interface with sensors and make certain
decisions on its own
Disadvantages
 Cost is higher than a purely tethered robot because of the added electronics
 Same disadvantages as with direct wired control.
3.1.3 Ethernet
A variation on computer control would be to use an Ethernet interface. A robot that is physically
connected to a router (so it could be controlled via the Internet) is also possible (though not very
practical) for mobile robots. Setting-up a robot that can communicate using the internet can be
fairly complex, and more often than not, a WiFi (wireless internet) connection is preferable. A
wired and wireless combination is also an option, where there is a transceiver (transmit and
receive) connected physically to the internet and data received via the internet is then sent
wirelessly to the robot.
Figure 3.3 Ethernet
Monitoring robot using GPRS and Bluetooth
Department of ECE 14 H.K.B.K.C.E
Advantages
 Robot can be controlled through the Internet from anywhere in the world
 The robot is not limited to an operating time since it could use Power over Ethernet
(PoE).
 Using Internet Protocol (IP) can simplify and improve the communication scheme.
 Same advantages as with direct wired computer control
Disadvantages
 Programming involved is more complex
 The tether can get caught or snagged (and potentially cut)
 Distance is limited by the length of the tether
 Dragging a long tether adds friction and can slow or even stop the robot from moving.
3.2 Wireless
3.2.1 Infrared
Infrared transmitters and receivers cut the cables connecting the robot to the operator. This is
usually a milestone for beginners. Infrared control requires ―line of sight‖ in order to function;
the receiver must be able to ―see‖ the transmitter at all times in order to receive data. Infrared
remote controls (such as universal remote controls for televisions) are used to send commands to
an infrared receiver connected to a microcontroller which then interprets these signals and
controls the robot‘s actions.
Figure 3.4 Infrared
Monitoring robot using GPRS and Bluetooth
Department of ECE 15 H.K.B.K.C.E
Advantages
 Low cost
 Simple TV remote controls can be used as controllers
Disadvantages
 Needs to be line of sight
 Distance is limited.
3.2.2 Radio Frequency (RF)
Commercially available Remote Control (R/C) units use small microcontrollers in the transmitter
and receiver to send, receive and interpret data sent via radio frequency (RF). RF communication
requires either a transmitter matched/paired with a receiver, or a transceiver (which can both
send and receive data). RF does not require line of sight and can also offer significant range
(transmission distance). Standard radio frequency devices can allow for data transfer between
devices as far away as several kilometers and there is seemingly no limit to the range for more
professional RF units.
XBee and Zigbee modules use RF for communication, but allow the user to vary many of the
communication parameters involved. These modules have a specific footprint (layout) and are
only produced by certain companies. Their main advantage is that they provide a very robust
easy to set up link and take care of all of the communication protocol details.
Many robot builders choose to make semi-autonomous robots with RF capability since it allows
the robot to be as autonomous as possible, provide feedback to a user and still give the user some
control over some of its functions should the need arise.
Figure 3.5 Radio Frequency(RF)
Monitoring robot using GPRS and Bluetooth
Department of ECE 16 H.K.B.K.C.E
Advantages
 Considerable distances possible
 Setup can be straightforward
 Omni directional (impeded but not entirely blocked by walls and obstructions)
Disadvantages
 Very low data rate (simple commands only)
 Pay attention to the transmission frequencies – they can be shared.
3.2.3 Bluetooth
Bluetooth is a form of RF and follows specific protocols for sending and receiving data. Normal
Bluetooth range is often limited to about 10m though it does have the advantage of allowing
users to control their robot via Bluetooth-enabled devices such as cell-phones, PDAs and laptops
(though custom programming may be required to create an interface). Just like RF, Bluetooth
offers two-way communication.
Figure 3.6 Bluetooth
Advantages
 Controllable from any Bluetooth enabled device (usually additional programming is
necessary) such as a Smartphone, laptop, desktop etc.
 Higher data rates possible
 Omnidirectional (does not need line of sight and can travel a little through walls)
Monitoring robot using GPRS and Bluetooth
Department of ECE 17 H.K.B.K.C.E
Disadvantages
 Devices need to be ―paired‖
 Distance is usually about 10m (without obstructions).
3.2.4 WiFi
WiFi is now an option for robots; being able to control a robot wirelessly via the internet
presents some significant advantages (and some drawbacks) to wireless control. In order to set
up a WiFi robot, you need a wireless router connected to the internet and a WiFi unit on the
robot itself. For the robot, you can also use a device that is TCP/IP enabled with a wireless
router.
Figure 3.7 WiFi
Advantages
 Controllable from anywhere in the world so long as it is within range of a wireless router
 High data rates possible
Disadvantages
 Added programming required
 Maximum range is usually determined by the choice of wireless router
Monitoring robot using GPRS and Bluetooth
Department of ECE 18 H.K.B.K.C.E
3.2.5 GPRS / Cellular
Another wireless technology that was originally developed for human to human communication,
the cell phone, is now being used to control robots. Since cellular frequencies are regulated,
incorporating a cellular module on a robot usually requires added patience for programming as
well as an understanding of the cellular network system and the regulations.
Figure 3.8 GPRS enabled mobile phone
Advantages
 Robot can be controlled anywhere it has a cellular signal
 Direct satellite connection is possible
Disadvantages
 Setup and configuration can be complex – NOT for beginners
 Each network has its own requirements / restrictions
 Cellular service is not free; usually the more data you transmit/receive the more money
you will need to pay.
 System is not (yet) well setup for robotics use.
Monitoring robot using GPRS and Bluetooth
Department of ECE 19 H.K.B.K.C.E
CHAPTER 4
PIC16F87X
PIC is a family ofmodified Harvard architecturemicrocontrollers made by Microchip
Technology, derived from the PIC1650 originally developed byGeneral Instrument's
Microelectronics Division. The name PIC initially referred to "Peripheral Interface
Controller".
PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of application notes, availability of low cost or
free development tools, and serial programming (and re-programming with flash memory)
capability. They are also commonly used in educational programming as they often come with
the easy to use 'pic logicator' software.
4.1 Core architecture
The PIC architecture is characterized by its multiple attributes:
 Separate code and data spaces (Harvard architecture).
 A small number of fixed length instructions
 Most instructions are single cycle execution (2 clock cycles, or 4 clock cycles in 8-bit
models), with one delay cycle on branches and skips
 One accumulator (W0), the use of which (as source operand) is implied (i.e. is not
encoded in the opcode)
 All RAM locations function as registers as both source and/or destination of math and
other functions.
 A hardware stack for storing return addresses
 A small amount of addressable data space (32, 128, or 256 bytes, depending on the
family), extended through banking
 Data space mapped CPU, port, and peripheral registers
Monitoring robot using GPRS and Bluetooth
Department of ECE 20 H.K.B.K.C.E
 ALU status flags are mapped into the data space
 The program counter is also mapped into the data space and writable (this is used to
implement indirect jumps).
There is no distinction between memory space and register space because the RAM serves the
job of both memory and registers, and the RAM is usually just referred to as the register file or
simply as the registers.
Data space (RAM)
PICs have a set of registers that function as general purpose RAM. Special purpose control
registers for on-chip hardware resources are also mapped into the data space. The addressability
of memory varies depending on device series, and all PIC devices have some banking
mechanism to extend addressing to additional memory. Later series of devices feature move
instructions which can cover the whole addressable space, independent of the selected bank. In
earlier devices, any register move had to be achieved via the accumulator.
To implement indirect addressing, a "file select register" (FSR) and "indirect register" (INDF)
are used. A register number is written to the FSR, after which reads from or writes to INDF will
actually be to or from the register pointed to by FSR. Later devices extended this concept with
post- and pre- increment/decrement for greater efficiency in accessing sequentially stored data.
This also allows FSR to be treated almost like a stack pointer (SP).
External data memory is not directly addressable except in some high pin count PIC18 devices.
Code space
The code space is generally implemented as ROM, EPROM or flash ROM. In general, external
code memory is not directly addressable due to the lack of an external memory interface. The
exceptions are PIC17 and select high pin count PIC18 devices.
Word size
All PICs handle (and address) data in 8-bit chunks. However, the unit of addressability of the
code space is not generally the same as the data space. For example, PICs in the baseline (PIC12)
and mid-range (PIC16) families have program memory addressable in the same word size as the
Monitoring robot using GPRS and Bluetooth
Department of ECE 21 H.K.B.K.C.E
instruction width, i.e. 12 or 14 bits respectively. In contrast, in the PIC18 series, the program
memory is addressed in 8-bit increments (bytes), which differ from the instruction width of 16
bits.
Stacks
PICs have a hardware call stack, which is used to save return addresses. The hardware stack is
not software accessible on earlier devices, but this changed with the 18 series devices.
Hardware support for a general purpose parameter stack was lacking in early series, but this
greatly improved in the 18 series, making the 18 series architecture more friendly to high level
language compilers.
Figure 4.1 Pin Diagram PIC16F877
Monitoring robot using GPRS and Bluetooth
Department of ECE 22 H.K.B.K.C.E
4.2 Peripheral Features:
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external
Crystal/clock
• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
• Two Capture, Compare, PWM modules
- Capture is 16-bit, max. Resolution is 12.5 ns
- Compare is 16-bit, max. Resolution is 200 ns
- PWM max. Resolution is 10-bit
• 10-bit multi-channel Analog-to-Digital converter
• Synchronous Serial Port (SSP) with SPI (Master mode) and I2C (Master/Slave)
• Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address
Detection
• Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls (40/44-pin only)
• Brown-out detection circuitry for Brown-out Reset (BOR).
4.3Instruction set
A PIC's instructions vary from about 35 instructions for the low-end PICs to over 80 instructions
for the high-end PICs. The instruction set includes instructions to perform a variety of operations
on registers directly, the accumulator and a literal constant or the accumulator and a register, as
well as for conditional execution, and program branching.
Some operations, such as bit setting and testing, can be performed on any numbered register, but
bi-operand arithmetic operations always involve W (the accumulator), writing the result back to
either W or the other operand register. To load a constant, it is necessary to load it into W before
it can be moved into another register. On the older cores, all register moves needed to pass
through W, but this changed on the "high end" cores.
Monitoring robot using GPRS and Bluetooth
Department of ECE 23 H.K.B.K.C.E
PIC cores have skip instructions which are used for conditional execution and branching. The
skip instructions are 'skip if bit set' and 'skip if bit not set'. Because cores before PIC18 had only
unconditional branch instructions, conditional jumps are implemented by a conditional skip (with
the opposite condition) followed by an unconditional branch. Skips are also of utility for
conditional execution of any immediate single following instruction. It is possible to skip skip
instructions. For example, the instruction sequence "skip if A; skip if B; C" will execute C if A is
true or if B is false.
The 18 series implemented shadow registers which save several important registers during an
interrupt, providing hardware support for automatically saving processor state when servicing
interrupts.
In general, PIC instructions fall into 5 classes:
1. Operation on working register (WREG) with 8-bit immediate ("literal") operand.
E.g. movlw (move literal to WREG), andlw (AND literal with WREG). One instruction
peculiar to the PIC isretlw, load immediate into WREG and return, which is used with
computed branches to produce lookup tables.
2. Operation with WREG and indexed register. The result can be written to either the
Working register Bit operations. These take a register number and a bit number, and
perform one of 4 actions: set or clear a bit, and test and skip on set/clear. The latter are
used to perform conditional branches. The usual ALU status flags are available in a
numbered register so operations such as "branch on carry clear" are possible.
3. Control transfers. Other than the skip instructions previously mentioned, there are only
two: goto and call.
4. A few miscellaneous zero-operand instructions, such as return from subroutine,
and sleep to enter low-power mode.
Monitoring robot using GPRS and Bluetooth
Department of ECE 24 H.K.B.K.C.E
4.4Performance
The architectural decisions are directed at the maximization of speed-to-cost ratio. The PIC
architecture was among the first scalar CPU designs,and is still among the simplest and cheapest.
The Harvard architecture—in which instructions and data come from separate sources—
simplifies timing and microcircuit design greatly, and this benefits clock speed, price, and power
consumption.
The PIC instruction set is suited to implementation of fast lookup tables in the program space.
Such lookups take one instruction and two instruction cycles. Many functions can be modeled in
this way. Optimization is facilitated by the relatively large program space of the PIC (e.g. 4096 ×
14-bit words on the 16F690) and by the design of the instruction set, which allows for embedded
constants. For example, a branch instruction's target may be indexed by W, and execute a
"RETLW" which does as it is named - return with literal in W.
Interrupt latency is constant at three instruction cycles. External interrupts have to be
synchronized with the four clock instruction cycle, otherwise there can be a one instruction cycle
jitter. Internal interrupts are already synchronized. The constant interrupt latency allows PICs to
achieve interrupt driven low jitter timing sequences. An example of this is a video sync pulse
generator. This is no longer true in the newest PIC models, because they have a synchronous
interrupt latency of three or four cycles.
Monitoring robot using GPRS and Bluetooth
Department of ECE 25 H.K.B.K.C.E
4.5Advantages
The PIC architectures have these advantages:
 Small instruction set to learn
 RISC architecture
 Built in oscillator with selectable speeds
 Easy entry level, in circuit programming plus in circuit debugging PICKit units available
for less than $50
 Inexpensive microcontrollers
 Wide range of interfaces including I²C, SPI, USB, USART, A/D, programmable
comparators, PWM, LIN, CAN, PSP, and Ethernet.
 Availability of processors in DIL package makes them easy to handle for hobby use.
4.6Limitations
The PIC architectures have these limitations:
 One accumulator
 Register-bank switching is required to access the entire RAM of many devices
 Operations and registers are not orthogonal; some instructions can address RAM
and/or immediate constants, while others can only use the accumulator
Monitoring robot using GPRS and Bluetooth
Department of ECE 26 H.K.B.K.C.E
CHAPTER 5
HARDWARE COMPONENTS
5.1 ULN2003
ULN2003 is a high voltage, high current Darlingtonarrays each containing seven open
collector Darlingtonpairswithcommon emitters.Each channelisrated at 500mA and can withstand
peak currents of600mA.These versatile devicesare useful for driving a widerange of loads
including solenoids, relays DC motors, LED displays filament lamps, thermal printheadsand high
power buffers.
Figure 5.1: ULN2003
Figure 5.2 Pin diagram ULN2003
Monitoring robot using GPRS and Bluetooth
Department of ECE 27 H.K.B.K.C.E
5.2 Relay
A relay is an electrically controllable switch widely used in industrial controls, automobiles and
appliances. It allows the isolation of two separate sections of a system with two different voltage
sources. For instance, a 5V system can be isolated from a 120V system by placing a relay
between them. One such relay is called an eletromechanical relay (EMR). The EMR have 3
components: the coil, spring and contacts.
When current flows through the coil, a magnetic field is created around the coil (the coil is
energized), which causes the armature to be attracted to the coil. The armatures contact acts like
a switch and closes or opens the circuit. When the coil is not energized, a spring pulls the
armature to its normal state of open or closed.
There are different types of relays:
 Single Pole Single Throw (SPST): These have two terminals which can be connected or
disconnected. Including two for the coil, such a relay has four terminals in total. It is
ambiguous whether the pole is normally open or normally closed. The terminology
"SPNO" and "SPNC" is sometimes used to resolve the ambiguity.
 Single Pole Double Throw (SPDT): A common terminal connects to either of two
others. Including two for the coil, such a relay has five terminals in total.
 Double Pole Double Throw (DPDT): These have two pairs of terminals are equivalent
to two SPST switches or relays actuated by a single coil. Including two for the coil, such
a relay has six terminals in total. The poles may be Form A or Form B (or one of each).
 Double Pole Single Throw (DPDT): These have two rows of change-over terminals.
Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has
eight terminals, including the coil.
Figure 5.3 Circuit symbols of relay
Monitoring robot using GPRS and Bluetooth
Department of ECE 28 H.K.B.K.C.E
In choosing a relay the following characteristics used to be considered:
 The contacts can be normally open (NO) or normally closed (NC). In the NC type, the
contacts are closed when the coil is not energized. In the NO, the contacts are open when
the coil is not energized.
 There can be one or more contacts: SPST, SPDT, DPST and DPDT.
 Voltage and current are needed to energize the coil. The voltage can vary from a few
volts to 50V, while the current can be a few mA to 20mA. The relay has a minimum
voltage is called the pull in voltage.
 The maximum DC/AC voltage and current that can be handled by the contacts. This is in
the range of a few volts to hundreds of volts depending on the relay.
5.2.1 To drive a relay
Digital systems and microcontroller pins lack sufficient current to drive the relay. While the
relay‘s coil needs around 10mA to be energized, the microcontroller‘s pin can provide a
maximum of 1-2mA current. For this reason, we place a driver such as the ULN2803 between
the µC and the relay.
5.2.2 Operation
When a current flows through the coil, the resulting magnetic field attracts an armature that is
mechanically linked to a moving contact. The movement either makes or breaks a connection
with a fixed contact. When the current to the coil is switched off, the armature is returned by a
force approximately half as strong as the magnetic force to its relaxed position.
Usually this is a spring, but gravity is also used commonly in industrial motor starters.
Most relays are manufactured to operate quickly. In a low voltage application, this is to reduce
noise. In a high voltage or high current application, this is to reduce arcing.
Monitoring robot using GPRS and Bluetooth
Department of ECE 29 H.K.B.K.C.E
Figure 5.4 Circuit diagram of relay
If the coil is energized with DC, a diode is frequently installed across the coil, to dissipate
the energy from the collapsing magnetic field at deactivation, which would otherwise generate a
spike of voltage and might cause damage to circuit components. Some automotive relays already
include that diode inside the relay case. If the coil is designed to be energized with AC, a small
copper ring can be crimped to the end if the solenoid. This ―shading ring‖ creates a small out-of-
phase current, which increases the minimum pull on the armature during the AC cycle.
By analogy with the functions of the original electromagnetic device, a solid-state relay is
made with a thyristor or other solid-state switching device. To achieve electrical isolation, a
light-emitting diode (LED) is used with a photo transistor.
Monitoring robot using GPRS and Bluetooth
Department of ECE 30 H.K.B.K.C.E
5.3 DC motor
A DC motor is an electric motor that runs on DC current. The working of a geared DC
motor is similar to that of a DC motor, with a difference that geared DC motor gives a more
controlled RPM and more torque.
In any electric motor, operation is based on simple electromagnetism. A current carrying
conductor generates a magnetic field, when this is then placed in an external magnetic field, it
will experience a force proportional to the current in the conductor, and to the strength of the
external magnetic field. The internal configuration is designed to harness the magnetic
interaction between a current carrying conductor and an external magnetic field to generate a
rotational motion.
Figure 5.5 Schematic diagram of a DC motor
Every DC motor has six parts – axle, rotor, stator, commutator, field magnets, and
brushes. In most common DC motors, the external magnetic field is produced by high strength
permanent magnets. The stator is the stationary part of the motor which is includes the motor
casing as well as two or more permanent magnet pole pieces. The rotor rotates with respect to the
stator. The rotor consists of windings, the windings being electrically connected to the
commutator.
The above diagram shows a common motor layout – with the rotor inside the stator
magnets. The geometry of the brushes, commutator contacts and rotor windings are such that
when power is applied, the polarities of the energized winding and the stator magnets are
misaligned and the rotor will rotate until it is almost aligned with the stator‘s field magnet.
Monitoring robot using GPRS and Bluetooth
Department of ECE 31 H.K.B.K.C.E
5.4 Bluetooth
Bluetooth is an always-on, short-range radio hookup that resides on a microchip. It was initially
developed by Swedish mobile phone maker Ericsson in 1994 as a way to let laptop computers
make calls over a mobile phone. Since then, several thousand companies have signed on to make
Bluetooth the low-power short-range wireless standard for a wide range of devices. Industry
observers expect Bluetooth to be installed in billions of devices by 2005.
The Bluetooth standards are published by an industry consortium known as the Bluetooth SIG
(special interest group).
The concept behind Bluetooth is to provide a universal short-range wireless capability. Using the
2.4 GHz band, available globally for unlicensed low-power uses, two Bluetooth devices within
10 m of each other can share up to 720 Kbps of capacity. Bluetooth is intended to support an
open-ended list of applications, including data (such as schedules and telephone numbers), audio,
graphics, and even video. For example, audio devices can include headsets, cordless and
standard phones, home stereos, and digital MP3 players. Following are some examples of the
capabilities that Bluetooth can provide consumers:
 Make calls from a wireless headset connected remotely to a cell phone;
 Eliminate cables linking computers to printers, keyboards, and the mouse;
 Hook up MP3 players wirelessly to other machines to download music;
 Set up home networks so that a couch potato can remotely monitor air conditioning, the
oven, and children's Internet surfing;
 Call home from a remote location to turn appliances on and off, set the alarm, and
monitor activity.
Monitoring robot using GPRS and Bluetooth
Department of ECE 32 H.K.B.K.C.E
5.4.1 Bluetooth Applications
Bluetooth is designed to operate in an environment of many users. Up to eight devices can
communicate in a small network called a piconet. Ten of these piconets can coexist in the same
coverage range of the Bluetooth radio. To provide security, each link is encoded and protected
against eavesdropping and interference.
Bluetooth provides support for three general application areas using short-range wireless
connectivity:
 Data and voice access points - Bluetooth facilitates real-time voice and data
transmissions by providing effortless wireless connection of portable and stationary
communications devices;
 Cable replacement - Bluetooth eliminates the need for numerous, often proprietary cable
attachments for connection of practically any kind of communications device.
Connections are instant and are maintained even when devices are not within line of
sight. The range of each radio is approximately 10 m, but can be extended to 100 m with
an optional amplifier;
 Ad hoc networking - A device equipped with a Bluetooth radio can establish instant
connection to another Bluetooth radio as soon as it comes into range.
5.4.2 Rn-42 module
Description
The RN42 is a small form factor, low power, highly economic Bluetooth radio for OEM‘s
adding wireless capability to their products. The RN42 supports multiple interface protocols, is
simple to design in and fully certified, making it a complete embedded Bluetooth solution. The
RN 42 is functionally compatible with RN 41. With its high performance on chip antenna and
support for Bluetooth® Enhanced Data Rate (EDR), the RN42 delivers up to 3 Mbps data rate
for distances to 20M. The RN-42 also comes in a package with no antenna (RN-42-N). Useful
when the application requires an external antenna, the RN-42-N is shorter in length and has RF
pads to route the antenna signal.
Monitoring robot using GPRS and Bluetooth
Department of ECE 33 H.K.B.K.C.E
Features
 fully qualified Bluetooth 2.1/2.0/1.2/1.1 module
 Bluetooth v2.0+EDR support
 Available with on board chip antenna (RN- 42) and without antenna (RN-42-N)
 Postage stamp sized form factor, 13.4mm x 25.8 mm x 2mm (RN-42) and 13.4mm x 20 mm x
2 mm (RN-42-N)
 Low power(26uA sleep, 3mA connected, 30mA transmit)
 UART (SPP or HCI) and USB (HCI only) data connection interfaces.
 Sustained SPP data rates- 240Kbps (slave), 300Kbps (master)
 HCI data rates- 1.5Mbps sustained, 3.0Mbps burst in HCI mode
 Embedded Bluetooth stack profiles included(requires no host stack): GAP, SDP, RFCOMM
and L2CAP protocols, with SPP and DUN profile support.
 Bluetooth SIG certified
 Castellated SMT pads for easy and reliable PCB mounting
 Certifications: FCC, ICS, CE
 Environmentally friendly, RoHS compliant
Figure 5.6 RN-42 Bluetooth module
Monitoring robot using GPRS and Bluetooth
Department of ECE 34 H.K.B.K.C.E
Figure 5.7 RN-42 Bluetooth module pin diagram
5.5 PIR sensors
A passive infrared sensor (PIR sensor) is an electronic sensor that measures infrared (IR) light
radiating from objects in its field of view. They are most often used in PIR-based motion
detectors.
Operation
Strictly speaking, individual PIR sensors do not detect motion; rather, they detect abrupt changes
in temperature at a given point. As an object, such as a human, passes in front of the background,
such as a wall, the temperature at that point will rise from room temperature to body temperature,
and then back again. This quick change triggers the detection. Moving objects of identical
temperature, however, will not trigger a detection because that is the sensors job. It detects
Monitoring robot using GPRS and Bluetooth
Department of ECE 35 H.K.B.K.C.E
motion regardless of temperature. This is also why you can take a piece of paper from a desk that
is the same, exact, temperature as everything in the room, attach it to a stick (also the same exact
temperature as the room) and wave it slowly in front of a sensor (at any range within the limit of
the sensor) and it will activate the sensor).
PIRs can be equipped with more than one internal sensing element so that, with the appropriate
electronics, it can detect the apparent direction of movement. As an object passes in front of
adjacent sensors in turn, this implies the direction of movement. This may be used by on-board
electronics to reduce false alarms, i.e., by requiring adjacent sensors to trip in succession. It may
also be used to signal the direction of movement to a monitoring apparatus.
PIRs come in many configurations for a wide variety of applications. The most common models
have numerous Fresnel lenses or mirror segments, an effective range of about ten metres (thirty
feet), and a field of view less than 180 degrees. Models with wider fields of view, including 360
degrees, are available—typically designed to mount on a ceiling. Some larger PIRs are made
with single segment mirrors and can sense changes in infrared energy over one hundred feet
away from the PIR. There are also PIRs designed with reversible orientation mirrors which allow
either broad coverage (110° wide) or very narrow "curtain" coverage, or with individually
selectable segments to "shape" the coverage.
5.6 camouflage
Camouflage is the use of any combination of materials, coloration or illumination for
concealment, either by making animals or objects hard to see (crypsis), or by disguising them as
something else (mimesis). Examples include the leopard's spotted coat, the battledress of a
modern soldier, and the leaf-mimic katydid's wings. .
Figure 5.8 camouflage using LED‘s(RGB recognition circuit)
Monitoring robot using GPRS and Bluetooth
Department of ECE 36 H.K.B.K.C.E
A third approach, motion dazzle, confuses the observer with a conspicuous pattern, making the
object visible but momentarily harder to locate.The majority of camouflage methods aim for
crypsis, often through a general resemblance to the background, high contrast disruptive
coloration, eliminating shadow, and countershading. In the open ocean, where there is no
background, the principal methods of camouflage are transparency, silvering, and
countershading, while the ability to produce light is among other things used for counter-
illumination on the undersides of cephalopods such as squid. Some animals, such
as chameleons andoctopuses, are capable of actively changing their skin pattern and colours;
they often use this ability both for camouflage and for signalling.
Monitoring robot using GPRS and Bluetooth
Department of ECE 37 H.K.B.K.C.E
CHAPTER 6
SOFTWARE REQUIREMENTS
6.1 Java Development Kit(JDK 1.6)
The Java Development Kit (JDK) is an implementation of either one of the Java SE, Java
EE or Java ME platformsreleased by Oracle Corporation in the form of a binary product aimed
at Java developers on Solaris, Linux, Mac OS X orWindows. Since the introduction
of Java platform, it has been by far the most widely used Software Development Kit (SDK). On
17 November 2006, Sun announced that it would be released under the GNU General Public
License(GPL), thus making it free software. This happened in large part on 8 May 2007, when
Sun contributed the source code to theOpenJDK.
6.1.1 JDK contents
The JDK has as its primary components a collection of programming tools, including:
 appletviewer – this tool can be used to run and debug Java applets without a web browser
 apt – the annotation-processing tool
 extcheck – a utility which can detect JAR-file conflicts
 idlj – the IDL-to-Java compiler. This utility generates Java bindings from a given Java
IDL file.
 java – the loader for Java applications. This tool is an interpreter and can interpret the class
files generated by the javac compiler. Now a single launcher is used for both development
and deployment. The old deployment launcher, jre, no longer comes with Sun JDK, and
instead it has been replaced by this new java loader.
 javac – the Java compiler, which converts source code into Java bytecode
 javadoc – the documentation generator, which automatically generates documentation
from source code comments
 jar – the archiver, which packages related class libraries into a single JAR file. This tool also
helps manage JAR files.
 javah – the C header and stub generator, used to write native methods
Monitoring robot using GPRS and Bluetooth
Department of ECE 38 H.K.B.K.C.E
 javap – the class file disassembler
 javaws – the Java Web Start launcher for JNLP applications
 JConsole – Java Monitoring and Management Console
 jdb – the debugger
 jhat – Java Heap Analysis Tool (experimental)
 jinfo – This utility gets configuration information from a running Java process or crash
dump. (experimental)
 jmap – This utility outputs the memory map for Java and can print shared object memory
maps or heap memory details of a given process or core dump. (experimental)
 jps – Java Virtual Machine Process Status Tool lists the instrumented HotSpot Java Virtual
Machines (JVMs) on the target system. (experimental)
 jrunscript – Java command-line script shell.
 jstack – utility which prints Java stack traces of Java threads (experimental)
 jstat – Java Virtual Machine statistics monitoring tool (experimental)
 jstatd – jstat daemon (experimental)
 keytool – tool for manipulating the keystore
 pack200 – JAR compression tool
 policytool – the policy creation and management tool, which can determine policy for a Java
runtime, specifying which permissions are available for code from various sources
 VisualVM – visual tool integrating several command-line JDK tools and
lightweight performance and memory profiling capabilities
 wsimport – generates portable JAX-WS artifacts for invoking a web service.
 xjc – Part of the Java API for XML Binding (JAXB) API. It accepts an XML schema and
generates Java classes.
Experimental tools may not be available in future versions of the JDK.
The JDK also comes with a complete Java Runtime Environment, usually called
a private runtime, due to the fact that it is separated from the "regular" JRE and has extra
contents. It consists of aJava Virtual Machine and all of the class libraries present in the
production environment, as well as additional libraries only useful to developers, such as
the internationalization libraries and theIDL libraries
Monitoring robot using GPRS and Bluetooth
Department of ECE 39 H.K.B.K.C.E
6.1.2About the Java Technology
Java technology is both a programming language and a platform.
The Java Programming Language
The Java programming language is a high-level language that can be characterized by all of the
following buzzwords:
 Simple
 Object oriented
 Distributed
 Multithreaded
 Dynamic
 Architecture neutral
 Portable
 High performance
 Robust
 Secure
Each of the preceding buzzwords is explained in The Java Language Environment, a white paper
written by James Gosling and Henry McGilton.
In the Java programming language, all source code is first written in plain text files ending with
the .java extension. Those source files are then compiled into .class files by thejavac compiler.
A .class file does not contain code that is native to your processor; it instead
contains bytecodes — the machine language of the Java Virtual Machine1
(Java VM).
The java launcher tool then runs your application with an instance of the Java Virtual Machine.
Figure 6.1 an overview of the software development process.
Because the Java VM is available on many different operating systems, the same .class files are
capable of running on Microsoft Windows, the Solaris™ Operating System (Solaris OS), Linux,
or Mac OS. Some virtual machines, such as the Java SE HotSpot at a Glance, perform additional
steps at runtime to give your application a performance boost. This include various tasks such as
Monitoring robot using GPRS and Bluetooth
Department of ECE 40 H.K.B.K.C.E
finding performance bottlenecks and recompiling (to native code) frequently used sections of
code.
Figure 6.2 Through the Java VM, the same application is
capable of running on multiple platforms.
6.1.3 The Java Platform
A platform is the hardware or software environment in which a program runs. We've already
mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and
Mac OS. Most platforms can be described as a combination of the operating system and
underlying hardware. The Java platform differs from most other platforms in that it's a software-
only platform that runs on top of other hardware-based platforms.
The Java platform has two components:
 The Java Virtual Machine
 The Java Application Programming Interface (API)
You've already been introduced to the Java Virtual Machine; it's the base for the Java platform
and is ported onto various hardware-based platforms.
Monitoring robot using GPRS and Bluetooth
Department of ECE 41 H.K.B.K.C.E
The API is a large collection of ready-made software components that provide many useful
capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known
as packages.
Figure 6.3 The API and Java Virtual Machine insulate the
program from the underlying hardware.
As a platform-independent environment, the Java platform can be a bit slower than native code.
However, advances in compiler and virtual machine technologies are bringing performance close
to that of native code without threatening portability.
The terms"Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java platform.
The general-purpose, high-level Java programming language is a powerful software platform.
Every full implementation of the Java platform gives you the following features:
 Development Tools: The development tools provide everything you'll need for
compiling, running, monitoring, debugging, and documenting your applications. As a
new developer, the main tools you'll be using are the javac compiler,
the java launcher, and the javadoc documentation tool.
 Application Programming Interface (API): The API provides the core functionality of
the Java programming language. It offers a wide array of useful classes ready for use in
your own applications. It spans everything from basic objects, to networking and
security, to XML generation and database access, and more.
 Deployment Technologies: The JDK software provides standard mechanisms such as the
Java Web Start software and Java Plug-In software for deploying your applications to end
users.
Monitoring robot using GPRS and Bluetooth
Department of ECE 42 H.K.B.K.C.E
 User Interface Toolkits: The Swing and Java 2D toolkits make it possible to create
sophisticated Graphical User Interfaces (GUIs).
 Integration Libraries: Integration libraries such as the Java IDL API, JDBC™ API,
Java Naming and Directory Interface™ (JNDI) API, Java RMI, and Java Remote Method
Invocation over Internet Inter-ORB Protocol Technology (Java RMI-IIOP Technology)
enable database access and manipulation of remote objects.
6.2 Android operating system
Android is a Linux-based operating system designed primarily for touchscreen mobile devices
such as smartphones and tablet computers. Initially developed by Android, Inc., which Google
backed financially and later bought in 2005, Android was unveiled in 2007 along with the
founding of the Open Handset Alliance: a consortium of hardware, software, and
telecommunication companies devoted to advancing open standards for mobile devices. The first
Android-powered phone was sold in October 2008.
Android is open source and Google releases the code under the Apache License. This open
source code and permissive licensing allows the software to be freely modified and distributed
by device manufacturers, wireless carriers and enthusiast developers. Additionally, Android has
a large community of developers writing applications ("apps") that extend the functionality of
devices, written primarily in a customized version of the Java programming language. In October
2012, there were approximately 700,000 apps available for Android, and the estimated number
of applications downloaded from Google Play, Android's primary app store, was 25 billion.
These factors have contributed towards making Android the world's most widely used
smartphone platform, overtaking Symbian in the fourth quarter of 2010, and the software of
choice for technology companies who require a low-cost, customizable, lightweight operating
system for high tech devices without developing one from scratch. As a result, despite being
Monitoring robot using GPRS and Bluetooth
Department of ECE 43 H.K.B.K.C.E
primarily designed for phones and tablets, it has seen additional applications on televisions,
games consoles, digital cameras and other electronics. Android's open nature has further
encouraged a large community of developers and enthusiasts to use the open source code as a
foundation for community-driven projects, which add new features for advanced users or bring
Android to devices which were officially released running other operating systems.
Android had a worldwide smartphone market share of 75% during the third quarter of 2012, with
750 million devices activated in total and 1.5 million activations per day. The operating system's
success has made it a target for patent litigation as part of the so-called "smartphone wars"
between technology companies.
Figure 6.4 the green Android logo, designed by graphic designer Irina Blok.
6.2.1 History
Android, Inc. was founded in Palo Alto, California in October 2003 by Andy Rubin (co-founder
of Danger), Rich Miner (co-founder of Wildfire Communications, Inc.), Nick Sears (once VP at
T-Mobile), and Chris White (headed design and interface development at WebTV) to develop, in
Rubin's words "smarter mobile devices that are more aware of its owner's location and
preferences". The early intentions of the company were to develop an advanced operating system
for digital cameras, when it was realized that the market for the devices was not large enough,
and diverted their efforts to producing a smartphone operating system to rival those of Symbian
and Windows Mobile (Apple's iPhone had not been released at the time). Despite the past
accomplishments of the founders and early employees, Android Inc. operated secretly, revealing
only that it was working on software for mobile phones. That same year, Rubin ran out of
Monitoring robot using GPRS and Bluetooth
Department of ECE 44 H.K.B.K.C.E
money. Steve Perlman, a close friend of Rubin, brought him $10,000 in cash in an envelope and
refused a stake in the company.
Google acquired Android Inc. on August 17, 2005, making it a wholly owned subsidiary of
Google. Key employees of Android Inc., including Rubin, Miner and White, stayed at the
company after the acquisition. Not much was known about Android Inc. at the time, but many
assumed that Google was planning to enter the mobile phone market with this move. At Google,
the team led by Rubin developed a mobile device platform powered by the Linux kernel. Google
marketed the platform to handset makers and carriers on the promise of providing a flexible,
upgradable system. Google had lined up a series of hardware component and software partners
and signaled to carriers that it was open to various degrees of cooperation on their part.
Speculation about Google's intention to enter the mobile communications market continued to
build through December 2006. Reports from the BBC and the Wall Street Journal noted that
Google wanted its search and applications on mobile phones and it was working hard to deliver
that. Print and online media outlets soon reported rumors that Google was developing a Google-
branded handset. Some speculated that as Google was defining technical specifications, it was
showing prototypes to cell phone manufacturers and network operators. In September 2007,
Information Week covered an evalueserve study reporting that Google had filed several patent
applications in the area of mobile telephony.
On November 5, 2007, the Open Handset Alliance, a consortium of technology companies
including Google, device manufacturers such as HTC and Samsung, wireless carriers such as
Sprint Nextel and T-Mobile, and chipset makers such as Qualcomm and Texas Instruments,
unveiled itself, with a goal to develop open standards for mobile devices.That day, Android was
unveiled as its first product, a mobile device platform built on the Linux kernel version 2.6.The
first commercially available phone to run Android was the HTC Dream, released on October 22,
2008.
Since 2008, Android has seen numerous updates which have incrementally improved the
operating system, adding new features and fixing bugs in previous releases. Each major release is
named in alphabetical order after a dessert or sugary treat; for example, version 1.5 Cupcake was
followed by 1.6 Donut. The latest release is 4.2 Jelly Bean. In 2010, Google launched its Nexus
series of devices—a line of smartphones and tablets running the Android operating system, and
Monitoring robot using GPRS and Bluetooth
Department of ECE 45 H.K.B.K.C.E
built by a manufacturer partner. HTC collaborated with Google to release the first Nexus
smartphone, the Nexus One. The series has since been updated with newer devices, such as the
Nexus 4 phone and Nexus 10 tablet, made by LG and Samsung, respectively. Google releases the
Nexus phones and tablets to act as their flagship Android devices, demonstrating Android's latest
software and hardware features.
On 13 March 2013, it was announced by Larry Page in a blog post that Andy Rubin had moved
from the Android division to take on new projects at Google. He was replaced by SundarPichai,
who also continues his role as the head of Google's Chrome division,which develops Chrome
OS.
6.2.2 Interface
Android's user interface is based on direct manipulation, using touch inputs that loosely
correspond to real-world actions, like swiping, tapping, pinching and reverse pinching to
manipulate on-screen objects. The response to user input is designed to be immediate and
provides a fluid touch interface, often using the vibration capabilities of the device to provide
haptic feedback to the user. Internal hardware such as accelerometers, gyroscopes and proximity
sensors are used by some applications to respond to additional user actions, for example
adjusting the screen from portrait to landscape depending on how the device is oriented, or
allowing the user to steer a vehicle in a racing game by rotating the device, simulating control of
a steering wheel.
Android devices boot to the homescreen, the primary navigation and information point on the
device, which is similar to the desktop found on PCs. Android homescreens are typically made
up of app icons and widgets; app icons launch the associated app, whereas widgets display live,
auto-updating content such as the weather forecast, the user's email inbox, or a news ticker
directly on the home screen.
A home screen may be made up of several pages that the user can swipe back and forth between,
though Android's homescreen interface is heavily customisable, allowing the user to adjust
thelook and feel of the device to their tastes. Third party apps available on Google Play and other
app stores can extensively re-theme the homescreen, and even mimic the look of other operating
Monitoring robot using GPRS and Bluetooth
Department of ECE 46 H.K.B.K.C.E
systems, such as Windows Phone. Most manufacturers, and some wireless carriers, customise the
look and feel of their Android devices to differentiate themselves from the competition.
Present along the top of the screen is a status bar, showing information about the device and its
connectivity. This status bar can be "pulled" down to reveal a notification screen where apps
display important information or updates, such as a newly received email or SMS text, in a way
that does not immediately interrupt or inconvenience the user. In early versions of Android these
notifications could be tapped to open the relevant app, but recent updates have provided
enhanced functionality, such as the ability to call a number back directly from the missed call
notification without having to open the dialer app first. Notifications are persistent until read or
dismissed by the user.
Figure 6.5 Android 4.2 "Jelly Bean" on the Nexus 4
Monitoring robot using GPRS and Bluetooth
Department of ECE 47 H.K.B.K.C.E
6.2.3 Applications
Android has a growing selection of third party applications, which can be acquired by users
either through an app store such as Google Play or the Amazon Appstore, or by downloading and
installing the application's APK file from a third-party site. The Play Store application allows
users to browse, download and update apps published by Google and third-party developers, and
is pre-installed on devices that comply with Google's compatibility requirements. The app filters
the list of available applications to those that are compatible with the user's device, and
developers may restrict their applications to particular carriers or countries for business reasons.
Purchases of unwanted applications can be refunded within 15 minutes of the time of download,
and some carriers offer direct carrier billing for Google Play application purchases, where the
cost of the application is added to the user's monthly bill. As of September 2012, there were
more than 675,000 apps available for Android, and the estimated number of applications
downloaded from the Play Store was 25 billion.
Applications are developed in the Java language using the Android software development kit
(SDK). The SDK includes a comprehensive set of development tools, including a debugger,
software libraries, a handset emulator based on QEMU, documentation, sample code, and
tutorials. The officially supported integrated development environment (IDE) is Eclipse using the
Android Development Tools (ADT) plugin. Other development tools are available, including a
Native Development Kit for applications or extensions in C or C++, Google App Inventor, a
visual environment for novice programmers, and various cross platform mobile web applications
frameworks.
In order to work around limitations on reaching Google services due to Internet censorship in the
People's Republic of China, Android devices sold in the PRC are generally customized to use
state approved services instead.
Monitoring robot using GPRS and Bluetooth
Department of ECE 48 H.K.B.K.C.E
6.3 Android emulator
The Android SDK includes a virtual mobile device emulator that runs on your computer. The
emulator lets you prototype, develop and test Android applications without using a physical
device.
The Android emulator mimics all of the hardware and software features of a typical mobile
device, except that it cannot place actual phone calls. It provides a variety of navigation and
control keys, which you can "press" using your mouse or keyboard to generate events for your
application. It also provides a screen in which your application is displayed, together with any
other active Android applications.
Figure 6.6 Android emulator
To let you model and test your application more easily, the emulator utilizes Android Virtual
Device (AVD) configurations. AVDs let you define certain hardware aspects of your emulated
phone and allow you to create many configurations to test many Android platforms and hardware
permutations. Once your application is running on the emulator, it can use the services of the
Android platform to invoke other applications, access the network, play audio and video, store
and retrieve data, notify the user, and render graphical transitions and themes.
Monitoring robot using GPRS and Bluetooth
Department of ECE 49 H.K.B.K.C.E
The emulator also includes a variety of debug capabilities, such as a console from which you can
log kernel output, simulate application interrupts (such as arriving SMS messages or phone
calls), and simulate latency effects and dropouts on the data network.
6.3.1 Overview
The Android emulator is an application that provides a virtual mobile device on which you can
run your Android applications. It runs a full Android system stack, down to the kernel level, that
includes a set of preinstalled applications (such as the dialer) that you can access from your
applications. You can choose what version of the Android system you want to run in the
emulator by configuring AVDs, and you can also customize the mobile device skin and key
mappings. When launching the emulator and at runtime, you can use a variety of commands and
options to control its behavior.
The Android system images available through the Android SDK Manager contain code for the
Android Linux kernel, the native libraries, the Dalvik VM, and the various Android packages
(such as the Android framework and preinstalled applications). The emulator provides dynamic
binary translation of device machine code to the OS and processor architecture of your
development machine.
The Android emulator supports many hardware features likely to be found on mobile devices,
including:
An ARMv5 CPU and the corresponding memory-management unit (MMU)
A 16-bit LCD display
One or more keyboards (a Qwerty-based keyboard and associated Dpad/Phone buttons)
A sound chip with output and input capabilities
Flash memory partitions (emulated through disk image files on the development machine)
A GSM modem, including a simulated SIM Card
A camera, using a webcam connected to your development computer.
Sensors like an accelerometer, using data from a USB-connected Android device.
Monitoring robot using GPRS and Bluetooth
Department of ECE 50 H.K.B.K.C.E
6.3.2 Android Virtual Devices and the Emulator
To use the emulator, you first must create one or more AVD configurations. In each
configuration, you specify an Android platform to run in the emulator and the set of hardware
options and emulator skin you want to use. Then, when you launch the emulator, you specify the
AVD configuration that you want to load.
Each AVD functions as an independent device, with its own private storage for user data, SD
card, and so on. When you launch the emulator with an AVD configuration, it automatically
loads the user data and SD card data from the AVD directory. By default, the emulator stores the
user data, SD card data, and cache in the AVD directory.
To create and manage AVDs you use the AVD Manager UI or the android tool that is included in
the SDK. For complete information about how to set up AVDs, see Managing Virtual Devices.
6.3.3 Starting and Stopping the Emulator
During development and testing of your application, you install and run your application in the
Android emulator. You can launch the emulator as a standalone application from a command
line, or you can run it from within your Eclipse development environment. In either case, you
specify the AVD configuration to load and any startup options you want to use, as described in
this document.
You can run your application on a single instance of the emulator or, depending on your needs,
you can start multiple emulator instances and run your application in more than one emulated
device. You can use the emulator's built-in commands to simulate GSM phone calling or SMS
between emulator instances, and you can set up network redirection that allows emulators to
send data to one another. For more information, see Telephony Emulation, SMS Emulation, and
Emulator Networking
To start an instance of the emulator from the command line, navigate to the tools/ folder of the
SDK. Enter emulator command like this:
emulator -avd<avd_name> [<options>]
Monitoring robot using GPRS and Bluetooth
Department of ECE 51 H.K.B.K.C.E
This initializes the emulator, loads an AVD configuration and displays the emulator window. For
more information about command line options for the emulator, see the Android Emulator tool
reference.
Note: You can run multiple instances of the emulator concurrently, each with its own AVD
configuration and storage area for user data, SD card, and so on.
If you are working in Eclipse, the ADT plugin for Eclipse installs your application and starts the
emulator automatically, when you run or debug the application. You can specify emulator startup
options in the Run/Debug dialog, in the Target tab. When the emulator is running, you can issue
console commands as described later in this document.
If you are not working in Eclipse, see Installing Applications on the Emulator for information
about how to install your application.
To stop an emulator instance, just close the emulator's window.
6.3.4 Installing Applications on the Emulator
If you don't have access to Eclipse or the ADT Plugin, you can install your application on the
emulator using the adb utility. Before installing the application, you need to build and package it
into an .apk as described in Building and Running Apps. Once the application is installed, you
can start the emulator from the command line as described previously, using any startup options
necessary. When the emulator is running, you can also connect to the emulator instance's console
to issue commands as needed.
As you update your code, you periodically package and install it on the emulator. The emulator
preserves the application and its state data across restarts, in a user-data disk partition. To ensure
that the application runs properly as you update it, you may need to delete the emulator's user-
data partition. To do so, start the emulator with the -wipe-data option. For more information
about the user-data partition and other emulator storage, see Working with Emulator Disk
Images.
Monitoring robot using GPRS and Bluetooth
Department of ECE 52 H.K.B.K.C.E
6.3.5 Emulator Limitations
The functional limitations of the emulator include:
 No support for placing or receiving actual phone calls. You can simulate phone calls
(placed and received) through the emulator console, however.
 No support for USB connections
 No support for device-attached headphones
 No support for determining network connected state
 No support for determining battery charge level and AC charging state
 No support for determining SD card insert/eject
 No support for Bluetooth
6.4 MPLAB
The MPLAB is the new graphical, integrated debugging tool set for all of Microchip‘s more than
800 8-bit, 16-bit and 32-bit MCUs and digital signal controllers, and memory devices. It includes
a feature-rich editor, source-level debugger, project manager, software simulator, and supports
Microchip‘s popular hardware tools, such as the MPLAB ICD 3 in-circuit debugger, PICkit™ 3,
and MPLAB PM3 programmer. Based on the open-source NetBeans platform, MPLAB X runs
on Windows® OS, MAC® OS and Linux, supports many third-party tools, and is compatible
with many NetBeans plug-ins.
Figure 6.7 MPLAB X
MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the
development of embedded applications employing Microchip's PIC®
and
dsPIC®
microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows®
, is easy to
use and includes a host of free software components for fast application development and super-
Monitoring robot using GPRS and Bluetooth
Department of ECE 53 H.K.B.K.C.E
charged debugging. MPLAB IDE also serves as a single, unified graphical user interface for
additional Microchip and third party software and hardware development tools. Moving between
tools is a snap, and upgrading from the free software simulator to hardware debug and
programming tools is done in a flash because MPLAB IDE has the same user interface for all
tools.
6.4.1 Embedded C
Embedded C is a set of language extensions for the C Programming language by the C Standards
committee to address commonality issues that exist between C extensions for different embedded
systems. Historically, embedded C programming requires nonstandard extensions to the C
language in order to support exotic features such as fixed-point arithmetic, multiple distinct
memory banks, and basic I/O operations.
In 2008, the C Standards Committee extended the C language to address these issues by
providing a common standard for all implementations to adhere to. It includes a number of
features not available in normal C, such as, fixed-point arithmetic, named address spaces, and
basic I/O hardware addressing.
Embedded C use most of the syntax and semantics of standard C, e.g., main() function, variable
definition, data type declaration, conditional statements (if, switch. case), loops (while, for),
functions, arrays and strings, structures and union, bit operations, macros, unions,etc.
Looking around, we find ourselves to be surrounded by various types of embedded systems. Be
it a digital camera or a mobile phone or a washing machine, all of them has some kind of
processor functioning inside it. Associated with each processor is the embedded software. If
hardware forms the body of an embedded system, embedded processor acts as the brain, and
embedded software forms its soul. It is the embedded software which primarily governs the
functioning of embedded systems.
During infancy years of microprocessor based systems, programs were developed using
assemblers and fused into the EPROMs. There used to be no mechanism to find what the
program was doing. LEDs, switches, etc. were used to check correct execution of the program.
Monitoring robot using GPRS and Bluetooth
Department of ECE 54 H.K.B.K.C.E
Some ‗very fortunate‘ developers had In-circuit Simulators (ICEs), but they were too costly and
were not quite reliable as well.
As time progressed, use of microprocessor-specific assembly-only as the programming language
reduced and embedded systems moved onto C as the embedded programming language of
choice. C is the most widely used programming language for embedded processors/controllers.
Assembly is also used but mainly to implement those portions of the code where very high
timing accuracy, code size efficiency, etc. are prime requirements.
Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write
(portable) operating systems. Originally it was implemented on UNIX operating systems. As it
was intended for operating systems development, it can manipulate memory addresses. Also, it
allowed programmers to write very compact codes. This has given it the reputation as the
language of choice for hackers too.
As assembly language programs are specific to a processor, assembly language didn‘t offer
portability across systems. To overcome this disadvantage, several high level languages,
including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but
couldn‘t find wide acceptance. Amongst those, C got wide acceptance for not only embedded
systems, but also for desktop applications. Even though C might have lost its sheen as
mainstream language for general purpose applications, it still is having a strong-hold in
embedded programming. Due to the wide acceptance of C in the embedded systems, various
kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all this facilitated
development of embedded systems using C.
Subsequent sections will discuss what is Embedded C, features of C language, similarities and
difference between C and embedded C, and features of embedded C programming.
EMBEDDED SYSTEMS PROGRAMMING
Embedded systems programming is different from developing applications on a desktop
computers. Key characteristics of an embedded system, when compared to PCs, are as follows:
Monitoring robot using GPRS and Bluetooth
Department of ECE 55 H.K.B.K.C.E
· Embedded devices have resource constraints(limited ROM, limited RAM, limited stack
space, less processing power)
· Components used in embedded system and PCs are different; embedded systems typically
uses smaller, less power consuming components.
· Embedded systems are more tied to the hardware.
Two salient features of Embedded Programming are code speed and code size. Code speed is
governed by the processing power, timing constraints, whereas code size is governed by
available program memory and use of programming language. Goal of embedded system
programming is to get maximum features in minimum space and minimum time.
Embedded systems are programmed using different type of languages:
· Machine Code
· Low level language, i.e., assembly
· High level language like C, C++, Java, Ada, etc.
· Application level language like Visual Basic, scripts, Access, etc.
Assembly language maps mnemonic words with the binary machine codes that the processor
uses to code the instructions. Assembly language seems to be an obvious choice for
programming embedded devices. However, use of assembly language is restricted to developing
efficient codes in terms of size and speed. Also, assembly codes lead to higher software
development costs and code portability is not there. Developing small codes are not much of a
problem, but large programs/projects become increasingly difficult to manage in assembly
language. Finding good assembly programmers has also become difficult nowadays. Hence high
level languages are preferred for embedded systems programming.
Use of C in embedded systems is driven by following advantages
· It is small and reasonably simpler to learn, understand, program and debug.
· C Compilers are available for almost all embedded devices in use today, and there is a large
pool of experienced C programmers.
Monitoring robot using GPRS and Bluetooth
Department of ECE 56 H.K.B.K.C.E
· Unlike assembly, C has advantage of processor-independence and is not specific to any
particular microprocessor/ microcontroller or any system. This makes it convenient for a user to
develop programs that can run on most of the systems.
· As C combines functionality of assembly language and features of high level languages, C is
treated as a ‗middle-level computer language‘ or ‗high level assembly language‘
· It is fairly efficient
· It supports access to I/O and provides ease of management of large embedded projects.
Compared to assembly language, C Code written is more reliable and scalable, more portable
between different platforms (with some changes). Moreover, programs developed in C are much
easier to understand, maintain and debug. Also, as they can be developed more quickly, codes
written in C offers better productivity. C is based on the philosophy ‗programmers know what
they are doing‘; only the intentions are to be stated explicitly. It is easier to write good code in C
& convert it to an efficient assembly code (using high quality compilers) rather than writing an
efficient code in assembly itself. Benefits of assembly language programming over C are
negligible when we compare the ease with which C programs are developed by programmers.
Objected oriented language, C++ is not apt for developing efficient programs in resource
constrained environments like embedded devices. Virtual functions & exception handling of
C++ are some specific features that are not efficient in terms of space and speed in embedded
systems. Sometimes C++ is used only with very few features, very much as C.
Java is another language used for embedded systems programming. It primarily finds usage in
high-end mobile phones as it offers portability across systems and is also useful for browsing
applications. Java programs require Java Virtual Machine (JVM), which consume lot of
resources. Hence it is not used for smaller embedded devices.
Efficient embedded C programs must be kept small and efficient; they must be optimized for
code speed and code size. Good understanding of processor architecture embedded C
programming and debugging tools facilitate this.
Monitoring robot using GPRS and Bluetooth
Department of ECE 57 H.K.B.K.C.E
DIFFERENCE BETWEEN C AND EMBEDDED C
Though C and embedded C appear different and are used in different contexts, they have more
similarities than the differences. Most of the constructs are same; the difference lies in their
applications.
C is used for desktop computers, while embedded C is for microcontroller based applications.
Accordingly, C has the luxury to use resources of a desktop PC like memory, OS, etc. While
programming on desktop systems, we need not bother about memory. However, embedded C has
to use with the limited resources (RAM, ROM, I/Os) on an embedded processor. Thus, program
code must fit into the available program memory. If code exceeds the limit, the system is likely
to crash.
Compilers for C (ANSI C) typically generate OS dependantexecutables. Embedded C requires
compilers to create files to be downloaded to the microcontrollers/microprocessors where it
needs to run. Embedded compilers give access to all resources which is not provided in
compilers for desktop computer applications.
Embedded systems often have the real-time constraints, which is usually not there with desktop
computer applications. Embedded systems often do not have a console, which is available in case
of desktop applications. So, what basically is different while programming with embedded C is
the mindset; for embedded applications, we need to optimally use the resources, make the
program code efficient, and satisfy real time constraints, if any. All this is done using the basic
constructs, syntaxes, and function libraries of ‗C‘.
6.4.2 MPLAB IDE
MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the
development of embedded applications employing Microchip's PIC®
and
dsPIC®
microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows®
, is easy to
use and includes a host of free software components for fast application development and super-
charged debugging. MPLAB IDE also serves as a single, unified graphical user interface for
additional Microchip and third party software and hardware development tools.
Monitoring robot using GPRS and Bluetooth
Department of ECE 58 H.K.B.K.C.E
Figure 6.8 MPLAB IDE interface
The typical tasks for developing an embedded controller application are:
1. Create the high level design. From the features and performance desired, decide which PIC®
MCU or dsPIC® DSC device is best suited to the application, then design the associated
hardware circuitry.
After determining which peripherals and pins control the hardware, write the firmware – the
software that will control the hardware aspects of the embedded application. A language tool
such as an assembler, which is directly translatable into machine code, or a compiler that allows
a more natural language for creating programs should be used to write and edit code.
Assemblers and compilers help make the code understandable, allowing function labels to
identify code routines with variables that have names associated with their use, and with
constructs that help organize the code in a maintainable structure.
Monitoring robot using GPRS and Bluetooth
Department of ECE 59 H.K.B.K.C.E
2. Compile, assemble and linkthe software using the assembler and/or compiler and linker to
convert your code into ―ones and zeroes‖ –-machine code for the PIC MCUs. This machine code
will eventually become the firmware (the code programmed into the microcontroller).
3. Test your code. Usually a complex program does not work exactly the way imagined, and
―bugs‖ need to be removed from the design to get proper results. The debugger allows you to see
the ―ones and zeroes‖ execute, related to the source code you wrote, with the symbols and
function names from your program.
Debugging allows you to experiment with your code to see the value of variables at various
points in the program, and to do ―what if‖ checks, changing variable values and stepping through
routines.
4. ―Burn‖ the code into a microcontroller and verify that it executes correctly in the finished
application.
Monitoring robot using GPRS and Bluetooth
Department of ECE 60 H.K.B.K.C.E
CHAPTER 7
EXECUTION
STEP 1
Install JDK 1.6
set path (%path%;C:Program FilesJavajdk1.6.0_02bin) and class path as
(%classpath%;C:Program FilesJavajdk1.6.0_02lib) in environment variables Wizard.
STEP 2
Transfer android(apk file) to cell phone.
STEP 3
Run Project by Double Click on run.bat file in src folder.
Figure 7.1 double click run.bat file
Monitoring robot using GPRS and Bluetooth
Department of ECE 61 H.K.B.K.C.E
STEP 4
Can Control the Project Using This Window.
Figure 7.2 GUI on PC
STEP 5
Pair Your ANDROID MOBILE with your robot‘s Bluetooth maodule.
Monitoring robot using GPRS and Bluetooth
Department of ECE 62 H.K.B.K.C.E
STEP 6
Run ANDROID Application(To Read Command From Socket Programs, Give the Server dail up
ip address)
Figure 7.3 android application on phone
STEP 7
Enter the ip address of remote pc
Figure 7.4 IP address of PC on application
Monitoring robot using GPRS and Bluetooth
Department of ECE 63 H.K.B.K.C.E
STEP 8
Streamed images are displayed in and robot can be controlled through buttons.
Monitoring robot using GPRS and Bluetooth
Department of ECE 64 H.K.B.K.C.E
CHAPTER 8
SIGNIFICANCE OF THE PROJECT
The increase of greed in people has paved way to civil-wars and natural disasters. A swift action
has to be taken in the relief work of the aftermath of earthquake affected areas, such that any
delay in the rescue could lead the death toll to rise. The same can be applied to war fields too.
The project focuses on human beings who are alive and struggling for their lives either in the war
field or due to natural disasters like earthquakes, to be recognized and rescued in a much faster
pace.
The robot senses humans alive and sends a notification to the mobile to capture the images of the
same. The captured image is then sent to the server to view and act accordingly. The
administrator at the server end has options to move the robot in any required direction for more
accurate detection of human beings alive.
8.1 Advantages of process monitoring robot
 An affordable Technology with high end advantage
 Can help tracking alive human beings
 View the status of the person alive
 The place can be monitored remotely by moving the robot
 Based on the robot‘s background color, LED‘s on robot will glow, i.e. robot will change
it color based on its background color.
8.2 Disadvantages of process monitoring robot
 Frame rate of video capture is less
 The mobile device is confined to android operating system and the GPRS in the phone
should be enables
 Internet should be available at the server end
Monitoring robot using GPRS and Bluetooth
Department of ECE 65 H.K.B.K.C.E
CHAPTER 9
FUTURE SCOPE AND CONCLUSION
9.1 Future enhancements
 detect the signals of other living beings based on the frequency of the breathing and
heartbeat signals
 The video streaming can be made much faster using Advanced Multimedia API.
 A speaker can be connected to broadcast message to the people.
9.2 CONCLUSION
Thus a process monitoring robot capable of hiding itself by its camouflage capability. Can be
used for various operation including remote and military areas. With the advancement of mobile
network the connection can be made faster, easier and user friendly. It comes as a revolutionary
model for the society which can be helpful in saving a lot of lives during natural disasters or even
a national threat.

More Related Content

What's hot

VOICE OPERATED ROBOT DOCUMENTATION
VOICE OPERATED ROBOT DOCUMENTATIONVOICE OPERATED ROBOT DOCUMENTATION
VOICE OPERATED ROBOT DOCUMENTATION
Sree Harini Dunnala
 
Android bluetooth robot
Android  bluetooth robotAndroid  bluetooth robot
Android bluetooth robot
Sathish Raju
 
Android Operated Wireless Robot Using 8051 MCU
Android Operated Wireless Robot Using 8051 MCUAndroid Operated Wireless Robot Using 8051 MCU
Android Operated Wireless Robot Using 8051 MCU
Kamal Pradhan
 
War robot with night vision camera android application
War robot with night vision camera  android applicationWar robot with night vision camera  android application
War robot with night vision camera android application
Dheeraj Kumar
 

What's hot (20)

VOICE OPERATED ROBOT DOCUMENTATION
VOICE OPERATED ROBOT DOCUMENTATIONVOICE OPERATED ROBOT DOCUMENTATION
VOICE OPERATED ROBOT DOCUMENTATION
 
Presentation slides of android controlled robot
Presentation slides of android controlled robotPresentation slides of android controlled robot
Presentation slides of android controlled robot
 
Voice controlled robot ppt
Voice controlled robot pptVoice controlled robot ppt
Voice controlled robot ppt
 
android controlled robot
android controlled robotandroid controlled robot
android controlled robot
 
Android controlled robot
Android controlled robotAndroid controlled robot
Android controlled robot
 
Android mobile phone controlled bluetooth robot
Android mobile phone controlled bluetooth robotAndroid mobile phone controlled bluetooth robot
Android mobile phone controlled bluetooth robot
 
Mobile controlled robot using bluetooth module (HC-005)
Mobile controlled robot using bluetooth module (HC-005)Mobile controlled robot using bluetooth module (HC-005)
Mobile controlled robot using bluetooth module (HC-005)
 
Bluetooth controlled android car
Bluetooth controlled android car Bluetooth controlled android car
Bluetooth controlled android car
 
Brian black book
Brian black bookBrian black book
Brian black book
 
Android bluetooth robot
Android  bluetooth robotAndroid  bluetooth robot
Android bluetooth robot
 
Android Operated Wireless Robot Using 8051 MCU
Android Operated Wireless Robot Using 8051 MCUAndroid Operated Wireless Robot Using 8051 MCU
Android Operated Wireless Robot Using 8051 MCU
 
Bachelors Project Report
Bachelors Project ReportBachelors Project Report
Bachelors Project Report
 
War robot with night vision camera android application
War robot with night vision camera  android applicationWar robot with night vision camera  android application
War robot with night vision camera android application
 
FIANL REPORT
FIANL REPORTFIANL REPORT
FIANL REPORT
 
Voice controlled spy robot for security system
Voice controlled spy robot for security systemVoice controlled spy robot for security system
Voice controlled spy robot for security system
 
Pankaj project report
Pankaj project reportPankaj project report
Pankaj project report
 
Bluetooth Controlled Robocar Using PIC 16f887
Bluetooth Controlled Robocar Using PIC 16f887Bluetooth Controlled Robocar Using PIC 16f887
Bluetooth Controlled Robocar Using PIC 16f887
 
Android Controlled Arduino Spy Robot
Android Controlled Arduino Spy RobotAndroid Controlled Arduino Spy Robot
Android Controlled Arduino Spy Robot
 
Project_report_voice_controlling_robot
Project_report_voice_controlling_robotProject_report_voice_controlling_robot
Project_report_voice_controlling_robot
 
Presentation IOT Robot
Presentation IOT RobotPresentation IOT Robot
Presentation IOT Robot
 

Viewers also liked

Victory Over Neck And Back Pain Dr Shriniwas Kashalikar
Victory Over Neck And Back Pain  Dr Shriniwas KashalikarVictory Over Neck And Back Pain  Dr Shriniwas Kashalikar
Victory Over Neck And Back Pain Dr Shriniwas Kashalikar
subodhnagwekar
 
Quick start guide_virtualization_uk_a4_online_2021-uk
Quick start guide_virtualization_uk_a4_online_2021-ukQuick start guide_virtualization_uk_a4_online_2021-uk
Quick start guide_virtualization_uk_a4_online_2021-uk
Assespro Nacional
 
Cirugía Bucomaxilofacial
Cirugía BucomaxilofacialCirugía Bucomaxilofacial
Cirugía Bucomaxilofacial
David Tantalean
 
TIME Magazine Cover Portrait (Paintings)
TIME Magazine Cover Portrait (Paintings)TIME Magazine Cover Portrait (Paintings)
TIME Magazine Cover Portrait (Paintings)
maditabalnco
 
History week 4
History week 4History week 4
History week 4
whermina
 
Loodusmustridd
LoodusmustriddLoodusmustridd
Loodusmustridd
kadriart
 

Viewers also liked (20)

Mechanical can crusher
Mechanical can crusherMechanical can crusher
Mechanical can crusher
 
Can crusher file by Rohit Dhiman
Can crusher file by Rohit DhimanCan crusher file by Rohit Dhiman
Can crusher file by Rohit Dhiman
 
Alcohol Sensing Alert with Engine Locking Project
Alcohol Sensing Alert with Engine Locking ProjectAlcohol Sensing Alert with Engine Locking Project
Alcohol Sensing Alert with Engine Locking Project
 
Microcontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken driversMicrocontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken drivers
 
Bluetooth Controlled Robot/Car
Bluetooth Controlled Robot/CarBluetooth Controlled Robot/Car
Bluetooth Controlled Robot/Car
 
Victory Over Neck And Back Pain Dr Shriniwas Kashalikar
Victory Over Neck And Back Pain  Dr Shriniwas KashalikarVictory Over Neck And Back Pain  Dr Shriniwas Kashalikar
Victory Over Neck And Back Pain Dr Shriniwas Kashalikar
 
Quick start guide_virtualization_uk_a4_online_2021-uk
Quick start guide_virtualization_uk_a4_online_2021-ukQuick start guide_virtualization_uk_a4_online_2021-uk
Quick start guide_virtualization_uk_a4_online_2021-uk
 
Introduccion a Jasmin
Introduccion a JasminIntroduccion a Jasmin
Introduccion a Jasmin
 
Statues
StatuesStatues
Statues
 
Cirugía Bucomaxilofacial
Cirugía BucomaxilofacialCirugía Bucomaxilofacial
Cirugía Bucomaxilofacial
 
TIME Magazine Cover Portrait (Paintings)
TIME Magazine Cover Portrait (Paintings)TIME Magazine Cover Portrait (Paintings)
TIME Magazine Cover Portrait (Paintings)
 
Step 5 Templates
Step 5 TemplatesStep 5 Templates
Step 5 Templates
 
TestIstanbul May 2013 Keynote Experiences With Exploratory Testing
TestIstanbul May 2013 Keynote Experiences With Exploratory TestingTestIstanbul May 2013 Keynote Experiences With Exploratory Testing
TestIstanbul May 2013 Keynote Experiences With Exploratory Testing
 
Gge presentation
Gge presentationGge presentation
Gge presentation
 
Green computing
Green computingGreen computing
Green computing
 
Istilah teknologi komunkasi kl4 9 d
Istilah teknologi komunkasi  kl4 9 dIstilah teknologi komunkasi  kl4 9 d
Istilah teknologi komunkasi kl4 9 d
 
History week 4
History week 4History week 4
History week 4
 
Presentación1
Presentación1Presentación1
Presentación1
 
Happy birthday my bitch
Happy birthday my bitchHappy birthday my bitch
Happy birthday my bitch
 
Loodusmustridd
LoodusmustriddLoodusmustridd
Loodusmustridd
 

Similar to pdfreport

Wireless industrial robot
Wireless  industrial robotWireless  industrial robot
Wireless industrial robot
Varun B P
 

Similar to pdfreport (20)

PC-based mobile robot navigation sytem
PC-based mobile robot navigation sytemPC-based mobile robot navigation sytem
PC-based mobile robot navigation sytem
 
International Journal of Computational Engineering Research (IJCER)
International Journal of Computational Engineering Research (IJCER) International Journal of Computational Engineering Research (IJCER)
International Journal of Computational Engineering Research (IJCER)
 
Smart phone based robotic control for surveillance applications
Smart phone based robotic control for surveillance applicationsSmart phone based robotic control for surveillance applications
Smart phone based robotic control for surveillance applications
 
Smart phone based robotic control for surveillance applications
Smart phone based robotic control for surveillance applicationsSmart phone based robotic control for surveillance applications
Smart phone based robotic control for surveillance applications
 
Spook Robi
Spook RobiSpook Robi
Spook Robi
 
Bauldree_Hui_ATAV_Report
Bauldree_Hui_ATAV_ReportBauldree_Hui_ATAV_Report
Bauldree_Hui_ATAV_Report
 
Sensor based motion control of mobile car robot
Sensor based motion control of mobile car robotSensor based motion control of mobile car robot
Sensor based motion control of mobile car robot
 
Sensorbased 150315123850-conversion-gate01
Sensorbased 150315123850-conversion-gate01Sensorbased 150315123850-conversion-gate01
Sensorbased 150315123850-conversion-gate01
 
Ieee embedded 2015_16
Ieee embedded  2015_16Ieee embedded  2015_16
Ieee embedded 2015_16
 
Report
ReportReport
Report
 
IRJET- Simultaneous Localization and Mapping for Automatic Chair Re-Arran...
IRJET-  	  Simultaneous Localization and Mapping for Automatic Chair Re-Arran...IRJET-  	  Simultaneous Localization and Mapping for Automatic Chair Re-Arran...
IRJET- Simultaneous Localization and Mapping for Automatic Chair Re-Arran...
 
Machine Vision Based Fire Flame Detection using Multi Features
Machine Vision Based Fire Flame Detection using Multi FeaturesMachine Vision Based Fire Flame Detection using Multi Features
Machine Vision Based Fire Flame Detection using Multi Features
 
H011114758
H011114758H011114758
H011114758
 
High-Speed Neural Network Controller for Autonomous Robot Navigation using FPGA
High-Speed Neural Network Controller for Autonomous Robot Navigation using FPGAHigh-Speed Neural Network Controller for Autonomous Robot Navigation using FPGA
High-Speed Neural Network Controller for Autonomous Robot Navigation using FPGA
 
Design and Implementation of a Real Time Obstacle Avoiding Subsumption Contro...
Design and Implementation of a Real Time Obstacle Avoiding Subsumption Contro...Design and Implementation of a Real Time Obstacle Avoiding Subsumption Contro...
Design and Implementation of a Real Time Obstacle Avoiding Subsumption Contro...
 
Content server
Content serverContent server
Content server
 
HUMAN FOLLOWING SUITCASE.pptx
HUMAN FOLLOWING SUITCASE.pptxHUMAN FOLLOWING SUITCASE.pptx
HUMAN FOLLOWING SUITCASE.pptx
 
Wireless industrial robot
Wireless  industrial robotWireless  industrial robot
Wireless industrial robot
 
Wireless industrial robot
Wireless  industrial robotWireless  industrial robot
Wireless industrial robot
 
IRJET- Hampered Serving Bot
IRJET-  	  Hampered Serving BotIRJET-  	  Hampered Serving Bot
IRJET- Hampered Serving Bot
 

pdfreport

  • 1. Monitoring robot using GPRS and Bluetooth Department of ECE 1 H.K.B.K.C.E CHAPTER 1 INTRODUCTION The robot manipulator has been an essential tool for the development of the automated industry. In the near future these robots will be accompanied by intelligent mobile robots that will assist us in many different areas, including transportation, cleaning, mining photography or agriculture. Such intelligent robots incorporate increased flexibility and need the ability to plan their actions and to execute them in a safe way. In order to operate in a changing and partially unpredictable environment, these robots also need the ability to detect when the execution does not proceed as planned, and to correctly identify the causes of the failure. An execution monitoring system is a system that allows the robot to detect and classify these failures. 1.1Proposed System: Server-Side: The server PC is designed to monitor the place by viewing the video being streamed from the mobile. The server has the privilege to move the robot remotely i.e. left, right, front and back to have the person in focus. The PIR could also be controlled by turning it on/off. Client-Side: At the client end, the Android C++ is responsible for the communication between the robot and the mobile through Bluetooth. There is an option for controlling the PIR sensor i.e. to turn on/off. The PIR sensor senses for any motion in the affected area and when the motion is detected, the PC is intimated by the mobile through socket communication as well as starts capturing the images. The mobile streams the video to the server such that the robot can be moved in all the directions i.e. front, back, left and right to monitor the place as well as to focus to view the status of the alive person.
  • 2. Monitoring robot using GPRS and Bluetooth Department of ECE 2 H.K.B.K.C.E 1.2 Project requirements: 1.2.1 Hardware Requirements  Smart phone with Android OS and Bluetooth enabled  ULN 2003A  Bluetooth  DC Motor  PIC Micro controller  Relays  PIR Sensor 1.2.2 Software Requirements  JDK 1.6 or above  Android Operating System(GPRS enabled)  Android emulator  Android Bluetooth  Wireless Tool Kit 2.5.2  Embedded C  MPLAB 1.2.3 PC Requirements  PIII Processor  40GB HDD  256MB RAM
  • 3. Monitoring robot using GPRS and Bluetooth Department of ECE 3 H.K.B.K.C.E 1.3 Block Diagram: Socket Communication(GPRS) 1.3.1 Detailed Block diagram Figure 1.1 block diagram of proposed project BT Enabled android OS cell PC BT Communication PIRSensor Blue tooth Module PIC Controller Cell Phone modem Driver unit for MotorRobot Wheels PIR Sensor PC
  • 4. Monitoring robot using GPRS and Bluetooth Department of ECE 4 H.K.B.K.C.E CHAPTER 2 OVERVIEW ON ROBOTICS 2.1 Introduction The Robot Institute of America defines a robot as a programmable, multifunctional manipulator designed to move material, parts, tools, or specialized devices, through variable programmed motions, for the performance of a variety of tasks.It can also be defined as an electro-mechanical contraption that is designed for performing a certain task or a certain set of tasks repeatedly without fail. The chief feature of robots that distinguishes them from purely mechanical or purely electronic devices is in the property of self-locomotion, limited intelligence, and in the element of automation built into them. Robotics means the study and application of robot technology.The Merriam Webster Dictionary, 1998, defines Robotics as ―technology dealing with the design, construction, and operation of robots‖. It is a fast emerging technology which is a merging point of many diverse fields of Science such as Electronics, Electrical, Computers, Mechanicals,and Material Science etc and has been hugely responsible for domestic and industrial automation revolution. Because of rapid change in the industries requirements of performance and speed, with the progression towards the 21st century, the current state automation is being fast replaced by Robotization.
  • 5. Monitoring robot using GPRS and Bluetooth Department of ECE 5 H.K.B.K.C.E 2.2 Types of Robots There are different types of robot that are widely used nowadays for variety of applications. Some of them are: 1. Mobile Robots A mobile robot is a machine which can move as a whole in a controlled way with some degree of autonomy. A mobile robot‘s possible motions can be analyzed in terms of degree of freedom: it may fly or float in three-dimensional medium or it may be confined to a follow a surface or it may be confined to a track or pipe. Most mobile robots so far, like land vehicles in general, have used wheels since this is the simplest method of locomotion. 2. Pick and place manipulator Pick and place manipulator or limited sequence manipulators, use mechanical stops to set two stopping positions on each axis. The joint must travel backwards and forwards between these two end stops, whose positions can be adjusted when the machine is set up. They are fast and relatively cheap. They are limited to transfer of parts from one place to another. 3. Point to point robots Point to point robots have servo positions control of each axis and can go through a sequence of specified points. The path between these points is unspecified. There can be any number of stopping positions in each axis. The program for such a robot consists of a series of points; for each point all the joint angles must be specified. It is really just a pick and place machine with arbitrarily large number of programmable positions. 4. Continuous path robots Continuous path robots do not go through a finite list of target points but can, ideally, execute a smooth path of any shape, with continuous variation of speed as the arm moves along the path. This requires not only servo control of the velocity of each joint but that several joints move at once in a coordinated way, whereas for a point to point robot it is possible ,although not compulsory, to move one joint at a time.
  • 6. Monitoring robot using GPRS and Bluetooth Department of ECE 6 H.K.B.K.C.E 2.3 Overview of Mobile Robots As a result a brief overview on the concepts of mobile robot is mentioned here which includes arrangement of wheels, navigation for land vehicles, route planning and control and coordination. Figure 2.1 Mobile Robot  ARRANGEMENTS OF WHEELS AND TRACKS There are three fundamental ways of steering a wheeled or tracked vehicle by ground reaction and they need two wheels. - In the least restricted way all the wheels or tracks can be turned together or differentially, resulting in translational or rotational motion or a combination. Such a vehicle can rotate about its own center. Three wheels are often are used. - The second way, used by caterpillar tractors and some AGV‘s, is differential steering of a pair of fixed wheels or tracks. Again it allows rotation on the spot but the vehicle cannot move sideways. - The third way it to pivot on wheel or group of wheels while others remain fixed. This method is used by cars and bicycles. This arrangement is rarely found in robots as turned around in a confined space or passing through a narrow gap tends to need complex back-and-forth manoeurving.
  • 7. Monitoring robot using GPRS and Bluetooth Department of ECE 7 H.K.B.K.C.E  NAVIGATION FOR LAND VEHICLES Navigation is used here to mean determining the position of a mobile robot. It is sometimes defined to include route planning and following. There are many possible methods, some of which are listed below: - Tele-operation If the operator can see the vehicle directly or see its surroundings through an on-board television camera, the robot need have no autonomous ability. - Dead reckoning Odometry (travelled- distance measurement) by counting the wheel revolution together with direction finding using a magnetometer or gyrocompass, or differential wheel rotation, is often used for wheeled indoor robots. Dead reckoning is of little use on rough ground except as a coarse or emergency method. - Tracking from a fixed base Triangulation using radar, optical or acoustic methods can be used to locate the vehicle relative to fixed stations and the information can be transmitted to the vehicle. A related technique is for the radar or other sensor to be on the vehicle and to detect beacons which may be lights, reflectors or transponders. - Satellite navigation The equipment for a satellite navigation system, which uses radio transponders to measure the distance to satellites of accurately known position, is small enough to fit to some larger mobile robots.
  • 8. Monitoring robot using GPRS and Bluetooth Department of ECE 8 H.K.B.K.C.E  ROUTE PLANNING Assuming that the problem of navigation can be solved, a mobile robot, except when teleported, must work out a route to its current destination. Route planning can be regarded as a branch of Artificial Intelligence.  CONTROL AND COMMUNICATION Mobile robots generally have a hierarchical control structure in which on- board software handles the lowest levels such as interrogating sensors and driving motors, and often the intermediate levels such as following a path or even planning a route. The highest level of control is often remote control by human operator. In this case the on-board software must be able to receive commands by radio or some other link and to carry them out, maintaining a safe course of action even when communication is interrupted. Communication is usually by radio, infrared or cable. Each has its problem. A cable can become entangled, limits range and imposes drag, but is cheap and simple and is sometimes useful as a way of pulling the robot out of a dangerous place if its own mobility fails. If radio is used it may need bandwidth for television signals, and so it has to be ultrahigh frequency or microwave and there may be legal restrictions on its use and problems of obstruction and interference. An antenna pointing mechanism may be necessary. Infrared is strictly a line-of-sight method and so is even more prone to obstruction than radio, but is immune to most forms of interference. A combination of methods is needed for the highest reliability.
  • 9. Monitoring robot using GPRS and Bluetooth Department of ECE 9 H.K.B.K.C.E 2.4 Applications of Mobile Robots The correlation between the applications and the physical forms of mobile robots is not perfect, but for most applications only one or two physical types are common. This section lists the main application of robot surface vehicles and in each case describes the types of robot used.  Education and Research – Mobile robots such as turtle types connected as peripherals to microcomputers are used to enliven the teaching of programming, of computer principles, and of elementary geometry and other aspects of mathematics.  Remote Handling – Mobile robots for remote handling of radioactive, explosive and other dangerous materials are generally teleoperated. They have been built with internal combustion engines for long-endurance outdoor use, but most are electric, powered by batteries.  Military Mobile Robots – These robots are currently being designed around multi- wheeled (six being common) chassis, or with tracks. These robots will have to able to recognize targets, threats and friendly units.  Fire- fighting and Rescue – Robots are potentially attractive for inspecting dangerous areas in fire and for providing a fire-proof vehicle which can be sent through a fire to rescue people.  Construction – Legged robots for surveying the sea- bed in preparation for bridge construction has been proposed.  The use of mobile robot in the mining activity and planetary exploration has been proposed such as mine clearance, as decoys etc.
  • 10. Monitoring robot using GPRS and Bluetooth Department of ECE 10 H.K.B.K.C.E 2.5 Advantages of Mobile robots Speed – These robots can process information much more quickly than humans. This means they are good for controlling machinery that might need to be adjusted instantly. Repetition – Mobile robots are automated systems that can do the same task over and over again without getting bored, needing breaks or making mistakes. Accuracy – These robots can do very detailed work and follow precise instructions without error. Safety – Mobile robots can work in places where it would be unsafe to put a human, for example, in a nuclear power plant, under water or in space. Efficiency - They get more done than humans but cost less to operate. This is because they do not need breaks, wages, holidays, canteens, heating and lighting. The quality of the work done is always of the same standard being materials are not wasted due to human error. Adaptability - Automated systems can be reprogrammed to do different tasks. For example, the Survobot is performing subdivision of plots with a constraint of 3 inches, as a result of which it can be at present used for small area calculations. It can be reprogrammed for bigger area calculation as well. So we understood how advantageous mobile robots are present day scenario.
  • 11. Monitoring robot using GPRS and Bluetooth Department of ECE 11 H.K.B.K.C.E CHAPTER 3 LITERATURE SURVEY The definition we have chosen for a ―robot‖ requires the device to obtain data about its environment, make a decision, and then take action accordingly. This does not exclude the option of a robot being semi-autonomous (having aspects which are controlled by a human and others which it does on its own). A good example of this is a sophisticated underwater robot; a human controls the basic movements of the robot while an on-board processor measures and reacts to underwater currents in order to keep the robot in the same position without drifting. A camera onboard the robot sends video back to the human while onboard sensors may track the water temperature, pressure and more. If the robot loses communication with the surface, an autonomous program may kick-in causing it to surface. If you want to be able to send and/or receive commands from your robot, you will need to determine its level of autonomy and if you want it to be tethered, wireless or fully autonomous. 3.1 Tethered 3.1.1Direct Wired Control The easiest way to control a vehicle is with a handheld controller physically connected to the vehicle using a cable (i.e. a tether). Toggle switches, knobs, levers, joysticks and buttons on this controller allow the user to control the vehicle without the need to incorporate complex electronics. In this situation, the motors and a power source can be connected directly with a switch in order to control its forward/backwards rotation. Such vehicles usually have no intelligence and are considered to be more ―remote controlled machines‖ than ―robots‖. Figure 3.1 direct wired control
  • 12. Monitoring robot using GPRS and Bluetooth Department of ECE 12 H.K.B.K.C.E Advantages  The robot is not limited to an operating time since it can be connected directly to the mains  There is no worry about loss of signal  Minimal electronics and minimal complexity  The robot itself can be light weight or have added payload capacity  The robot can be physically retrieved if something goes wrong (very important for underwater robots) Disadvantages  The tether can get caught or snagged (and potentially cut)  Distance is limited by the length of the tether  Dragging a long tether adds friction and can slow or even stop the robot from moving. 3.1.2 Wired computer control The next step is to incorporate a microcontroller into the vehicle but continue to use a tether. Connecting the microcontroller to one of your computer‘s I/O ports (e.g. a USB port) allows you to control its actions using a keyboard (or keypad), joystick or other peripheral device. Adding a microcontroller to a project also may require you to program how the robot reacts to the input. Instead of using a laptop or desktop computer, netbooks are often a desirable choice because of their low price, small size and low weight. Figure 3.2 wired computer control
  • 13. Monitoring robot using GPRS and Bluetooth Department of ECE 13 H.K.B.K.C.E Advantages  Same advantages as with direct wired control  More complex behaviors can be programmed or mapped to single buttons or commands.  Larger controller choice (mouse, keyboard, joystick, etc.)  Added onboard intelligence means it can interface with sensors and make certain decisions on its own Disadvantages  Cost is higher than a purely tethered robot because of the added electronics  Same disadvantages as with direct wired control. 3.1.3 Ethernet A variation on computer control would be to use an Ethernet interface. A robot that is physically connected to a router (so it could be controlled via the Internet) is also possible (though not very practical) for mobile robots. Setting-up a robot that can communicate using the internet can be fairly complex, and more often than not, a WiFi (wireless internet) connection is preferable. A wired and wireless combination is also an option, where there is a transceiver (transmit and receive) connected physically to the internet and data received via the internet is then sent wirelessly to the robot. Figure 3.3 Ethernet
  • 14. Monitoring robot using GPRS and Bluetooth Department of ECE 14 H.K.B.K.C.E Advantages  Robot can be controlled through the Internet from anywhere in the world  The robot is not limited to an operating time since it could use Power over Ethernet (PoE).  Using Internet Protocol (IP) can simplify and improve the communication scheme.  Same advantages as with direct wired computer control Disadvantages  Programming involved is more complex  The tether can get caught or snagged (and potentially cut)  Distance is limited by the length of the tether  Dragging a long tether adds friction and can slow or even stop the robot from moving. 3.2 Wireless 3.2.1 Infrared Infrared transmitters and receivers cut the cables connecting the robot to the operator. This is usually a milestone for beginners. Infrared control requires ―line of sight‖ in order to function; the receiver must be able to ―see‖ the transmitter at all times in order to receive data. Infrared remote controls (such as universal remote controls for televisions) are used to send commands to an infrared receiver connected to a microcontroller which then interprets these signals and controls the robot‘s actions. Figure 3.4 Infrared
  • 15. Monitoring robot using GPRS and Bluetooth Department of ECE 15 H.K.B.K.C.E Advantages  Low cost  Simple TV remote controls can be used as controllers Disadvantages  Needs to be line of sight  Distance is limited. 3.2.2 Radio Frequency (RF) Commercially available Remote Control (R/C) units use small microcontrollers in the transmitter and receiver to send, receive and interpret data sent via radio frequency (RF). RF communication requires either a transmitter matched/paired with a receiver, or a transceiver (which can both send and receive data). RF does not require line of sight and can also offer significant range (transmission distance). Standard radio frequency devices can allow for data transfer between devices as far away as several kilometers and there is seemingly no limit to the range for more professional RF units. XBee and Zigbee modules use RF for communication, but allow the user to vary many of the communication parameters involved. These modules have a specific footprint (layout) and are only produced by certain companies. Their main advantage is that they provide a very robust easy to set up link and take care of all of the communication protocol details. Many robot builders choose to make semi-autonomous robots with RF capability since it allows the robot to be as autonomous as possible, provide feedback to a user and still give the user some control over some of its functions should the need arise. Figure 3.5 Radio Frequency(RF)
  • 16. Monitoring robot using GPRS and Bluetooth Department of ECE 16 H.K.B.K.C.E Advantages  Considerable distances possible  Setup can be straightforward  Omni directional (impeded but not entirely blocked by walls and obstructions) Disadvantages  Very low data rate (simple commands only)  Pay attention to the transmission frequencies – they can be shared. 3.2.3 Bluetooth Bluetooth is a form of RF and follows specific protocols for sending and receiving data. Normal Bluetooth range is often limited to about 10m though it does have the advantage of allowing users to control their robot via Bluetooth-enabled devices such as cell-phones, PDAs and laptops (though custom programming may be required to create an interface). Just like RF, Bluetooth offers two-way communication. Figure 3.6 Bluetooth Advantages  Controllable from any Bluetooth enabled device (usually additional programming is necessary) such as a Smartphone, laptop, desktop etc.  Higher data rates possible  Omnidirectional (does not need line of sight and can travel a little through walls)
  • 17. Monitoring robot using GPRS and Bluetooth Department of ECE 17 H.K.B.K.C.E Disadvantages  Devices need to be ―paired‖  Distance is usually about 10m (without obstructions). 3.2.4 WiFi WiFi is now an option for robots; being able to control a robot wirelessly via the internet presents some significant advantages (and some drawbacks) to wireless control. In order to set up a WiFi robot, you need a wireless router connected to the internet and a WiFi unit on the robot itself. For the robot, you can also use a device that is TCP/IP enabled with a wireless router. Figure 3.7 WiFi Advantages  Controllable from anywhere in the world so long as it is within range of a wireless router  High data rates possible Disadvantages  Added programming required  Maximum range is usually determined by the choice of wireless router
  • 18. Monitoring robot using GPRS and Bluetooth Department of ECE 18 H.K.B.K.C.E 3.2.5 GPRS / Cellular Another wireless technology that was originally developed for human to human communication, the cell phone, is now being used to control robots. Since cellular frequencies are regulated, incorporating a cellular module on a robot usually requires added patience for programming as well as an understanding of the cellular network system and the regulations. Figure 3.8 GPRS enabled mobile phone Advantages  Robot can be controlled anywhere it has a cellular signal  Direct satellite connection is possible Disadvantages  Setup and configuration can be complex – NOT for beginners  Each network has its own requirements / restrictions  Cellular service is not free; usually the more data you transmit/receive the more money you will need to pay.  System is not (yet) well setup for robotics use.
  • 19. Monitoring robot using GPRS and Bluetooth Department of ECE 19 H.K.B.K.C.E CHAPTER 4 PIC16F87X PIC is a family ofmodified Harvard architecturemicrocontrollers made by Microchip Technology, derived from the PIC1650 originally developed byGeneral Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller". PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re-programming with flash memory) capability. They are also commonly used in educational programming as they often come with the easy to use 'pic logicator' software. 4.1 Core architecture The PIC architecture is characterized by its multiple attributes:  Separate code and data spaces (Harvard architecture).  A small number of fixed length instructions  Most instructions are single cycle execution (2 clock cycles, or 4 clock cycles in 8-bit models), with one delay cycle on branches and skips  One accumulator (W0), the use of which (as source operand) is implied (i.e. is not encoded in the opcode)  All RAM locations function as registers as both source and/or destination of math and other functions.  A hardware stack for storing return addresses  A small amount of addressable data space (32, 128, or 256 bytes, depending on the family), extended through banking  Data space mapped CPU, port, and peripheral registers
  • 20. Monitoring robot using GPRS and Bluetooth Department of ECE 20 H.K.B.K.C.E  ALU status flags are mapped into the data space  The program counter is also mapped into the data space and writable (this is used to implement indirect jumps). There is no distinction between memory space and register space because the RAM serves the job of both memory and registers, and the RAM is usually just referred to as the register file or simply as the registers. Data space (RAM) PICs have a set of registers that function as general purpose RAM. Special purpose control registers for on-chip hardware resources are also mapped into the data space. The addressability of memory varies depending on device series, and all PIC devices have some banking mechanism to extend addressing to additional memory. Later series of devices feature move instructions which can cover the whole addressable space, independent of the selected bank. In earlier devices, any register move had to be achieved via the accumulator. To implement indirect addressing, a "file select register" (FSR) and "indirect register" (INDF) are used. A register number is written to the FSR, after which reads from or writes to INDF will actually be to or from the register pointed to by FSR. Later devices extended this concept with post- and pre- increment/decrement for greater efficiency in accessing sequentially stored data. This also allows FSR to be treated almost like a stack pointer (SP). External data memory is not directly addressable except in some high pin count PIC18 devices. Code space The code space is generally implemented as ROM, EPROM or flash ROM. In general, external code memory is not directly addressable due to the lack of an external memory interface. The exceptions are PIC17 and select high pin count PIC18 devices. Word size All PICs handle (and address) data in 8-bit chunks. However, the unit of addressability of the code space is not generally the same as the data space. For example, PICs in the baseline (PIC12) and mid-range (PIC16) families have program memory addressable in the same word size as the
  • 21. Monitoring robot using GPRS and Bluetooth Department of ECE 21 H.K.B.K.C.E instruction width, i.e. 12 or 14 bits respectively. In contrast, in the PIC18 series, the program memory is addressed in 8-bit increments (bytes), which differ from the instruction width of 16 bits. Stacks PICs have a hardware call stack, which is used to save return addresses. The hardware stack is not software accessible on earlier devices, but this changed with the 18 series devices. Hardware support for a general purpose parameter stack was lacking in early series, but this greatly improved in the 18 series, making the 18 series architecture more friendly to high level language compilers. Figure 4.1 Pin Diagram PIC16F877
  • 22. Monitoring robot using GPRS and Bluetooth Department of ECE 22 H.K.B.K.C.E 4.2 Peripheral Features: • Timer0: 8-bit timer/counter with 8-bit prescaler • Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external Crystal/clock • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler • Two Capture, Compare, PWM modules - Capture is 16-bit, max. Resolution is 12.5 ns - Compare is 16-bit, max. Resolution is 200 ns - PWM max. Resolution is 10-bit • 10-bit multi-channel Analog-to-Digital converter • Synchronous Serial Port (SSP) with SPI (Master mode) and I2C (Master/Slave) • Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address Detection • Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls (40/44-pin only) • Brown-out detection circuitry for Brown-out Reset (BOR). 4.3Instruction set A PIC's instructions vary from about 35 instructions for the low-end PICs to over 80 instructions for the high-end PICs. The instruction set includes instructions to perform a variety of operations on registers directly, the accumulator and a literal constant or the accumulator and a register, as well as for conditional execution, and program branching. Some operations, such as bit setting and testing, can be performed on any numbered register, but bi-operand arithmetic operations always involve W (the accumulator), writing the result back to either W or the other operand register. To load a constant, it is necessary to load it into W before it can be moved into another register. On the older cores, all register moves needed to pass through W, but this changed on the "high end" cores.
  • 23. Monitoring robot using GPRS and Bluetooth Department of ECE 23 H.K.B.K.C.E PIC cores have skip instructions which are used for conditional execution and branching. The skip instructions are 'skip if bit set' and 'skip if bit not set'. Because cores before PIC18 had only unconditional branch instructions, conditional jumps are implemented by a conditional skip (with the opposite condition) followed by an unconditional branch. Skips are also of utility for conditional execution of any immediate single following instruction. It is possible to skip skip instructions. For example, the instruction sequence "skip if A; skip if B; C" will execute C if A is true or if B is false. The 18 series implemented shadow registers which save several important registers during an interrupt, providing hardware support for automatically saving processor state when servicing interrupts. In general, PIC instructions fall into 5 classes: 1. Operation on working register (WREG) with 8-bit immediate ("literal") operand. E.g. movlw (move literal to WREG), andlw (AND literal with WREG). One instruction peculiar to the PIC isretlw, load immediate into WREG and return, which is used with computed branches to produce lookup tables. 2. Operation with WREG and indexed register. The result can be written to either the Working register Bit operations. These take a register number and a bit number, and perform one of 4 actions: set or clear a bit, and test and skip on set/clear. The latter are used to perform conditional branches. The usual ALU status flags are available in a numbered register so operations such as "branch on carry clear" are possible. 3. Control transfers. Other than the skip instructions previously mentioned, there are only two: goto and call. 4. A few miscellaneous zero-operand instructions, such as return from subroutine, and sleep to enter low-power mode.
  • 24. Monitoring robot using GPRS and Bluetooth Department of ECE 24 H.K.B.K.C.E 4.4Performance The architectural decisions are directed at the maximization of speed-to-cost ratio. The PIC architecture was among the first scalar CPU designs,and is still among the simplest and cheapest. The Harvard architecture—in which instructions and data come from separate sources— simplifies timing and microcircuit design greatly, and this benefits clock speed, price, and power consumption. The PIC instruction set is suited to implementation of fast lookup tables in the program space. Such lookups take one instruction and two instruction cycles. Many functions can be modeled in this way. Optimization is facilitated by the relatively large program space of the PIC (e.g. 4096 × 14-bit words on the 16F690) and by the design of the instruction set, which allows for embedded constants. For example, a branch instruction's target may be indexed by W, and execute a "RETLW" which does as it is named - return with literal in W. Interrupt latency is constant at three instruction cycles. External interrupts have to be synchronized with the four clock instruction cycle, otherwise there can be a one instruction cycle jitter. Internal interrupts are already synchronized. The constant interrupt latency allows PICs to achieve interrupt driven low jitter timing sequences. An example of this is a video sync pulse generator. This is no longer true in the newest PIC models, because they have a synchronous interrupt latency of three or four cycles.
  • 25. Monitoring robot using GPRS and Bluetooth Department of ECE 25 H.K.B.K.C.E 4.5Advantages The PIC architectures have these advantages:  Small instruction set to learn  RISC architecture  Built in oscillator with selectable speeds  Easy entry level, in circuit programming plus in circuit debugging PICKit units available for less than $50  Inexpensive microcontrollers  Wide range of interfaces including I²C, SPI, USB, USART, A/D, programmable comparators, PWM, LIN, CAN, PSP, and Ethernet.  Availability of processors in DIL package makes them easy to handle for hobby use. 4.6Limitations The PIC architectures have these limitations:  One accumulator  Register-bank switching is required to access the entire RAM of many devices  Operations and registers are not orthogonal; some instructions can address RAM and/or immediate constants, while others can only use the accumulator
  • 26. Monitoring robot using GPRS and Bluetooth Department of ECE 26 H.K.B.K.C.E CHAPTER 5 HARDWARE COMPONENTS 5.1 ULN2003 ULN2003 is a high voltage, high current Darlingtonarrays each containing seven open collector Darlingtonpairswithcommon emitters.Each channelisrated at 500mA and can withstand peak currents of600mA.These versatile devicesare useful for driving a widerange of loads including solenoids, relays DC motors, LED displays filament lamps, thermal printheadsand high power buffers. Figure 5.1: ULN2003 Figure 5.2 Pin diagram ULN2003
  • 27. Monitoring robot using GPRS and Bluetooth Department of ECE 27 H.K.B.K.C.E 5.2 Relay A relay is an electrically controllable switch widely used in industrial controls, automobiles and appliances. It allows the isolation of two separate sections of a system with two different voltage sources. For instance, a 5V system can be isolated from a 120V system by placing a relay between them. One such relay is called an eletromechanical relay (EMR). The EMR have 3 components: the coil, spring and contacts. When current flows through the coil, a magnetic field is created around the coil (the coil is energized), which causes the armature to be attracted to the coil. The armatures contact acts like a switch and closes or opens the circuit. When the coil is not energized, a spring pulls the armature to its normal state of open or closed. There are different types of relays:  Single Pole Single Throw (SPST): These have two terminals which can be connected or disconnected. Including two for the coil, such a relay has four terminals in total. It is ambiguous whether the pole is normally open or normally closed. The terminology "SPNO" and "SPNC" is sometimes used to resolve the ambiguity.  Single Pole Double Throw (SPDT): A common terminal connects to either of two others. Including two for the coil, such a relay has five terminals in total.  Double Pole Double Throw (DPDT): These have two pairs of terminals are equivalent to two SPST switches or relays actuated by a single coil. Including two for the coil, such a relay has six terminals in total. The poles may be Form A or Form B (or one of each).  Double Pole Single Throw (DPDT): These have two rows of change-over terminals. Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has eight terminals, including the coil. Figure 5.3 Circuit symbols of relay
  • 28. Monitoring robot using GPRS and Bluetooth Department of ECE 28 H.K.B.K.C.E In choosing a relay the following characteristics used to be considered:  The contacts can be normally open (NO) or normally closed (NC). In the NC type, the contacts are closed when the coil is not energized. In the NO, the contacts are open when the coil is not energized.  There can be one or more contacts: SPST, SPDT, DPST and DPDT.  Voltage and current are needed to energize the coil. The voltage can vary from a few volts to 50V, while the current can be a few mA to 20mA. The relay has a minimum voltage is called the pull in voltage.  The maximum DC/AC voltage and current that can be handled by the contacts. This is in the range of a few volts to hundreds of volts depending on the relay. 5.2.1 To drive a relay Digital systems and microcontroller pins lack sufficient current to drive the relay. While the relay‘s coil needs around 10mA to be energized, the microcontroller‘s pin can provide a maximum of 1-2mA current. For this reason, we place a driver such as the ULN2803 between the µC and the relay. 5.2.2 Operation When a current flows through the coil, the resulting magnetic field attracts an armature that is mechanically linked to a moving contact. The movement either makes or breaks a connection with a fixed contact. When the current to the coil is switched off, the armature is returned by a force approximately half as strong as the magnetic force to its relaxed position. Usually this is a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a low voltage application, this is to reduce noise. In a high voltage or high current application, this is to reduce arcing.
  • 29. Monitoring robot using GPRS and Bluetooth Department of ECE 29 H.K.B.K.C.E Figure 5.4 Circuit diagram of relay If the coil is energized with DC, a diode is frequently installed across the coil, to dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise generate a spike of voltage and might cause damage to circuit components. Some automotive relays already include that diode inside the relay case. If the coil is designed to be energized with AC, a small copper ring can be crimped to the end if the solenoid. This ―shading ring‖ creates a small out-of- phase current, which increases the minimum pull on the armature during the AC cycle. By analogy with the functions of the original electromagnetic device, a solid-state relay is made with a thyristor or other solid-state switching device. To achieve electrical isolation, a light-emitting diode (LED) is used with a photo transistor.
  • 30. Monitoring robot using GPRS and Bluetooth Department of ECE 30 H.K.B.K.C.E 5.3 DC motor A DC motor is an electric motor that runs on DC current. The working of a geared DC motor is similar to that of a DC motor, with a difference that geared DC motor gives a more controlled RPM and more torque. In any electric motor, operation is based on simple electromagnetism. A current carrying conductor generates a magnetic field, when this is then placed in an external magnetic field, it will experience a force proportional to the current in the conductor, and to the strength of the external magnetic field. The internal configuration is designed to harness the magnetic interaction between a current carrying conductor and an external magnetic field to generate a rotational motion. Figure 5.5 Schematic diagram of a DC motor Every DC motor has six parts – axle, rotor, stator, commutator, field magnets, and brushes. In most common DC motors, the external magnetic field is produced by high strength permanent magnets. The stator is the stationary part of the motor which is includes the motor casing as well as two or more permanent magnet pole pieces. The rotor rotates with respect to the stator. The rotor consists of windings, the windings being electrically connected to the commutator. The above diagram shows a common motor layout – with the rotor inside the stator magnets. The geometry of the brushes, commutator contacts and rotor windings are such that when power is applied, the polarities of the energized winding and the stator magnets are misaligned and the rotor will rotate until it is almost aligned with the stator‘s field magnet.
  • 31. Monitoring robot using GPRS and Bluetooth Department of ECE 31 H.K.B.K.C.E 5.4 Bluetooth Bluetooth is an always-on, short-range radio hookup that resides on a microchip. It was initially developed by Swedish mobile phone maker Ericsson in 1994 as a way to let laptop computers make calls over a mobile phone. Since then, several thousand companies have signed on to make Bluetooth the low-power short-range wireless standard for a wide range of devices. Industry observers expect Bluetooth to be installed in billions of devices by 2005. The Bluetooth standards are published by an industry consortium known as the Bluetooth SIG (special interest group). The concept behind Bluetooth is to provide a universal short-range wireless capability. Using the 2.4 GHz band, available globally for unlicensed low-power uses, two Bluetooth devices within 10 m of each other can share up to 720 Kbps of capacity. Bluetooth is intended to support an open-ended list of applications, including data (such as schedules and telephone numbers), audio, graphics, and even video. For example, audio devices can include headsets, cordless and standard phones, home stereos, and digital MP3 players. Following are some examples of the capabilities that Bluetooth can provide consumers:  Make calls from a wireless headset connected remotely to a cell phone;  Eliminate cables linking computers to printers, keyboards, and the mouse;  Hook up MP3 players wirelessly to other machines to download music;  Set up home networks so that a couch potato can remotely monitor air conditioning, the oven, and children's Internet surfing;  Call home from a remote location to turn appliances on and off, set the alarm, and monitor activity.
  • 32. Monitoring robot using GPRS and Bluetooth Department of ECE 32 H.K.B.K.C.E 5.4.1 Bluetooth Applications Bluetooth is designed to operate in an environment of many users. Up to eight devices can communicate in a small network called a piconet. Ten of these piconets can coexist in the same coverage range of the Bluetooth radio. To provide security, each link is encoded and protected against eavesdropping and interference. Bluetooth provides support for three general application areas using short-range wireless connectivity:  Data and voice access points - Bluetooth facilitates real-time voice and data transmissions by providing effortless wireless connection of portable and stationary communications devices;  Cable replacement - Bluetooth eliminates the need for numerous, often proprietary cable attachments for connection of practically any kind of communications device. Connections are instant and are maintained even when devices are not within line of sight. The range of each radio is approximately 10 m, but can be extended to 100 m with an optional amplifier;  Ad hoc networking - A device equipped with a Bluetooth radio can establish instant connection to another Bluetooth radio as soon as it comes into range. 5.4.2 Rn-42 module Description The RN42 is a small form factor, low power, highly economic Bluetooth radio for OEM‘s adding wireless capability to their products. The RN42 supports multiple interface protocols, is simple to design in and fully certified, making it a complete embedded Bluetooth solution. The RN 42 is functionally compatible with RN 41. With its high performance on chip antenna and support for Bluetooth® Enhanced Data Rate (EDR), the RN42 delivers up to 3 Mbps data rate for distances to 20M. The RN-42 also comes in a package with no antenna (RN-42-N). Useful when the application requires an external antenna, the RN-42-N is shorter in length and has RF pads to route the antenna signal.
  • 33. Monitoring robot using GPRS and Bluetooth Department of ECE 33 H.K.B.K.C.E Features  fully qualified Bluetooth 2.1/2.0/1.2/1.1 module  Bluetooth v2.0+EDR support  Available with on board chip antenna (RN- 42) and without antenna (RN-42-N)  Postage stamp sized form factor, 13.4mm x 25.8 mm x 2mm (RN-42) and 13.4mm x 20 mm x 2 mm (RN-42-N)  Low power(26uA sleep, 3mA connected, 30mA transmit)  UART (SPP or HCI) and USB (HCI only) data connection interfaces.  Sustained SPP data rates- 240Kbps (slave), 300Kbps (master)  HCI data rates- 1.5Mbps sustained, 3.0Mbps burst in HCI mode  Embedded Bluetooth stack profiles included(requires no host stack): GAP, SDP, RFCOMM and L2CAP protocols, with SPP and DUN profile support.  Bluetooth SIG certified  Castellated SMT pads for easy and reliable PCB mounting  Certifications: FCC, ICS, CE  Environmentally friendly, RoHS compliant Figure 5.6 RN-42 Bluetooth module
  • 34. Monitoring robot using GPRS and Bluetooth Department of ECE 34 H.K.B.K.C.E Figure 5.7 RN-42 Bluetooth module pin diagram 5.5 PIR sensors A passive infrared sensor (PIR sensor) is an electronic sensor that measures infrared (IR) light radiating from objects in its field of view. They are most often used in PIR-based motion detectors. Operation Strictly speaking, individual PIR sensors do not detect motion; rather, they detect abrupt changes in temperature at a given point. As an object, such as a human, passes in front of the background, such as a wall, the temperature at that point will rise from room temperature to body temperature, and then back again. This quick change triggers the detection. Moving objects of identical temperature, however, will not trigger a detection because that is the sensors job. It detects
  • 35. Monitoring robot using GPRS and Bluetooth Department of ECE 35 H.K.B.K.C.E motion regardless of temperature. This is also why you can take a piece of paper from a desk that is the same, exact, temperature as everything in the room, attach it to a stick (also the same exact temperature as the room) and wave it slowly in front of a sensor (at any range within the limit of the sensor) and it will activate the sensor). PIRs can be equipped with more than one internal sensing element so that, with the appropriate electronics, it can detect the apparent direction of movement. As an object passes in front of adjacent sensors in turn, this implies the direction of movement. This may be used by on-board electronics to reduce false alarms, i.e., by requiring adjacent sensors to trip in succession. It may also be used to signal the direction of movement to a monitoring apparatus. PIRs come in many configurations for a wide variety of applications. The most common models have numerous Fresnel lenses or mirror segments, an effective range of about ten metres (thirty feet), and a field of view less than 180 degrees. Models with wider fields of view, including 360 degrees, are available—typically designed to mount on a ceiling. Some larger PIRs are made with single segment mirrors and can sense changes in infrared energy over one hundred feet away from the PIR. There are also PIRs designed with reversible orientation mirrors which allow either broad coverage (110° wide) or very narrow "curtain" coverage, or with individually selectable segments to "shape" the coverage. 5.6 camouflage Camouflage is the use of any combination of materials, coloration or illumination for concealment, either by making animals or objects hard to see (crypsis), or by disguising them as something else (mimesis). Examples include the leopard's spotted coat, the battledress of a modern soldier, and the leaf-mimic katydid's wings. . Figure 5.8 camouflage using LED‘s(RGB recognition circuit)
  • 36. Monitoring robot using GPRS and Bluetooth Department of ECE 36 H.K.B.K.C.E A third approach, motion dazzle, confuses the observer with a conspicuous pattern, making the object visible but momentarily harder to locate.The majority of camouflage methods aim for crypsis, often through a general resemblance to the background, high contrast disruptive coloration, eliminating shadow, and countershading. In the open ocean, where there is no background, the principal methods of camouflage are transparency, silvering, and countershading, while the ability to produce light is among other things used for counter- illumination on the undersides of cephalopods such as squid. Some animals, such as chameleons andoctopuses, are capable of actively changing their skin pattern and colours; they often use this ability both for camouflage and for signalling.
  • 37. Monitoring robot using GPRS and Bluetooth Department of ECE 37 H.K.B.K.C.E CHAPTER 6 SOFTWARE REQUIREMENTS 6.1 Java Development Kit(JDK 1.6) The Java Development Kit (JDK) is an implementation of either one of the Java SE, Java EE or Java ME platformsreleased by Oracle Corporation in the form of a binary product aimed at Java developers on Solaris, Linux, Mac OS X orWindows. Since the introduction of Java platform, it has been by far the most widely used Software Development Kit (SDK). On 17 November 2006, Sun announced that it would be released under the GNU General Public License(GPL), thus making it free software. This happened in large part on 8 May 2007, when Sun contributed the source code to theOpenJDK. 6.1.1 JDK contents The JDK has as its primary components a collection of programming tools, including:  appletviewer – this tool can be used to run and debug Java applets without a web browser  apt – the annotation-processing tool  extcheck – a utility which can detect JAR-file conflicts  idlj – the IDL-to-Java compiler. This utility generates Java bindings from a given Java IDL file.  java – the loader for Java applications. This tool is an interpreter and can interpret the class files generated by the javac compiler. Now a single launcher is used for both development and deployment. The old deployment launcher, jre, no longer comes with Sun JDK, and instead it has been replaced by this new java loader.  javac – the Java compiler, which converts source code into Java bytecode  javadoc – the documentation generator, which automatically generates documentation from source code comments  jar – the archiver, which packages related class libraries into a single JAR file. This tool also helps manage JAR files.  javah – the C header and stub generator, used to write native methods
  • 38. Monitoring robot using GPRS and Bluetooth Department of ECE 38 H.K.B.K.C.E  javap – the class file disassembler  javaws – the Java Web Start launcher for JNLP applications  JConsole – Java Monitoring and Management Console  jdb – the debugger  jhat – Java Heap Analysis Tool (experimental)  jinfo – This utility gets configuration information from a running Java process or crash dump. (experimental)  jmap – This utility outputs the memory map for Java and can print shared object memory maps or heap memory details of a given process or core dump. (experimental)  jps – Java Virtual Machine Process Status Tool lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. (experimental)  jrunscript – Java command-line script shell.  jstack – utility which prints Java stack traces of Java threads (experimental)  jstat – Java Virtual Machine statistics monitoring tool (experimental)  jstatd – jstat daemon (experimental)  keytool – tool for manipulating the keystore  pack200 – JAR compression tool  policytool – the policy creation and management tool, which can determine policy for a Java runtime, specifying which permissions are available for code from various sources  VisualVM – visual tool integrating several command-line JDK tools and lightweight performance and memory profiling capabilities  wsimport – generates portable JAX-WS artifacts for invoking a web service.  xjc – Part of the Java API for XML Binding (JAXB) API. It accepts an XML schema and generates Java classes. Experimental tools may not be available in future versions of the JDK. The JDK also comes with a complete Java Runtime Environment, usually called a private runtime, due to the fact that it is separated from the "regular" JRE and has extra contents. It consists of aJava Virtual Machine and all of the class libraries present in the production environment, as well as additional libraries only useful to developers, such as the internationalization libraries and theIDL libraries
  • 39. Monitoring robot using GPRS and Bluetooth Department of ECE 39 H.K.B.K.C.E 6.1.2About the Java Technology Java technology is both a programming language and a platform. The Java Programming Language The Java programming language is a high-level language that can be characterized by all of the following buzzwords:  Simple  Object oriented  Distributed  Multithreaded  Dynamic  Architecture neutral  Portable  High performance  Robust  Secure Each of the preceding buzzwords is explained in The Java Language Environment, a white paper written by James Gosling and Henry McGilton. In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by thejavac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM). The java launcher tool then runs your application with an instance of the Java Virtual Machine. Figure 6.1 an overview of the software development process. Because the Java VM is available on many different operating systems, the same .class files are capable of running on Microsoft Windows, the Solaris™ Operating System (Solaris OS), Linux, or Mac OS. Some virtual machines, such as the Java SE HotSpot at a Glance, perform additional steps at runtime to give your application a performance boost. This include various tasks such as
  • 40. Monitoring robot using GPRS and Bluetooth Department of ECE 40 H.K.B.K.C.E finding performance bottlenecks and recompiling (to native code) frequently used sections of code. Figure 6.2 Through the Java VM, the same application is capable of running on multiple platforms. 6.1.3 The Java Platform A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms in that it's a software- only platform that runs on top of other hardware-based platforms. The Java platform has two components:  The Java Virtual Machine  The Java Application Programming Interface (API) You've already been introduced to the Java Virtual Machine; it's the base for the Java platform and is ported onto various hardware-based platforms.
  • 41. Monitoring robot using GPRS and Bluetooth Department of ECE 41 H.K.B.K.C.E The API is a large collection of ready-made software components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as packages. Figure 6.3 The API and Java Virtual Machine insulate the program from the underlying hardware. As a platform-independent environment, the Java platform can be a bit slower than native code. However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability. The terms"Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java platform. The general-purpose, high-level Java programming language is a powerful software platform. Every full implementation of the Java platform gives you the following features:  Development Tools: The development tools provide everything you'll need for compiling, running, monitoring, debugging, and documenting your applications. As a new developer, the main tools you'll be using are the javac compiler, the java launcher, and the javadoc documentation tool.  Application Programming Interface (API): The API provides the core functionality of the Java programming language. It offers a wide array of useful classes ready for use in your own applications. It spans everything from basic objects, to networking and security, to XML generation and database access, and more.  Deployment Technologies: The JDK software provides standard mechanisms such as the Java Web Start software and Java Plug-In software for deploying your applications to end users.
  • 42. Monitoring robot using GPRS and Bluetooth Department of ECE 42 H.K.B.K.C.E  User Interface Toolkits: The Swing and Java 2D toolkits make it possible to create sophisticated Graphical User Interfaces (GUIs).  Integration Libraries: Integration libraries such as the Java IDL API, JDBC™ API, Java Naming and Directory Interface™ (JNDI) API, Java RMI, and Java Remote Method Invocation over Internet Inter-ORB Protocol Technology (Java RMI-IIOP Technology) enable database access and manipulation of remote objects. 6.2 Android operating system Android is a Linux-based operating system designed primarily for touchscreen mobile devices such as smartphones and tablet computers. Initially developed by Android, Inc., which Google backed financially and later bought in 2005, Android was unveiled in 2007 along with the founding of the Open Handset Alliance: a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices. The first Android-powered phone was sold in October 2008. Android is open source and Google releases the code under the Apache License. This open source code and permissive licensing allows the software to be freely modified and distributed by device manufacturers, wireless carriers and enthusiast developers. Additionally, Android has a large community of developers writing applications ("apps") that extend the functionality of devices, written primarily in a customized version of the Java programming language. In October 2012, there were approximately 700,000 apps available for Android, and the estimated number of applications downloaded from Google Play, Android's primary app store, was 25 billion. These factors have contributed towards making Android the world's most widely used smartphone platform, overtaking Symbian in the fourth quarter of 2010, and the software of choice for technology companies who require a low-cost, customizable, lightweight operating system for high tech devices without developing one from scratch. As a result, despite being
  • 43. Monitoring robot using GPRS and Bluetooth Department of ECE 43 H.K.B.K.C.E primarily designed for phones and tablets, it has seen additional applications on televisions, games consoles, digital cameras and other electronics. Android's open nature has further encouraged a large community of developers and enthusiasts to use the open source code as a foundation for community-driven projects, which add new features for advanced users or bring Android to devices which were officially released running other operating systems. Android had a worldwide smartphone market share of 75% during the third quarter of 2012, with 750 million devices activated in total and 1.5 million activations per day. The operating system's success has made it a target for patent litigation as part of the so-called "smartphone wars" between technology companies. Figure 6.4 the green Android logo, designed by graphic designer Irina Blok. 6.2.1 History Android, Inc. was founded in Palo Alto, California in October 2003 by Andy Rubin (co-founder of Danger), Rich Miner (co-founder of Wildfire Communications, Inc.), Nick Sears (once VP at T-Mobile), and Chris White (headed design and interface development at WebTV) to develop, in Rubin's words "smarter mobile devices that are more aware of its owner's location and preferences". The early intentions of the company were to develop an advanced operating system for digital cameras, when it was realized that the market for the devices was not large enough, and diverted their efforts to producing a smartphone operating system to rival those of Symbian and Windows Mobile (Apple's iPhone had not been released at the time). Despite the past accomplishments of the founders and early employees, Android Inc. operated secretly, revealing only that it was working on software for mobile phones. That same year, Rubin ran out of
  • 44. Monitoring robot using GPRS and Bluetooth Department of ECE 44 H.K.B.K.C.E money. Steve Perlman, a close friend of Rubin, brought him $10,000 in cash in an envelope and refused a stake in the company. Google acquired Android Inc. on August 17, 2005, making it a wholly owned subsidiary of Google. Key employees of Android Inc., including Rubin, Miner and White, stayed at the company after the acquisition. Not much was known about Android Inc. at the time, but many assumed that Google was planning to enter the mobile phone market with this move. At Google, the team led by Rubin developed a mobile device platform powered by the Linux kernel. Google marketed the platform to handset makers and carriers on the promise of providing a flexible, upgradable system. Google had lined up a series of hardware component and software partners and signaled to carriers that it was open to various degrees of cooperation on their part. Speculation about Google's intention to enter the mobile communications market continued to build through December 2006. Reports from the BBC and the Wall Street Journal noted that Google wanted its search and applications on mobile phones and it was working hard to deliver that. Print and online media outlets soon reported rumors that Google was developing a Google- branded handset. Some speculated that as Google was defining technical specifications, it was showing prototypes to cell phone manufacturers and network operators. In September 2007, Information Week covered an evalueserve study reporting that Google had filed several patent applications in the area of mobile telephony. On November 5, 2007, the Open Handset Alliance, a consortium of technology companies including Google, device manufacturers such as HTC and Samsung, wireless carriers such as Sprint Nextel and T-Mobile, and chipset makers such as Qualcomm and Texas Instruments, unveiled itself, with a goal to develop open standards for mobile devices.That day, Android was unveiled as its first product, a mobile device platform built on the Linux kernel version 2.6.The first commercially available phone to run Android was the HTC Dream, released on October 22, 2008. Since 2008, Android has seen numerous updates which have incrementally improved the operating system, adding new features and fixing bugs in previous releases. Each major release is named in alphabetical order after a dessert or sugary treat; for example, version 1.5 Cupcake was followed by 1.6 Donut. The latest release is 4.2 Jelly Bean. In 2010, Google launched its Nexus series of devices—a line of smartphones and tablets running the Android operating system, and
  • 45. Monitoring robot using GPRS and Bluetooth Department of ECE 45 H.K.B.K.C.E built by a manufacturer partner. HTC collaborated with Google to release the first Nexus smartphone, the Nexus One. The series has since been updated with newer devices, such as the Nexus 4 phone and Nexus 10 tablet, made by LG and Samsung, respectively. Google releases the Nexus phones and tablets to act as their flagship Android devices, demonstrating Android's latest software and hardware features. On 13 March 2013, it was announced by Larry Page in a blog post that Andy Rubin had moved from the Android division to take on new projects at Google. He was replaced by SundarPichai, who also continues his role as the head of Google's Chrome division,which develops Chrome OS. 6.2.2 Interface Android's user interface is based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching and reverse pinching to manipulate on-screen objects. The response to user input is designed to be immediate and provides a fluid touch interface, often using the vibration capabilities of the device to provide haptic feedback to the user. Internal hardware such as accelerometers, gyroscopes and proximity sensors are used by some applications to respond to additional user actions, for example adjusting the screen from portrait to landscape depending on how the device is oriented, or allowing the user to steer a vehicle in a racing game by rotating the device, simulating control of a steering wheel. Android devices boot to the homescreen, the primary navigation and information point on the device, which is similar to the desktop found on PCs. Android homescreens are typically made up of app icons and widgets; app icons launch the associated app, whereas widgets display live, auto-updating content such as the weather forecast, the user's email inbox, or a news ticker directly on the home screen. A home screen may be made up of several pages that the user can swipe back and forth between, though Android's homescreen interface is heavily customisable, allowing the user to adjust thelook and feel of the device to their tastes. Third party apps available on Google Play and other app stores can extensively re-theme the homescreen, and even mimic the look of other operating
  • 46. Monitoring robot using GPRS and Bluetooth Department of ECE 46 H.K.B.K.C.E systems, such as Windows Phone. Most manufacturers, and some wireless carriers, customise the look and feel of their Android devices to differentiate themselves from the competition. Present along the top of the screen is a status bar, showing information about the device and its connectivity. This status bar can be "pulled" down to reveal a notification screen where apps display important information or updates, such as a newly received email or SMS text, in a way that does not immediately interrupt or inconvenience the user. In early versions of Android these notifications could be tapped to open the relevant app, but recent updates have provided enhanced functionality, such as the ability to call a number back directly from the missed call notification without having to open the dialer app first. Notifications are persistent until read or dismissed by the user. Figure 6.5 Android 4.2 "Jelly Bean" on the Nexus 4
  • 47. Monitoring robot using GPRS and Bluetooth Department of ECE 47 H.K.B.K.C.E 6.2.3 Applications Android has a growing selection of third party applications, which can be acquired by users either through an app store such as Google Play or the Amazon Appstore, or by downloading and installing the application's APK file from a third-party site. The Play Store application allows users to browse, download and update apps published by Google and third-party developers, and is pre-installed on devices that comply with Google's compatibility requirements. The app filters the list of available applications to those that are compatible with the user's device, and developers may restrict their applications to particular carriers or countries for business reasons. Purchases of unwanted applications can be refunded within 15 minutes of the time of download, and some carriers offer direct carrier billing for Google Play application purchases, where the cost of the application is added to the user's monthly bill. As of September 2012, there were more than 675,000 apps available for Android, and the estimated number of applications downloaded from the Play Store was 25 billion. Applications are developed in the Java language using the Android software development kit (SDK). The SDK includes a comprehensive set of development tools, including a debugger, software libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. The officially supported integrated development environment (IDE) is Eclipse using the Android Development Tools (ADT) plugin. Other development tools are available, including a Native Development Kit for applications or extensions in C or C++, Google App Inventor, a visual environment for novice programmers, and various cross platform mobile web applications frameworks. In order to work around limitations on reaching Google services due to Internet censorship in the People's Republic of China, Android devices sold in the PRC are generally customized to use state approved services instead.
  • 48. Monitoring robot using GPRS and Bluetooth Department of ECE 48 H.K.B.K.C.E 6.3 Android emulator The Android SDK includes a virtual mobile device emulator that runs on your computer. The emulator lets you prototype, develop and test Android applications without using a physical device. The Android emulator mimics all of the hardware and software features of a typical mobile device, except that it cannot place actual phone calls. It provides a variety of navigation and control keys, which you can "press" using your mouse or keyboard to generate events for your application. It also provides a screen in which your application is displayed, together with any other active Android applications. Figure 6.6 Android emulator To let you model and test your application more easily, the emulator utilizes Android Virtual Device (AVD) configurations. AVDs let you define certain hardware aspects of your emulated phone and allow you to create many configurations to test many Android platforms and hardware permutations. Once your application is running on the emulator, it can use the services of the Android platform to invoke other applications, access the network, play audio and video, store and retrieve data, notify the user, and render graphical transitions and themes.
  • 49. Monitoring robot using GPRS and Bluetooth Department of ECE 49 H.K.B.K.C.E The emulator also includes a variety of debug capabilities, such as a console from which you can log kernel output, simulate application interrupts (such as arriving SMS messages or phone calls), and simulate latency effects and dropouts on the data network. 6.3.1 Overview The Android emulator is an application that provides a virtual mobile device on which you can run your Android applications. It runs a full Android system stack, down to the kernel level, that includes a set of preinstalled applications (such as the dialer) that you can access from your applications. You can choose what version of the Android system you want to run in the emulator by configuring AVDs, and you can also customize the mobile device skin and key mappings. When launching the emulator and at runtime, you can use a variety of commands and options to control its behavior. The Android system images available through the Android SDK Manager contain code for the Android Linux kernel, the native libraries, the Dalvik VM, and the various Android packages (such as the Android framework and preinstalled applications). The emulator provides dynamic binary translation of device machine code to the OS and processor architecture of your development machine. The Android emulator supports many hardware features likely to be found on mobile devices, including: An ARMv5 CPU and the corresponding memory-management unit (MMU) A 16-bit LCD display One or more keyboards (a Qwerty-based keyboard and associated Dpad/Phone buttons) A sound chip with output and input capabilities Flash memory partitions (emulated through disk image files on the development machine) A GSM modem, including a simulated SIM Card A camera, using a webcam connected to your development computer. Sensors like an accelerometer, using data from a USB-connected Android device.
  • 50. Monitoring robot using GPRS and Bluetooth Department of ECE 50 H.K.B.K.C.E 6.3.2 Android Virtual Devices and the Emulator To use the emulator, you first must create one or more AVD configurations. In each configuration, you specify an Android platform to run in the emulator and the set of hardware options and emulator skin you want to use. Then, when you launch the emulator, you specify the AVD configuration that you want to load. Each AVD functions as an independent device, with its own private storage for user data, SD card, and so on. When you launch the emulator with an AVD configuration, it automatically loads the user data and SD card data from the AVD directory. By default, the emulator stores the user data, SD card data, and cache in the AVD directory. To create and manage AVDs you use the AVD Manager UI or the android tool that is included in the SDK. For complete information about how to set up AVDs, see Managing Virtual Devices. 6.3.3 Starting and Stopping the Emulator During development and testing of your application, you install and run your application in the Android emulator. You can launch the emulator as a standalone application from a command line, or you can run it from within your Eclipse development environment. In either case, you specify the AVD configuration to load and any startup options you want to use, as described in this document. You can run your application on a single instance of the emulator or, depending on your needs, you can start multiple emulator instances and run your application in more than one emulated device. You can use the emulator's built-in commands to simulate GSM phone calling or SMS between emulator instances, and you can set up network redirection that allows emulators to send data to one another. For more information, see Telephony Emulation, SMS Emulation, and Emulator Networking To start an instance of the emulator from the command line, navigate to the tools/ folder of the SDK. Enter emulator command like this: emulator -avd<avd_name> [<options>]
  • 51. Monitoring robot using GPRS and Bluetooth Department of ECE 51 H.K.B.K.C.E This initializes the emulator, loads an AVD configuration and displays the emulator window. For more information about command line options for the emulator, see the Android Emulator tool reference. Note: You can run multiple instances of the emulator concurrently, each with its own AVD configuration and storage area for user data, SD card, and so on. If you are working in Eclipse, the ADT plugin for Eclipse installs your application and starts the emulator automatically, when you run or debug the application. You can specify emulator startup options in the Run/Debug dialog, in the Target tab. When the emulator is running, you can issue console commands as described later in this document. If you are not working in Eclipse, see Installing Applications on the Emulator for information about how to install your application. To stop an emulator instance, just close the emulator's window. 6.3.4 Installing Applications on the Emulator If you don't have access to Eclipse or the ADT Plugin, you can install your application on the emulator using the adb utility. Before installing the application, you need to build and package it into an .apk as described in Building and Running Apps. Once the application is installed, you can start the emulator from the command line as described previously, using any startup options necessary. When the emulator is running, you can also connect to the emulator instance's console to issue commands as needed. As you update your code, you periodically package and install it on the emulator. The emulator preserves the application and its state data across restarts, in a user-data disk partition. To ensure that the application runs properly as you update it, you may need to delete the emulator's user- data partition. To do so, start the emulator with the -wipe-data option. For more information about the user-data partition and other emulator storage, see Working with Emulator Disk Images.
  • 52. Monitoring robot using GPRS and Bluetooth Department of ECE 52 H.K.B.K.C.E 6.3.5 Emulator Limitations The functional limitations of the emulator include:  No support for placing or receiving actual phone calls. You can simulate phone calls (placed and received) through the emulator console, however.  No support for USB connections  No support for device-attached headphones  No support for determining network connected state  No support for determining battery charge level and AC charging state  No support for determining SD card insert/eject  No support for Bluetooth 6.4 MPLAB The MPLAB is the new graphical, integrated debugging tool set for all of Microchip‘s more than 800 8-bit, 16-bit and 32-bit MCUs and digital signal controllers, and memory devices. It includes a feature-rich editor, source-level debugger, project manager, software simulator, and supports Microchip‘s popular hardware tools, such as the MPLAB ICD 3 in-circuit debugger, PICkit™ 3, and MPLAB PM3 programmer. Based on the open-source NetBeans platform, MPLAB X runs on Windows® OS, MAC® OS and Linux, supports many third-party tools, and is compatible with many NetBeans plug-ins. Figure 6.7 MPLAB X MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the development of embedded applications employing Microchip's PIC® and dsPIC® microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows® , is easy to use and includes a host of free software components for fast application development and super-
  • 53. Monitoring robot using GPRS and Bluetooth Department of ECE 53 H.K.B.K.C.E charged debugging. MPLAB IDE also serves as a single, unified graphical user interface for additional Microchip and third party software and hardware development tools. Moving between tools is a snap, and upgrading from the free software simulator to hardware debug and programming tools is done in a flash because MPLAB IDE has the same user interface for all tools. 6.4.1 Embedded C Embedded C is a set of language extensions for the C Programming language by the C Standards committee to address commonality issues that exist between C extensions for different embedded systems. Historically, embedded C programming requires nonstandard extensions to the C language in order to support exotic features such as fixed-point arithmetic, multiple distinct memory banks, and basic I/O operations. In 2008, the C Standards Committee extended the C language to address these issues by providing a common standard for all implementations to adhere to. It includes a number of features not available in normal C, such as, fixed-point arithmetic, named address spaces, and basic I/O hardware addressing. Embedded C use most of the syntax and semantics of standard C, e.g., main() function, variable definition, data type declaration, conditional statements (if, switch. case), loops (while, for), functions, arrays and strings, structures and union, bit operations, macros, unions,etc. Looking around, we find ourselves to be surrounded by various types of embedded systems. Be it a digital camera or a mobile phone or a washing machine, all of them has some kind of processor functioning inside it. Associated with each processor is the embedded software. If hardware forms the body of an embedded system, embedded processor acts as the brain, and embedded software forms its soul. It is the embedded software which primarily governs the functioning of embedded systems. During infancy years of microprocessor based systems, programs were developed using assemblers and fused into the EPROMs. There used to be no mechanism to find what the program was doing. LEDs, switches, etc. were used to check correct execution of the program.
  • 54. Monitoring robot using GPRS and Bluetooth Department of ECE 54 H.K.B.K.C.E Some ‗very fortunate‘ developers had In-circuit Simulators (ICEs), but they were too costly and were not quite reliable as well. As time progressed, use of microprocessor-specific assembly-only as the programming language reduced and embedded systems moved onto C as the embedded programming language of choice. C is the most widely used programming language for embedded processors/controllers. Assembly is also used but mainly to implement those portions of the code where very high timing accuracy, code size efficiency, etc. are prime requirements. Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write (portable) operating systems. Originally it was implemented on UNIX operating systems. As it was intended for operating systems development, it can manipulate memory addresses. Also, it allowed programmers to write very compact codes. This has given it the reputation as the language of choice for hackers too. As assembly language programs are specific to a processor, assembly language didn‘t offer portability across systems. To overcome this disadvantage, several high level languages, including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but couldn‘t find wide acceptance. Amongst those, C got wide acceptance for not only embedded systems, but also for desktop applications. Even though C might have lost its sheen as mainstream language for general purpose applications, it still is having a strong-hold in embedded programming. Due to the wide acceptance of C in the embedded systems, various kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all this facilitated development of embedded systems using C. Subsequent sections will discuss what is Embedded C, features of C language, similarities and difference between C and embedded C, and features of embedded C programming. EMBEDDED SYSTEMS PROGRAMMING Embedded systems programming is different from developing applications on a desktop computers. Key characteristics of an embedded system, when compared to PCs, are as follows:
  • 55. Monitoring robot using GPRS and Bluetooth Department of ECE 55 H.K.B.K.C.E · Embedded devices have resource constraints(limited ROM, limited RAM, limited stack space, less processing power) · Components used in embedded system and PCs are different; embedded systems typically uses smaller, less power consuming components. · Embedded systems are more tied to the hardware. Two salient features of Embedded Programming are code speed and code size. Code speed is governed by the processing power, timing constraints, whereas code size is governed by available program memory and use of programming language. Goal of embedded system programming is to get maximum features in minimum space and minimum time. Embedded systems are programmed using different type of languages: · Machine Code · Low level language, i.e., assembly · High level language like C, C++, Java, Ada, etc. · Application level language like Visual Basic, scripts, Access, etc. Assembly language maps mnemonic words with the binary machine codes that the processor uses to code the instructions. Assembly language seems to be an obvious choice for programming embedded devices. However, use of assembly language is restricted to developing efficient codes in terms of size and speed. Also, assembly codes lead to higher software development costs and code portability is not there. Developing small codes are not much of a problem, but large programs/projects become increasingly difficult to manage in assembly language. Finding good assembly programmers has also become difficult nowadays. Hence high level languages are preferred for embedded systems programming. Use of C in embedded systems is driven by following advantages · It is small and reasonably simpler to learn, understand, program and debug. · C Compilers are available for almost all embedded devices in use today, and there is a large pool of experienced C programmers.
  • 56. Monitoring robot using GPRS and Bluetooth Department of ECE 56 H.K.B.K.C.E · Unlike assembly, C has advantage of processor-independence and is not specific to any particular microprocessor/ microcontroller or any system. This makes it convenient for a user to develop programs that can run on most of the systems. · As C combines functionality of assembly language and features of high level languages, C is treated as a ‗middle-level computer language‘ or ‗high level assembly language‘ · It is fairly efficient · It supports access to I/O and provides ease of management of large embedded projects. Compared to assembly language, C Code written is more reliable and scalable, more portable between different platforms (with some changes). Moreover, programs developed in C are much easier to understand, maintain and debug. Also, as they can be developed more quickly, codes written in C offers better productivity. C is based on the philosophy ‗programmers know what they are doing‘; only the intentions are to be stated explicitly. It is easier to write good code in C & convert it to an efficient assembly code (using high quality compilers) rather than writing an efficient code in assembly itself. Benefits of assembly language programming over C are negligible when we compare the ease with which C programs are developed by programmers. Objected oriented language, C++ is not apt for developing efficient programs in resource constrained environments like embedded devices. Virtual functions & exception handling of C++ are some specific features that are not efficient in terms of space and speed in embedded systems. Sometimes C++ is used only with very few features, very much as C. Java is another language used for embedded systems programming. It primarily finds usage in high-end mobile phones as it offers portability across systems and is also useful for browsing applications. Java programs require Java Virtual Machine (JVM), which consume lot of resources. Hence it is not used for smaller embedded devices. Efficient embedded C programs must be kept small and efficient; they must be optimized for code speed and code size. Good understanding of processor architecture embedded C programming and debugging tools facilitate this.
  • 57. Monitoring robot using GPRS and Bluetooth Department of ECE 57 H.K.B.K.C.E DIFFERENCE BETWEEN C AND EMBEDDED C Though C and embedded C appear different and are used in different contexts, they have more similarities than the differences. Most of the constructs are same; the difference lies in their applications. C is used for desktop computers, while embedded C is for microcontroller based applications. Accordingly, C has the luxury to use resources of a desktop PC like memory, OS, etc. While programming on desktop systems, we need not bother about memory. However, embedded C has to use with the limited resources (RAM, ROM, I/Os) on an embedded processor. Thus, program code must fit into the available program memory. If code exceeds the limit, the system is likely to crash. Compilers for C (ANSI C) typically generate OS dependantexecutables. Embedded C requires compilers to create files to be downloaded to the microcontrollers/microprocessors where it needs to run. Embedded compilers give access to all resources which is not provided in compilers for desktop computer applications. Embedded systems often have the real-time constraints, which is usually not there with desktop computer applications. Embedded systems often do not have a console, which is available in case of desktop applications. So, what basically is different while programming with embedded C is the mindset; for embedded applications, we need to optimally use the resources, make the program code efficient, and satisfy real time constraints, if any. All this is done using the basic constructs, syntaxes, and function libraries of ‗C‘. 6.4.2 MPLAB IDE MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the development of embedded applications employing Microchip's PIC® and dsPIC® microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows® , is easy to use and includes a host of free software components for fast application development and super- charged debugging. MPLAB IDE also serves as a single, unified graphical user interface for additional Microchip and third party software and hardware development tools.
  • 58. Monitoring robot using GPRS and Bluetooth Department of ECE 58 H.K.B.K.C.E Figure 6.8 MPLAB IDE interface The typical tasks for developing an embedded controller application are: 1. Create the high level design. From the features and performance desired, decide which PIC® MCU or dsPIC® DSC device is best suited to the application, then design the associated hardware circuitry. After determining which peripherals and pins control the hardware, write the firmware – the software that will control the hardware aspects of the embedded application. A language tool such as an assembler, which is directly translatable into machine code, or a compiler that allows a more natural language for creating programs should be used to write and edit code. Assemblers and compilers help make the code understandable, allowing function labels to identify code routines with variables that have names associated with their use, and with constructs that help organize the code in a maintainable structure.
  • 59. Monitoring robot using GPRS and Bluetooth Department of ECE 59 H.K.B.K.C.E 2. Compile, assemble and linkthe software using the assembler and/or compiler and linker to convert your code into ―ones and zeroes‖ –-machine code for the PIC MCUs. This machine code will eventually become the firmware (the code programmed into the microcontroller). 3. Test your code. Usually a complex program does not work exactly the way imagined, and ―bugs‖ need to be removed from the design to get proper results. The debugger allows you to see the ―ones and zeroes‖ execute, related to the source code you wrote, with the symbols and function names from your program. Debugging allows you to experiment with your code to see the value of variables at various points in the program, and to do ―what if‖ checks, changing variable values and stepping through routines. 4. ―Burn‖ the code into a microcontroller and verify that it executes correctly in the finished application.
  • 60. Monitoring robot using GPRS and Bluetooth Department of ECE 60 H.K.B.K.C.E CHAPTER 7 EXECUTION STEP 1 Install JDK 1.6 set path (%path%;C:Program FilesJavajdk1.6.0_02bin) and class path as (%classpath%;C:Program FilesJavajdk1.6.0_02lib) in environment variables Wizard. STEP 2 Transfer android(apk file) to cell phone. STEP 3 Run Project by Double Click on run.bat file in src folder. Figure 7.1 double click run.bat file
  • 61. Monitoring robot using GPRS and Bluetooth Department of ECE 61 H.K.B.K.C.E STEP 4 Can Control the Project Using This Window. Figure 7.2 GUI on PC STEP 5 Pair Your ANDROID MOBILE with your robot‘s Bluetooth maodule.
  • 62. Monitoring robot using GPRS and Bluetooth Department of ECE 62 H.K.B.K.C.E STEP 6 Run ANDROID Application(To Read Command From Socket Programs, Give the Server dail up ip address) Figure 7.3 android application on phone STEP 7 Enter the ip address of remote pc Figure 7.4 IP address of PC on application
  • 63. Monitoring robot using GPRS and Bluetooth Department of ECE 63 H.K.B.K.C.E STEP 8 Streamed images are displayed in and robot can be controlled through buttons.
  • 64. Monitoring robot using GPRS and Bluetooth Department of ECE 64 H.K.B.K.C.E CHAPTER 8 SIGNIFICANCE OF THE PROJECT The increase of greed in people has paved way to civil-wars and natural disasters. A swift action has to be taken in the relief work of the aftermath of earthquake affected areas, such that any delay in the rescue could lead the death toll to rise. The same can be applied to war fields too. The project focuses on human beings who are alive and struggling for their lives either in the war field or due to natural disasters like earthquakes, to be recognized and rescued in a much faster pace. The robot senses humans alive and sends a notification to the mobile to capture the images of the same. The captured image is then sent to the server to view and act accordingly. The administrator at the server end has options to move the robot in any required direction for more accurate detection of human beings alive. 8.1 Advantages of process monitoring robot  An affordable Technology with high end advantage  Can help tracking alive human beings  View the status of the person alive  The place can be monitored remotely by moving the robot  Based on the robot‘s background color, LED‘s on robot will glow, i.e. robot will change it color based on its background color. 8.2 Disadvantages of process monitoring robot  Frame rate of video capture is less  The mobile device is confined to android operating system and the GPRS in the phone should be enables  Internet should be available at the server end
  • 65. Monitoring robot using GPRS and Bluetooth Department of ECE 65 H.K.B.K.C.E CHAPTER 9 FUTURE SCOPE AND CONCLUSION 9.1 Future enhancements  detect the signals of other living beings based on the frequency of the breathing and heartbeat signals  The video streaming can be made much faster using Advanced Multimedia API.  A speaker can be connected to broadcast message to the people. 9.2 CONCLUSION Thus a process monitoring robot capable of hiding itself by its camouflage capability. Can be used for various operation including remote and military areas. With the advancement of mobile network the connection can be made faster, easier and user friendly. It comes as a revolutionary model for the society which can be helpful in saving a lot of lives during natural disasters or even a national threat.