An Overview Of Spy Robot
Chapter 1
AN OVERVIEW OF SPY ROBOT
1.Introduction
Sometimes we drop small things like diamond rings, pens or valuable stuff under
hidden places like under bed, under table or places that we can not reach. If we can
have some mechanism that can show us where’s the lost stuff would helps a lot. That’s
why I proposed this SPY robot that can explore certain places that human couldn’t
reach.
SPY is a robot that is very tiny (about 5 in cube) and capable of navigating some
specific places. It will explore toward pointed direction, avoid obstacles and transmit
images that it “sees”. When the specified location is reached, it will return to its home.
While it is exploring, it will transmit live video through its wireless (RF) video
camera to home base. If the place that user assigned is in low light condition, robot
will turn on its light in order to capture images. When robot found some obstacles on
the path, it will turn to other direction to avoid collision and continue its work. When
robot reach destination, it will show user that the task has been done by turn its head
toward home direction and then blinking its LED.
A Robot is usually an electro-mechanical machine which is guided by wireless remote or
laptop. Spy robot can capture audio and video information from the surroundings and send to
a remote station through RF signal. By the use of remote controller, the spy robot will move
to desired destination and spy images around the robot in this project.
This robot consists of mainly two sections:
Remote control section and Video transmission section. The block diagram of remote
operated spy robot is shown in fig 1.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 1
An Overview Of Spy Robot
Fig 1: Block Diagram of Spy Robot
CHAPTER 2
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 2
An Overview Of Spy Robot
LITERATURE SURVEY
Wai Mo Mo Khaing, [2014] , Spy robots are remotely controlled robots,
equipped with a camera, transmitting video data to the intervention troop. They are
made to small and compact enough to easily transport. In this paper, the project
supposes a movable spy robot with a remote controller by using PIC 16F628A and
PIC 16F877. The spy robot is made up of a wireless camera, an antenna, batteries and
four movable wheels. The two different PICs are used to remotely control along
wireless system and to control Spy robot. CCD camera is used to capture information
surrounding the robot. A 4 bits LCD display is mounted on remote controller to view
user command. To use the Spy robot in the dark area as night, the CCD is set up with
LED that connected by lighting circuit. Radio Frequency modules signals are used in
wireless remote control system for transmitting and receiving wireless logic signals to
control the motors of the Spy robot control system. The three Brush DC motors and
the two L298N are involved in Remote Operated Spy Robot. L298N are used to drive
the Brush DC motors respectively. In this paper, Remote Operated Spy Robot is a
small robot designed for spying, surveillances and inspection purposes.
Kunj Gudhka, [2016] ,Nowadays as there are technological advancements these
advancements are used by the military forces for reducing the risk of their casualties
and to defeat their enemies. With the development of sophisticated technology, it
mostly relies on the high tech weapons or machinery being used. Robotics is one of
the hot fields of modern age in which the nations are concentrating upon for military
purposes in the state of war and peace. They have been in use for some time for
demining and rescue operations but now they are propelled by using them for
combat and spy missions. Modern military forces are using different kinds of robots
for different applications ranging from mine detection to rescue operations. In future,
they will be used for reconnaissance and surveillance, logistics and support,
communications infrastructure, forward-deployed offensive operations, and as tactical
decoys to conceal maneuver by manned assets. In order to make robots efficient for
the unpredicted cluttered environment of the battlefield, research on different aspects
of robots are under examination in laboratories to be able to do its job autonomously,
as efficiently as a human operated machine can do. Latest technologies, software
and hardware are being investigated to have advanced and intelligent robots for
different operations on the war field. This paper presents robotic technologies being
used in war spying. These robots are under examination for autonomous, co-operative
and controlled environment. Our major focus is on the uses of robots in war, peace
and as well as their impact on society.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 3
An Overview Of Spy Robot
Ankit Yadav, [2016] , This research paper is based on Spying Robot which is
made by using different technologies and sources. This paper is basically based on a
project which is made by us. The main purpose of this paper is to describe how this
war spy robot is made, what are the sources or technologies used to make this robot
and how this robot is helpful in so many ways. Basically the project is designed to
develop a robotic vehicle [1] named Smart Spy Robot using RF technology for remote
operation attached with webcam application for monitoring purpose. The robot along
with wireless camera can wirelessly transmit real-time video and will give
confidential information regarding opposite parties. An 8051 series [2] of
microcontrollers used for the desired operation. The commands are sent to the
receiver, at the transmitter side with pushbuttons, to control the movement of the
Robot to move forward, backward and left or right.
Platform design
Since SPY is designed for exploring limited places like very narrow places or height
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 4
An Overview Of Spy Robot
limited places. It is will be more appropriate to make it as small as possible. I did not
choose it to as small as 1-inch cube size because it will increase design difficulty and
because this is a prototype, the size of some parts probably not small enough, so the
whole platform size is around 5-inch cube.
Figure 1. SPY platform design.
There are three wheels, two of them is driven by two servos. Wheel encoders is
attached to two front wheels to record how many steps has been explored at each
wheel at a given time. In this way, the robot can trace back to its home using these
recorded data. Shaft encoder is attached at left and right side of robot against the black
and white stripe wheel.
Figure 2. Wheel design (left) and shaft encoder (right)
The power is composed of 6 NiCd batteries to supply enough driven strength. Power
pack is located at the rear side of robot. Since wireless video camera consumes lots of
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 5
An Overview Of Spy Robot
power for wireless communication, it would drain out lots of power from robot. To
avoid burn out TJPro board, I designed another power line dedicated for video
camera. And since video need 12V, I also design a 4.5V to 12V regulator for video
camera power supply.
Figure 3. (Left)Power pack location (Right) Another power line dedicate for video
camera
Figure 4. Video camera power regulator
Camera is located at top of robot. To avoid collision, 4 IR sensors are equipped. IR
sensors sense that if any obstacle is approaching ( or robot is approaching any
obstacle). IR sensors are located at front left, front right, rear left and rear right of
robot. Because IR detector is very sensitive and bumper is made of metal, I use
alumni to shield IR emitter such that it will be affected by bumper and the IR detector
will not so sensitive to the environment. Since camera can not show image when the
light is dim, I use one photocell to detect light condition, it is located beside the
camera.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 6
An Overview Of Spy Robot
Figure5. Camera and light sensors. Below the camera are IR emitter and IR detector
Sometimes, IR sensos do not work so well, bumpers are needed to prevent collision.
Since bumper should be firm enough to make bumper sensor work properly, I use
copper bumper.
Metal bumper
Figure 6. Bumper design
Sensors Design
Sensors that will be used in this project are: 4 IR sensors, two wheel encoders, 4
micro-switches, one photoresistor and one sonar.IR sensors are used for sense possible
obstacles. Wheel encoders are used to record how many “steps” has passed in a given
time at each wheel. And micro-switches are used for bumper. Photoresistor is used for
sense environment light condition, if it is in low light condition, robot will turn on its
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 7
An Overview Of Spy Robot
own light to help camera capture images.
CHAPTER 4
HARDWARE COMPONENTS
The components in my wheel encoder are:
Shaft encoder
32 segments striped wheel
Interface circuit
Software driver
Shaft Encoder
Shaft encoder is a sensor that measures the position or rotation rate of a shaft. From
signal point of view, we can tell shaft encoder as: absolute encoders and incremental
encoders. Absolute encoders deliver a code that corresponds to a particular orientation
of the shaft while incremental encoders produce a pulse train. The pulse is generated
when output voltage of shaft encoder changes from high to low(or vice versa), so the
faster the shaft turns the faster the pulse generated.
From implementation point of view, we
can tell shaft encoder as:photointerrupter
and photoreflector. Photointerrupter
includes an inferared LED emitter and a
photodetector and a slotted disk. When
disk spins, the light is interrupted by the
moving slots thus photodetector detects
the changes of the light and generate
pulse at its output. If we use
microprocessor the count the pulses generated by photodetector, we can know how far
the wheels has rotated. The photoreflector is different, it uses the reflection of the light
to detect the movement of the wheel. Inferared LED emitter emits light to striped
wheel. Since light will not reflect if it meets black stripes, phototransistor then detects
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 8
An Overview Of Spy Robot
the changes of the light and sends out singals according to the reflection.
The encoders that I use in SPY robot is Hamamatsu P5587 photoreflector. The
photoreflector is packaged with an infrared LED and a phototransistor in a very
compact unit. The device is attached on the body of the robot and the distance
between device and striped wheel is about 0.5cm.
Striped Wheel
The width of the stripes is an important issue
in designing shaft encoder. I tried 32 segments,
48 segments and 64 segments striped wheel,
only 32 segments striped wheel works
correctly Although more stripes give greater
resolution to the output measurements, but the
stripes cannot be narrower than the field of
view of the photoreflector. That’s the reason
why it does not work well in 48 segments and 64 segments.
Because the near-infrared energy emitted by the LED can penerate thin, white paper,
so I put thick hard paper behind printed striped wheel this will make sure the light will
reflect if it meets white stripes.
Interface circuit
Since Hamamatsu P5587s photoreflectors have
circuitry integrated in the package to amplify
and condition the output of the phototransistor,
the only interface components required for
connecting to the TJPro board are two
resistors: 680Ω and 6.8KΩ resistor. 680Ω
resistor is connected to the input of the LED to
limit the current through LED. 6.8KΩ resistor
is connected to the output of the phototransistor to pull up phototransistor's open-
collector output.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 9
An Overview Of Spy Robot
The power for Hamamatsu P5587s photoreflector is coming from 5 4 3
analog port on TJPro board. Analog port provides regulated 5V and
ground connection thus meets our need.
The wires connecting TJPro board and photoreflector are: Grey for
pin 1, Purple for pin 2, Blue for pin 3, Green for Pin 4, Yellow for pin
5. The pin assignment for Hamamatsu P5587s photoreflector is as
below: Pin 1 is connected to LED ground. Pin 2 provides LED power.
Pin 3 is for signal. Pin 4 is ground and Pin 5 is power.
1 2
MC68HC11’s port A has 8 pins, they have various input capture and output compare
registers associated with them, which are able either to mark the time that events
happen on those pins or to initiate events at preprogrammed times.
In the original design of interface circuits, the left wheel shaft encoder is connected to
MC68HC11’s PA7. A pulse accumulator function is associated with PA7 making it
easy to count the pulses produced by the shaft encoder in software, but PA7 pin is
used for motor control, I choose PA1 and PA0 for right and left wheel shaft encoder. I
only use pin 1 of PA1 and PA0 on TJPro board, pin2 and pin 3 which are for power
and ground connection is not used since they are not regulated.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 10
An Overview Of Spy Robot
Software Driver
To drive wheel encoder, we need some surgery to interrupt handler. MC68HC11 port
A pin PA0, PA1 and PA2 are associated with input capture registers. To count encoder
clicks, we must use interrupt handlers. Since right wheel encoder is connected to PA1,
IC2 register is for right wheel encoder. Same as left wheel encoder, which is
connected to PA0, thus IC3 register is for left wheel encoder.
There are four actions can be assigned to input capture registers. They are: capture
disable, capture on rising edge and capture on any edges. We must use TCTL2 register
to set the desired response for any successful input-event detection. Since four
different responses can be assigned for one input capture, it is obvious that we need 2
bits to represent all possible value. In TCTL2 register, EDG3A and EDG3B is for
setting IC3 response action, EDG2A and EDG2B is for setting IC2 response action.
The address for TCTL2 is $1021, in ICC11, TCTL2 is a legitimate variable, we don’t
need to do anything before using this variable.
EDG3A EDG3B EDG2A EDG2B Configuration
0 0 0 0 Capture Disable
0 1 0 1 Capture on Rising
Edge
1 0 1 0 Capture on Falling
Edge
1 1 1 1 Capture on Any Edge
We will trigger on risign edges, so four bits must be written to the TCTL2 register to
configure it for risigng edge-triggered interrupts. In order not to disturb other setting, I
store 0101 to the least significant 4 bits and leave other four bits not changed.
TCTL2
$1021 0 0 EDG1B EDG1A EDG2B EDG2A EDG3B EDG3A
x X X X 0 1 0 1
Each time an interrupt happened according to the event we assigned, an interrupt flag
will be set indicates that an interrupt event happened. The flag of input capture
register is contained by TFLG1 register. TFLG1 register is at address $1023, and we
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 11
An Overview Of Spy Robot
can use TFLG1 variable name in ICC11 directly without pre-define. When input
capture event happened, associated flag bit ICxF will be set, hardware will
automatically initiate an interrupt. Code in the interrupt service routine thus must clear
the ICxF flag; otherwise, when an attempt is made to return from the interrupt, the
hardware will think the ICx interrupt is pending and immediately service it again.
Suppose IC3 interrupt happened, after service, we must write a 1 to the bit in the
TFLG1 register that corresponds to that interrupt’s flag as below.
TFLG1
$1023 OC1F OC2F OC3F OC4F OC5F IC1F IC2F IC3F
x X X X X X X 1
It is obvious that after IC2 service, we must clear IC2F flag. After above discussion,
the interrupt handler routine, which automatically runs whenever a rising edge is
detected, must do the following tasks: increment a counter, clear the interrupt flag and
return from the interrupt. Now we need to configure interrupt vector such that when
IC event happened, hardware will jump to our service routine instead of default
interrupt service. The TMSK1 register continues the bits that must be set to enable
interrupts associated with events on any input capture pin. TMSk1 is at address $1022
and the bits associate to input capture 3 and input capture 2 are IC3I and IC2I.
Start Interrupt
handler
Increase counter
Clear Flag
Return from
Interrupt
TMSK1
$1022 OC1I OC2I OC3I OC4I OC5I IC1I IC2I IC3I
x X X X X X 1 1
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 12
An Overview Of Spy Robot
Before we set IC2I and IC3I bits, interrupt handler will not handle inputer capture 2
and input capture 3 events. Now we should redirect interrupt vector to our routine.
The vector address for IC3 interrupt is $FFEA, and IC2 interrupt is $FFEC. The two
byte address stored at this location is the address at which the user’s interrupt handler
code muse begin. In ICC11, to modify interrupt handler, we must modify vectors.c
file. The interrupt handler routine for IC2 and IC3 now are changed to my_TIC3_isr
and my_TIC2_isr routine. The whole flow is presented in following page.
Initial
interrupt start
Turn off interrupt
Set TCTL2 register
Set TMSK1
Store my_TIC3_handler
address into $FFEA
Store my_TIC2_handler
address into $FFEC
Turn on interrupt
Source code for software driver is attached at the end of report.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 13
An Overview Of Spy Robot
Behavior
User first assign one position to robot like x=???, y=??? then robot will go to that
position. On the path to destination, if robot meet obstacle, it will turn around and
continue its path. While it is walking, it will record steps that it used in past few
seconds to record path. Once destination is reached, robot will return to its home
according to the data it recorded.
In the beginning, the coordinate that robot standing now is position (0,0). To go to
destination, robot will try to increase Y direction first. If it met obstacle, it will turn 90
degree and try to increase X direction. If positive Y and X direction has obstacle, it
will go to negative Y direction until X direction is free of obstacle then go X direction.
If Y or X direction is meet, robot will go other direction until destination is meet.
Since this robot is not for maze explorer, I will not program it as those mice that run
in maze. But reasonable obstacle avoidance will be programmed.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 14
An Overview Of Spy Robot
Experimental Layout and Results
Wheel Encoder
Wheel encoder can be used to measure the distance from last measured position to
current position. To measure this simply reset counter for each wheel in the beginning
of measure, then at the destination ,see how many clicks happened so far then we
know the distance. To measure velocity of robot, we need constantly check clicks of
each wheel. This can be done by checking clicks every second(or reasonable time),
then we know the velocity of robot.The most challenge application of wheel encoder
is to synchronize two wheels such that robot walks as straight as possible. This
includes measure wheel clicks and adjust motor power level. Since motor device is
not uniform and the zero point of each servo is different and the adjustment for
different servo is different too. Thus it is almost not possilbe for two servos with
identical properties. The challenge now becomes how could we use software to adjust
two servo such that two servo will have similar performance.
Using wheel encoder and make two servos runs at the same rate is feasible. Before
robot begins, robot itself will run a self-calibrate to sync two servo. Once it got
reasonable clicks sync, it will start perform its task. In the beginning of calibrate
routine, it will assign full power level for each motor. Then run and wait 9000 e-
clocks. Since processing interrupt takes time, after 9000 e-clock, we wait another 500
e-clock to let interrupt handler finish its work. Then we compare clicks from two
wheels. The adjustment for each motor is according to the click counts. If right wheel
count is more than left wheel count then right motor power is adjusted according to
following equation:
Right_motor_power Left_clicks
Right_motor_power
Right_clicks
The same is done when left wheel count is more than right wheel count accroding to
following equation:
Left_motor_power Right_clicks
Left_motor_power
Right_clicks
But after some tries, both left motor power and right motor power will decrease, we
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 15
An Overview Of Spy Robot
don’t want this situation happened, so I made re-adjustment if motor power becomes
too low. If right motor power level is lower than 100 and after adjustment left motor
power will not exceed 100, then we do following adjustment:
(left _ motor _ power 100)
Right _ motor _ power 100 Left _ motor _ power
right _ motor _ power
Same is done when left motor power is lower than 100:
( Right _ motor _ power 100)
Left _ motor _ power 100 Right _ motor _ power
Left _ motor _ power
Because moto performance will decrease when battery power level decrease, this
increases the difficulties of syncing both motors. So when two motors are at the same
clicks, program will try same power level and see if the result clicks are the same. If
they are the same, then calibrate routine ends and begins to execute regular task,
otherwise it will calibrate again.
I do 20 times of experinments and found right motor power is about twice powerful
than left motor power. Actually after calibrate, the average power level for left motor
is always 100, and power level for right motor is about 74. The average calibrate time
in each experinment is about 7*9500=66500 e-clocks.
The experinment chart and result is included at the end of report.
Range measure
From the experinment I did, the range and the click counts is about:
1 feet = 26 clicks
Rotation measure
For roatate 90 degree, the click count should be 6 clicks.
IR detection measure
For correctly detect obstacle, IR detector should continuous detect bounced IR. In the
experinment, if obstacle is in half feet range, IR detector will have a reading about
100. I use this as threash hold to tell that an obstacle is detected.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 16
An Overview Of Spy Robot
IR coverage
In the IR coverage experinment, I use hand to detect the exact IR coverage. The
measured IR coverage is about 45 degree.
45 degree
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 17
An Overview Of Spy Robot
Conclusion
The SPY robot exactly executed the assigned task if the path to the destination is not
complex and obstacles are apart in 1 feet range. If obstacles are too close to each
other, the robot will be fooled. It would be difficult to tell all the obstacles in the
journey to destination since we have to sense environmemt each time we move a step.
Since the limited memory of TJPro, we cannot remember all the events happed in the
journey and thus it is not practical to ask robot to solve whether destination is
reachable or not. That means that if destination is not reachable, robot will not know
and will try to find a path to the destination till it run out all the power. The other
drawback of SPY robot is because of the inaccuracy of wheel encoder, it is not
practical to ask robot to travel a very long journey. The longer the robot travel, the
more error the robot will make. But this drawback can be solved by using more
accurate encoder like more stripes or use GPS to locate current position then adjust
internal data. But this will result in large platform and consume more power and
complexity.
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 18
An Overview Of Spy Robot
References:
Kunj Gudhka, Aishwarya Kadam, Devika Kale, Manil Rupani “War Field
Spying Robot Using Wireless Camera”,International Journal of Electrical and
Electronics Research Vol 4,Issue 1,January-March 2016,Mumbai,India.
Aaruni Jha,Apoorva Singh “War Field Spying Robot With Night Vision
Camera”,International Journal of Network Communications and Emerging
Technologies(JNCET) Vol 2,Issue 1,May(2015)
Abdus Samdl, Jadhav Devidas Dasharath :An Intelligent Combat Robot”
Journal of Advanced Research in Computer AND Communication
Engineering Volume 3,ISSUE 5,May (2014)
IAR, MECHANICAL DEPT.MCE, HASSAN[Type text] Page 19