Anda di halaman 1dari 25

REMOTE CONTOL ROBOTIC CAR

INTRODUCTION TO ROBOTS
Robotics is the study of robots. Robots
are machines that can be used to do
jobs. It helps to reduce the human
efforts and provide them ease. These
technologies deal with automated
machines that can take the place of
humans. Today, robotics is a rapidly
growing field, as technological
advances continue; researching, designing, and building new
robots that serves various practical purposes.
For example: robotic arm can move large objects, robotics
airplanes can fly without a pilot control and many more.
A robot is a mechanical or virtual artificial agent, usually an
electro-mechanical machine that is guided by a computer
program or electronic circuitry. Robots can be autonomous or
semi-autonomous and range from humanoids such as Honda's
Advanced Step in Innovative Mobility (ASIMO) and TOSY's TOSY
Ping Pong Playing Robot (TOPIO) to industrial robots, medical
operating robots, patent assist robots, dog therapy robots,
collectively programmed swarm robots, UAV drones such as
General Atomics MQ-1 Predator, and even microscopic nano
robots.
The branch of technology that deals with the design, construction,
operation, and application of robots, as well as computer systems
for their control, sensory feedback, and information processing is
robotics. These technologies deal with automated machines that
can take the place of humans in dangerous environments or

manufacturing processes, or resemble humans in appearance,


behavior, and cognition.

REQUIRMENTS TO BUILD A ROBOT:


Firstly, a robot has some kind of frame, form or shape
designed to achieve a particular task. For example, a robot
designed to travel across heavy dirt or mud, might use
caterpillar tracks.
Robots have electrical components which power and control
the machinery. For example, a robotic car would need some
kind of power to move forward, backward, left or right.
The electrical aspect of robots is used for movement
(through motors), sensing and operation. Robots need some
level of electrical energy supplied to their motors and
sensors in order to activate and perform basic operations.
All robots contain some level of computer programming
code. A program is how a robot decides when or how to do
something. A robot with remote control programming has a
preexisting set of commands that it will only perform if and
when it receives a signal from a control source.

SIMPLE REMOTE CONTROL ROBOTIC CAR:

COMPONENTS : a dc motor, L293D- 16 pin IC, PIC16F887A


microcontroller, 12V battery, one chassis, 2 wheel, caster wheel,
DPDT switches.

1. DC MOTOR :
A dc motor is a motor that
converts direct current electric
power into mechanical power. Most
types of dc motor produce rotary
motion. It works on the principle,
when a current carrying conductor
is placed in a magnetic field, it
experiences a torque and has a
tendency to move .this is known as
motoring action. It helps the
robot to move forward, backward, left and right. So it is one of the
main component of a robotic car.

2.L293D MOTOR DRIVER :


L293D is a dual H-bridge motor driver integrated circuit (IC).
Motor drivers act as current amplifiers since they take a lowcurrent control signal and provide a higher-current signal. This
higher current signal is used to drive the motors.

L293D contains two inbuilt H-bridge driver


circuits. In its common mode of operation,
two DC motors can be driven
simultaneously, both in forward and
reverse direction. The motor operations of
two motors can be controlled by input logic
at pins 2 & 7 and 10 & 15. Input logic 00 or
11 will stop the corresponding motor. Logic
01 and 10 will rotate it in clockwise and
anticlockwise directions, respectively.
Enable pins 1 and 9 (corresponding to the
two motors) must be high for motors to
start operating. When an enable input is
high, the associated driver gets enabled. As
a result, the outputs become active and work in phase with their
inputs. Similarly, when the enable input is low, that driver is
disabled, and their outputs are off and in the high-impedance
state.

WORKING OF L293D
There are two drive pins on L293D. Pin 1 (left H-bridge) and pin 9
(right H-bridge). To turn ON the corresponding motor, pin 1 or 9
need to be set to HIGH. If either pin 1 or pin 9 goes low then the
motor in the corresponding section will go OFF (high impedance).
These inputs (1 and 9) are the ones that should be used to control
motor START/STOP and motor speed under PWM, since there
would be high impedance output during low semi period of PWM,
it would not provoke overload of the L293D when the motor is
turning. Thus, PWM or motor ON/OFF control should never be
input to pins 2, 7, 15, 10, which should only be used to control
direction (Clockwise - Counterclockwise). The direction-defining
four Input pins for the L293D are pin 2 and 7 on the left and pin
15 and 10 on the right as shown on the pin diagram. Left input
pins will determine the rotation of motor connected on the left

side and right input for motor on the right hand side. The motors
are rotated on the basis of the inputs provided at the input pins as
LOGIC 1 or LOGIC 0.

DC MOTOR AND L293D


We cant drive a DC Motor (depends) directly with a
Microcontroller, as DC Motors requires high current and high
voltage than a Microcontroller can handle. Microcontrollers usually
operates at +5 or +3.3V supply and it I/O pin can provide only up
to 25mA current. Commonly used DC Motors requires 12V supply
and 300mA current, moreover interfacing DC Motors directly with
Microcontrollers may affect the working of Microcontroller due to
the Back EMF of the DC Motor. Thus it is clear that, it not a good
idea to interface DC Motor directly with Microcontrollers.
L293D IC is a dual H-bridge motor driver, i.e. by using one IC we
can control two DC Motors in both clock wise and counter
clockwise directions. The L293D can provide bidirectional drive
currents of up to 600-mA at voltages from 4.5 V to 36 V. This IC is
designed to drive inductive loads such as dc motors, bipolar
stepping motors, relays and solenoids as well as other highcurrent or high-voltage loads in positive-supply applications. All
inputs of the IC are TTL compatible and output clamp diodes for
inductive transient suppression are also provided internally. These
diodes protect our circuit from the Back EMF of DC Motor.
In the IC, drivers are enabled in pairs, with drivers 1 and 2 are
enabled by a high input to 1,2EN and drivers 3 and 4 are enabled
by a high input to 3,4EN. When drivers are enabled, their outputs
will be active and in phase with their inputs. When drivers are
disabled, their outputs will be off and will be in the highimpedance state.

3. PIC MICROCONTROLLER:

PIC microcontrollers are electronic circuits that can be


programmed to carry out a vast range of tasks. The name PIC
initially referred to Peripheral Interface Controller. Later it has
been changed to Programmable Intelligent Computer. PIC
microcontroller is fast and easy to implement program when we
compare other microcontrollers like 8051. The ease of
programming and easy to interfacing with other peripherals PIC
became successful microcontroller
PIC is a family of modified Harvard architecture microcontrollers
made by Microchip Technology, derived from the PIC1650
originally developed by General Instrument's Microelectronics
Division. The name PIC initially referred to Peripheral Interface
Controller. The first parts of the family were available in 1976; by
2013 the company had shipped more than twelve billion
individual parts, used in a wide variety of embedded systems.
Early models of PIC had read-only memory (ROM) or fieldprogrammable EPROM for program storage, some with provision
for erasing memory. All current models use Flash memory for
program storage, and newer models allow the PIC to reprogram
itself. Program memory and data memory are separated. Data
memory is 8-bit, 16-bit and in latest models, 32-bit wide. Program
instructions vary in bit-count by family of PIC, and may be 12, 14,
16, or 24 bits long. The instruction set also varies by model, with
more powerful chips adding instructions for digital signal
processing functions.
PIC devices are popular with both industrial developers and
hobbyists due to their low cost, wide availability, large user base,
extensive collection of application notes, and availability of low
cost or free development tools, serial programming, and reprogrammable Flash-memory capability.

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 (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.[7]
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
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.

ADVANTAGES

Small instruction set to learn


RISC architecture
Built-in oscillator with selectable speeds
Easy entry level, in-circuit programming plus in-circuit
debugging PIC kit units available for less than $50
Inexpensive microcontrollers
Wide range of interfaces including IC, SPI, USB, USART, A/D,
programmable comparators, PWM, LIN, CAN, PSP, and
Ethernet[9]
Availability of processors in DIL package makes them easy to
handle for hobby use.

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 use the accumulator only.

PIC 16F877A
The PIC microcontroller PIC16F877A is one of the most renowned
microcontrollers in the industry. This controller is very convenient
to use, the coding or programming of this controller is also easier.
One of the main advantages is that it can be write-erase as many
times as possible because it use FLASH memory technology. It has
a total number of 40 pins and there are 33 pins for input and

output. PIC16F877A is used in many pic microcontroller projects.


PIC16F877A also have many applications in digital electronics
circuits
PIC16f877a finds its applications in a huge number of devices. It is
used in remote sensors, security and safety devices, home
automation and in many industrial instruments. An EEPROM is
also featured in it which makes it possible to store some of the
information permanently like transmitter codes and receiver
frequencies and some other related data. The cost of this
controller is low and its handling is also easy. Its flexible and can
be used in areas where microcontrollers have never been used
before as in coprocessor applications and timer functions etc.
We know that microcontroller is an integrated chip which consists
of RAM, ROM, CPU, TIMERS, COUNTERS etc. PIC is a
microcontroller which also consists of ram, rom, CPU, timers,
counter, ADC (analog to digital converters), DAC (digital to analog
converter). PIC also supports the protocols like CAN, SPI, UART for
interfacing with other peripherals. PIC mainly used modified
Harvard architecture and also supports RISC (Reduced Instruction
Set Computer) by the above specification RISC and Harvard we
can easily that PIC is faster than the 8051 based controller which
is made-up of Von-Newman architecture.
Microcontroller PIC16F887A is the heart of the robotic car.
It is used for programming the car by means of a program
coding.

DESCRIPTION:
Microchip PIC16F877A Microcontroller Features

High-Performance RISC CPU


Operating speed: 20 MHz, 200 ns instruction cycle
Operating voltage: 4.0-5.5V
Industrial temperature range (-40 to +85C)
15 Interrupt Sources
35 single-word instructions
All single-cycle instructions except for program branches
(two-cycle)

Special Microcontroller Features :

Flash Memory: 14.3 Kbytes (8192 words)


Data SRAM: 368 bytes
Data EEPROM: 256 bytes
Self-reprogrammable under software control
In-Circuit Serial Programming via two pins (5V)
Watchdog Timer with on-chip RC oscillator
Programmable code protection
Power-saving Sleep mode
Selectable oscillator options
In-Circuit Debug via two pins

Peripheral Features :

33 I/O pins; 5 I/O ports


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
16-bit Capture input; max resolution 12.5 ns
16-bit Compare; max resolution 200 ns
10-bit PWM
Synchronous Serial Port with two modes:
SPI Master

I2C Master and Slave


USART/SCI with 9-bit address detection
Parallel Slave Port (PSP)
8 bits wide with external RD, WR and CS controls
Brown-out detection circuitry for Brown-Out Reset

Analog Features:

10-bit, 8-channel A/D Converter


Brown-Out Reset
Analog Comparator module
2 analog comparators
Programmable on-chip voltage reference module
Programmable input multiplexing from device inputs and
internal VREF
Comparator outputs are externally accessible

PIN DESCRIPTION OF PIC16F877A :

PIN 1: MCLR
The first pin is the master clear pin of this IC. It resets the
microcontroller and is active low, meaning that it should
constantly be given a voltage of 5V and if 0 V are given then the
controller is reset. Resetting the controller will bring it back to the
first line of the program that has been burned into the IC.
A push button and a resistor is connected to the pin. The pin is
already being supplied by constant 5V. When we want to reset the
IC we just have to push the button which will bring the MCLR pin
to 0 potential thereby resetting the controller.
PIN 2: RA0/AN0

PORTA consists of 6 pins, from pin 2 to pin 7, all of these are


bidirectional input/output pins. Pin 2 is the first pin of this port.
This pin can also be used as an analog pin AN0. It is built in
analog to digital converter.
PIN 3: RA1/AN1
This can be the analog input 1.
PIN 4: RA2/AN2/VrefIt can also act as the analog input2. Or negative analog reference
voltage can be given to it.
PIN 5: RA3/AN3/Vref+
It can act as the analog input 3. Or can act as the analog positive
reference voltage.
PIN 6: RA0/T0CKI
To timer0 this pin can act as the clock input pin, the type of
output is open drain.
PIN 7: RA5/SS/AN4
This can be the analog input 4. There is synchronous serial port in
the controller also and this pin can be used as the slave select for
that port.
PIN 8: RE0/RD/AN5
PORTE starts from pin 8 to pin 10 and this is also a bidirectional
input output port. It can be the analog input 5 or for parallel slave
port it can act as a read control pin which will be active low.
PIN 9: RE1/WR/AN6
It can be the analog input 6. And for the parallel slave port it can
act as the write control which will be active low.

PIN 10: RE2/CS/A7


It can be the analog input 7, or for the parallel slave port it can
act as the control select which will also be active low just like
read and write control pins.
PIN 11 and 32: VDD
These two pins are the positive supply for the input/output and
logic pins. Both of them should be connected to 5V.
PIN 12 and 31: VSS
These pins are the ground reference for input/output and logic
pins. They should be connected to 0 potential.
PIN 13: OSC1/CLKIN
This is the oscillator input or the external clock input pin.
PIN 14: OSC2/CLKOUT
This is the oscillator output pin. A crystal resonator is connected
between pin 13 and 14 to provide external clock to the
microcontroller. of the frequency of OSC1 is outputted by OSC2
in case of RC mode. This indicates the instruction cycle rate.
PIN 15: RC0/T1OCO/T1CKI
PORTC consists of 8 pins. It is also a bidirectional input output
port. Of them, pin 15 is the first. It can be the clock input of timer
1 or the oscillator output of timer 2.
PIN 16: RC1/T1OSI/CCP2
It can be the oscillator input of timer 1 or the capture 2
input/compare 2 output/ PWM 2 output.
PIN 17: RC2/CCP1
It can be the capture 1 input/ compare 1 output/ PWM 1 output.

PIN 18: RC3/SCK/SCL


It can be the output for SPI or I2C modes and can be the
input/output for synchronous serial clock.
PIN 23: RC4/SDI/SDA
It can be the SPI data in pin. Or in I2C mode it can be data
input/output pin.
PIN 24: RC5/SDO
It can be the data out of SPI in the SPI mode.
PIN 25: RC6/TX/CK
It can be the synchronous clock or USART Asynchronous transmit
pin.
PIN 26: RC7/RX/DT
It can be the synchronous data pin or the USART receive pin.
PIN 19, 20,21,22,27,28,29,30:
All of these pins belong to PORTD which is again a bidirectional
input and output port. When the microprocessor bus is to be
interfaced, it can act as the parallel slave port.
PIN 33-40: PORT B
All these pins belong to PORTB. Out of which RB0 can be used as
the external interrupt pin and RB6 and RB7 can be used as incircuit debugger pins.

INTERFACING PIC MICROCONTROLLER WITH L293D :

Interfacing of PIC 16f877A with L293D is shown in fig.


PORT B of PIC microcontroller is used as an input port, where
remote of the car is connected. The remote consists of double
pole double throw (DPDT) switches, which are used for giving
commands to the robotic car. i.e. to move forward, backward, left
or right.
A DPDT switch is a switch that has two inputs and four outputs;
each input has two corresponding outputs that it can connect to
it.
Poles: A switch pole refers to the number of separate circuits that
the switch controls. A single- pole switch controls just one circuit.
A double-pole switch controls two separate circuits.

Throw: the number of throws indicates how many different output


connections each switch pole can connects its input to.
PORT C of the PIC 16F877A is used as output port. This output
acts as an input to the L293D IC. The output pins RC0, RC1, RC2,
RC3 are connected to the corresponding input pin number 2, 7,
10, 15 of L293D respectively, which acts as input to the two DC
motors connected to the L293D. The motor operations of the two
motors can be controlled by input logic at pins 2 & 7 and 10 &
15. Input logic 00 or 11 will stop the corresponding motor. Logic
10 and 01 will rotate it in clockwise and anticlockwise directions,
respectively. Hence the wheels attached to the motors will also
rotate and gets to move in either forward or backward direction.

LOGIC AT EACH PORT

DESCRIPTION OF MOVEMENT OF THE ROBOTIC CAR:


STOP: Instructions to the robotic car is given by the remote by
means of DPDT switches. When both the switches are off, the
corresponding input 0, 0, 0, 0 appears on the input pins RB0, RB1,
RB2, RB3 (PORT B) of the microcontroller. This is taken as output
from pins RC0, RC1, RC2, RC3 (PORT C) and applied as input to

L293D. The logic 00 and 00 will stop both the motors connected
to the L293D and hence the robotic car remains in stationary
condition.
FORWARD: When both the switches are pushed in forward
direction, the corresponding input 1, 0, 1, 0 appears on the input
pins RB0, RB1, RB2, RB3 (PORT B) of the microcontroller. This is
taken as output from pins RC0, RC1, RC2, RC3 (PORT C) and
applied as input to L293D. The logic 10 and 10 will rotate both the
motors connected to the L293D in clockwise direction and hence
the robotic car moves in forward direction.
BACKWARD: When both the switches are pushed in backward
direction, the corresponding input 0, 1, 0, 1 appears on the input
pins RB0, RB1, RB2, RB3 (PORT B) of the microcontroller. This is
taken as output from pins RC0, RC1, RC2, RC3 (PORT C) and
applied as input to L293D. The logic 01 and 01 will rotate both the
motors connected to the L293D in anti clockwise direction and
hence the robotic car moves in backward direction.
RIGHT: When the left switch is pushed in forward direction and
the right switch is pushed in backward direction , the
corresponding input 1, 0, 0, 1 appears on the input pins RB0, RB1,
RB2, RB3 (PORT B) of the microcontroller. This is taken as output
from pins RC0, RC1, RC2, RC3 (PORT C) and applied as input to
L293D. The logic 10 and 01 will rotate the left motor in clockwise
direction and the right motor in anti clockwise direction connected
to the L293D and hence the robotic car moves in right direction.
LEFT: When the right switch is pushed in forward direction and
the left switch is pushed in backward direction , the corresponding
input 0, 1, 1, 0 appears on the input pins RB0, RB1, RB2, RB3
(PORT B) of the microcontroller. This is taken as output from pins
RC0, RC1, RC2, RC3 (PORT C) and applied as input to L293D. The
logic 01 and 10 will rotate the right motor in clockwise direction

and the left motor in anti clockwise direction connected to the


L293D and hence the robotic car moves in left direction.

HOW TO PROGRAM THE INPUT AND OUTPUT PORTS


OF PIC16F877A
There are five input and output ports namely PORT A, PORT B,
PORT C, PORT D and PORT E which can be digital as well as
analog. In analog mode, the ports can only act as inputs. In digital
mode, they can act as both input and output ports.
We can configure the ports as input or output port by
programming the TRIS register which controls the direction of
ports that is sending and receiving of data. For different ports
there are different registers such as TRISA, TRISB etc.
If we set a bit of the TRIS register to 0, the corresponding port bit
will act as the digital output.
If we set a bit of the TRIS register to 1, the corresponding port bit
will act as the digital input.
For example: to set the whole PORT B to input we can write the
program statement as:
TRISB=255;
Now the whole PORT B will act as the input port.
PORT A and PORT B are default analog port.
To make them digital port following instructions are used:
ANSEL=0; To make PORTA digital.
ANSELH=0; To make PORTB digital.

PROGRAM TO DRIVE THE MOTORS OF REMOTE


CONTROL ROBOTIC CAR
void main()
ANSELH=0;
TRISB=255;
TRISC=0;
while(1)
{
if(portb.f0==0&&portb.f1==0&&portb.f2==0&&portb.f3==0)
{
portc.f0=0;

//STOP

portc.f1=0;
portc.f2=0;
portc.f3=0;
}
if(portb.f0==0&&portb.f1==1&&portb.f2==1&&portb.f3==0)
{
portc.f0=0;

//LEFT

portc.f1=1;
portc.f2=1;
portc.f3=0;
}
if(portb.f0==1&&portb.f1==0&&portb.f2==0&&portb.f3==1)

{
portc.f0=1;

//RIGHT

portc.f1=0;
portc.f2=0;
portc.f3=1;
}
if(portb.f0==0&&portb.f1==1&&portb.f2==0&&portb.f3==1)
{
portc.f0=0;

//BACKWARD

portc.f1=1;
portc.f2=0;
portc.f3=1;
}
if(portb.f0==1&&portb.f1==0&&portb.f2==1&&portb.f3==0)
{
portc.f0=1;

//FORWARD

portc.f1=0;
portc.f2=1;
portc.f3=0;
}
delay(500);}

//Delay of 500 milliseconds

CONTENTS

1)Introduction to robotics
2)Requirements to build a robot
3)Components of remote control robotic car
a) DC motor
b)L293D motor driver IC
c) PIC Microcontroller
4)Core architecture of PIC Microcontroller
5)Introduction to PIC16F877A microcontroller
6)Pin description of PIC16F877A
7)Interfacing PIC microcontroller with L293D IC
8)Description of the movement of robotic car
9)How to program the input and output ports of
PIC16F877A microcontroller.
10) Program to drive the motors of remote control robotic
car

A
Seminar report
On
REMOTE CONTROL ROBOTIC CAR

Submitted
In Partial Fulfillment of the Requirements
For the Degree of

BACHELOR OF TECHNOLOGY
In

Electronics & Communication Engineering


By

Shweta Kumari
(1318731109)
Under the Supervision of
Mr. Digvijay Singh Chauhan

Department of Electronics & Communication Engineering


FEROZE GANDHI INSTITUTE OF ENGINEERING ANDTECHNOLOGY
RAEBARELI
March-2016

REFERENCES

1. IEEE(Institute of electrical and electronics engineers)


journal on robotics and automation
2. Robotics news and articles- Robotic technology
3. Robotics and automation magazine(RAM)
4. The International journal of robotics research(IJRR)
5. Robotic Systems-Applications, control and
programming
6. Remote control robotic car- Embed Journal

Anda mungkin juga menyukai