Académique Documents
Professionnel Documents
Culture Documents
Every autonomous robot has a processor which accepts input signals from
various sensors, analyzes them and decides an appropriate action.
MICROCONTROLLER
Data storage and processing is an integral part of any automatic control
system.The need to have a device ,so called “microcontroller”,which allows
controlling and sequencing of these machines and processes. Further ,with
help of microcontroller,it is possible to carry out simple arthimetic and logical
operations.
80C51
Atmega AVR
P89V51RD2
The P89V51RD2 is an 80C51 microcontroller with 64 kB Flash and 1024
bytes of
data RAM.
Features
1,80C51 Central Processing Unit
5 V Operating voltage from 0 to 40 MHz
64 kB of on-chip Flash program memory with ISP (In-System Programming)
Supports 12-clock (default) or 6-clock mode selection via software or ISP
SPI (Serial Peripheral Interface) and enhanced UART
Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each)
Three 16-bit timers/counters
TTL- and CMOS-compatible logic levels
Crystal of frequency 12MHz is used.
PIN DIAGRAM
I/O PORTS
80C51 has 4 I/O ports
Each port is 8 bit wide
PIN DESCRIPTION
SYMBOL PIN NO. TYPE DESCRIPTION
PSEN 29 I\O Program Store
Enable: PSEN is
the read strobe for
external program
memory. When the
device is executing
from internal
program memory,
PSEN is inactive
(HIGH). When the
device is executing
code from external
program memory
PSEN is active low
RST 9 I Reset: While the
oscillator is running,
a HIGH logic state
on this pin for two
machine cycles will
reset the device
EA 31 I External Access
Enable: EA must be
connected to VSS
in order to enable
the device to fetch
code from the
external program
memory. EA must
be strapped to VDD
for internal program
execution
XTAL1 15 I Crystal 1: Input to
the inverting
oscillator amplifier
and
input to the internal
clock generator
circuits.
XTAL1 14 O Crystal 2: Output
from the inverting
oscillator amplifier
Vdd 40 I Power supply
GND
Vss 20 I
Once you are familiar with 80C51 hardware ,the next step is programming.
I f you are using kits given by TRI use TRIC as compiler and and flashmagic for
burning the hex file.
Steps for using TRIC is similar to as shown below for keil but instead for keil
you will use TRIC.
3.Select Atmel->AT89C51
4.After device selection a pop up will appear asking for inclusion of file ,select
NO.
5.Select new from file(menu bar) and select new ,a blank page would
appear.Save that page with extension “.c”example motor.c.
6.Add file to your project by clicking selecting target 1 in project
workspace-.right click on source group1 a ->select add file and browse to the
location of your file and add it.
7.Write your program and and then build it by selecting “build target” from
project(menu bar).
8.For creating hex file choose “options of target” -> selct create hex file in
output tab.
Sample program for turning 2 motors alternatively
sbit MTR_1=P1^1;
sbit MTR_2=P1^2;
void main()
unsigned char x, y;
for(x=0;x<1275;x++)
for(y=0;y<value;y++)
}}
PIC-mikroc
AVR-AVR studio
8051-keil
Programmer
For burning the “hex file” into microcontroller you need a hardware for
burning the code.
For 8051 and PIC16fxx program is burned using serial communication and if
you are using a laptop you need a serial to USB converter which is easily
available in market.
Sensors
When u build an autonomous robot sensors are required for interacting with
external environment and taking the appropriate action ofter receiving inputs
from sensors.
Blackened LED is transmitter and it transmits infra-red rays which hits the surface and after
reflection from the surface it is received by reciver(transperent LED),since differnt colors
have different emmisivity it can easily distinguish between black and white surface.
These sensors can be callibrated by adjusting the potentiometer on the top of the sensor
module.
When sensors is on (led on sensor glows) O/P of sensor is HIGH i.e. +5V .
Precaution:Do not use 2 sensors close to each ,they might interfere with each other.
These are infrared sensors and are used for detecting the obstacle.
These sensors can be callibrated by adjusting the potentiometer on the top of the sensor
module.
5.DC motor:
It is an electromechanical device.Magnetic coils are excited by supplying
voltage.
They are 2 wires (RED and BLACK) ,the working of motor is controlled by giving
right combination of volatge to these 2 wires.
R B O/P
H H Motor stops
H=+5V
L=GND
R=Red wire
B=Black wire
For turning right stop your right motor and move forward your left motor.
For turning left stop your left motor and move forward your right motor.
Motor Driver
When an enable input is high, the associated drivers are enabled, and their outputs
are active and in phase with their inputs. .
When the enable input is low, those drivers are disabled, and their outputs are off
and in a high-impedance state.
The voltage at which you want to run the motor is given to pin number 8
i.e.VCC2,this voltage can either be your battery potential (9V) or 5V depending upon
the motor specification and speed requirement.
For using DC motor with L293D connect red wire of motor to O/P of channel
IC used :7805
I/P voltage>=Vout +2
www.embedded.com
www.sonsivri.com