You are on page 1of 17

INSTITUTE OF INDUSTRIAL ELECTRONICS ENGINEERING (PCSIR)

Project Report
Sony Remote Controlled Mobile
Robot

Group Members:
Asad abbas(1837)
Naveed abbas(1827)
Shaf salahuddin(1835)
Owais saleem(1829)
Muhammad ali(1839)

-1-
Khadim hussain(1817)

ACKNOWLEDGEMENT

We, first of all, thanks to ALLAH to gave human being such a great power of thinking and
understanding. Then we thank our parents to support us all of our studies and to cooperate with
us in any occasion.

Secondly, we thank to our teachers to guide us through the proper way and make us understand
the critical points of the course.

-2-
Index

Topic Page

1) Project Objective. 4

2) Block Diagram. 5

3) Project Description. 6-7

4) Circuit Schematic, Layout and Assembly Top. 8-10

5) Datasheets. 11-14

6) Program Code (PICBasic PRO). 15-17

-3-
1. PROJECT OBJECTIVE:

The objective of this project is basically to design a Mobile Robot capable of move around
according to the directions sent by the Sony Remote Control.
Mobile robots have the capability to move around in their environment and are not fixed to one
physical location. In contrast, industrial robots usually consist of a jointed arm (multi-linked
manipulator) and gripper assembly (or end effecter) that is attached to a fixed surface.
Mobile robots are the focus of a great deal of current research and almost every major university
has one or more labs that focus on mobile robot research. Mobile robots are also found in
industry, military and security environments. They also appear as consumer products, for
entertainment or to perform certain tasks. These machines use some actuators to perform their
specified task in any type of environment for which they are designed. These actuators include
stepper motors, servo motors and simple dc motors.
The Sony IR protocol is one of the very useful IR protocol for data communication. A Sony
remote sends IR waves of known duty cycle to indicate the button code in the remote. This code
can thus be employed to control devices at a distance of about 5 to 10 meters. The frequency of
IR signal used usually range from 32 to 40 KHz.
This project uses PIC 16F877A to determine the code of the button pressed and then make
decision for motion control. If button pressed is 2 then motion is in forward direction else if
button pressed is 8 then motion is in backward direction. Robot can be turned left or right by
using buttons 4 and 6 respectively.

-4-
2. BLOCK DIAGRAM:

1.5V X 3 9V Battery
Batteries

Hbridge
PIC Board
IR Receiver

Motors

-5-
3. PROJECT DESCRIPTION:
Sony remote controlled mobile robot is divided into previously mentioned groups. These
groups are defined as under.
1. Power Sources:
For Robot circuit operation, two different voltage sources are required. This
source requirement is fulfilled by attaching 3 AAA size cells each having a voltage of 1.5V in
series and a 9V battery. 3 x 1.5V batteries provide power to the brain i.e. microcontroller (In this
project PIC16F877A) and its sensor circuitry while 9V battery is used to power up the motors.
2. Hbridge:
An H-bridge is an electronic circuit which enables a voltage to be applied across a load in

either direction. It simply reverses the direction of current flow through or sometimes stops
motors on signals provided by the controller.
In this project an Hbridge is formed by using a darlington array (ULN2003) and two
DPDT relays. The direction of motors can be controlled by using following table.

Direction Run Direction


Bit Bit of motor
0 0 None
1 0 None
0 1 Forward
1 1 Backward

3. PIC Board:
PIC board consists of the microcontroller operating circuitry and two IR signal receivers
fitted in a fashion so as to receive signal from all directions. It also includes a connector for
Hbridge. The microcontroller continuously checks the signal from receivers one by one. When
signal is received from one of the receivers the microcontroller decodes it and compares it with
the algorithm defined to give directions to HBridge.

-6-
4. The Sony IR Code:
The Sony remote control is based on the Pulse-Width signal coding scheme. The code
exists of 12 bits sent on a 40kHz carrier wave. The code starts with a header of 2,4ms or 4 times
T where T is 600µS. The header is followed by 7 command bits and 5 address bits. The address
and commands exists of logical ones and zeros. A logical one is formed by a space of 600µS or
1T and a pulse of 1200 µS or 2T. A logical zero is formed by a space of 600 µS and pulse of
600µS. The space between 2 transmitted codes when a button is being pressed is 40mS.The bits
are transmitted least significant bits first. The total length of a bit stream is always 45ms.

5. Sony Remote Button Assignment:


The Keys used to control the robot are shown in figure below:

Truth Table for keys:

Key Code(Binary)
1 0111
2 1111
3 1101
4 0011
5 0000
6 1100
7 0001
8 0101
9 0100

-7-
4. Circuit Schematic, Layout and
Assembly Top:

HBridge:
Circuit Schematic:

Layout:

-8-
Assembly Top:

PIC Board:
Circuit Schematic:

-9-
Layout:

Assembly Top:

- 10 -
5. DATA SHEETS:
ULN2003:
PIN DIAGRAM:

- 11 -
PIC16F877A:
PIN DIAGRAM:

- 12 -
Characteristics:

- 13 -
BLOCK DIAGRAM:

- 14 -
5. Program:
Device 16F877A
DEFINE OSC 20
sensor1 con PORTC.4
sensor2 con PORTC.5
time1 var Word
time2 var Word
time3 var Word
time4 var Word
time5 var Word
time6 var Word
time7 var Word
time8 var Word
time9 var Word
time10 var Word
time11 var Word
time12 var Word
ir_but var Byte
ir_dev var Byte
TRISC = %00110000
TRISB = %00000000
PORTB = %10000000
pause 100
While 1
getcode:
PulsIn sensor1, 0, time1
If time1 > 1075 Then
ir_but = $00
ir_dev = $00
PulsIn sensor1, 0, time1 ' Measure/store data pulses.
PulsIn sensor1, 0, time2
PulsIn sensor1, 0, time3
PulsIn sensor1, 0, time4
PulsIn sensor1, 0, time5
PulsIn sensor1, 0, time6
PulsIn sensor1, 0, time7
PulsIn sensor1, 0, time8
PulsIn sensor1, 0, time9
PulsIn sensor1, 0, time10
PulsIn sensor1, 0, time11
PulsIn sensor1, 0, time12
If time1 > 450 Then ir_but.0 = %1
If time2 > 450 Then ir_but.1 = %1
If time3 > 450 Then ir_but.2 = %1
If time4 > 450 Then ir_but.3 = %1
If time5 > 450 Then ir_but.4 = %1
If time6 > 450 Then ir_but.5 = %1
If time7 > 450 Then ir_but.6 = %1
If time8 > 450 Then ir_dev.0 = %1
If time9 > 450 Then ir_dev.1 = %1
If time10 > 450 Then ir_dev.2 = %1
If time11 > 450 Then ir_dev.3 = %1
If time12 > 450 Then ir_dev.4 = %1
GoSub move

- 15 -
EndIf
PulsIn sensor2, 0, time1
If time1 > 1075 Then
ir_but = $00
ir_dev = $00
PulsIn sensor2, 0, time1 ' Measure/store data pulses.
PulsIn sensor2, 0, time2
PulsIn sensor2, 0, time3
PulsIn sensor2, 0, time4
PulsIn sensor2, 0, time5
PulsIn sensor2, 0, time6
PulsIn sensor2, 0, time7
PulsIn sensor2, 0, time8
PulsIn sensor2, 0, time9
PulsIn sensor2, 0, time10
PulsIn sensor2, 0, time11
PulsIn sensor2, 0, time12
If time1 > 450 Then ir_but.0 = %1
If time2 > 450 Then ir_but.1 = %1
If time3 > 450 Then ir_but.2 = %1
If time4 > 450 Then ir_but.3 = %1
If time5 > 450 Then ir_but.4 = %1
If time6 > 450 Then ir_but.5 = %1
If time7 > 450 Then ir_but.6 = %1
If time8 > 450 Then ir_dev.0 = %1
If time9 > 450 Then ir_dev.1 = %1
If time10 > 450 Then ir_dev.2 = %1
If time11 > 450 Then ir_dev.3 = %1
If time12 > 450 Then ir_dev.4 = %1
' hserout ["Button ",#ir_but,10,13,"Device ",#ir_dev,10,13]
GoSub move
EndIf
Wend
move:
If ir_dev = 1 Then
If ir_but = %0 Then
PORTC.0 = %1
PORTC.1 = %1
PORTC.2 = %1
PORTC.3 = %0
ElseIf ir_but = %1 Then
PORTC.0 = %1
PORTC.1 = %1
PORTC.2 = %1
PORTC.3 = %1
ElseIf ir_but = $2 Then
PORTC.0 = %1
PORTC.1 = %0
PORTC.2 = %1
PORTC.3 = %1
ElseIf ir_but = $3 Then
PORTC.0 = %1
PORTC.1 = %1
PORTC.2 = %0
PORTC.3 = %0
ElseIf ir_but = $4 Then
PORTC.0 = %0

- 16 -
PORTC.1 = %0
PORTC.2 = %0
PORTC.3 = %0
ElseIf ir_but = $5 Then
PORTC.0 = %0
PORTC.1 = %0
PORTC.2 = %1
PORTC.3 = %1
ElseIf ir_but = $6 Then
PORTC.0 = %1
PORTC.1 = %0
PORTC.2 = %0
PORTC.3 = %0
ElseIf ir_but = $7 Then
PORTC.0 = %1
PORTC.1 = %0
PORTC.2 = %1
PORTC.3 = %0
ElseIf ir_but = $8 Then
PORTC.0 = %0
PORTC.1 = %0
PORTC.2 = %1
PORTC.3 = %0
EndIf
EndIf
Return
End

- 17 -

You might also like