Escolar Documentos
Profissional Documentos
Cultura Documentos
Submitted by
NITHIN KP
PRAVEESH A
PREETHY P THANKAPPAN
PREJITH S
KOZHIKODE-673 005
OCTOBER 2009
Mini Project 2009 Programmable Robot Using PICAXE-08M
ACKNOWLEDGEMENTS
Last but not least our course mates who have provided
me with invaluable advice and help.
.
Mini Project 2009 Programmable Robot Using PICAXE-08M
KOZHIKODE
CERTIFICATE
Certified that this is the bonafide record of the mini project work titled
during the year 2009 in partial fulfillment of the requirements for the award of the degree
of Bachelor of Technology in Applied Electronics & Instrumentation Engineering of
University of Calicut.
ABSTRACT
This project explores the processes and design requirements for a
programmable robot which can sense the ambient light intensity and
move towards the brightest point in a given area. The robot is
capable of detecting and avoiding any obstructions in front of it
while moving with audio indication. Instead of using the typical
microcontrollers, we have chosenPICAXE-08M microcontroller as our
robot’s brain. One of the chief advantages of using the PICAXE
microcontroller over the conventional PIC microcontroller is that, it is
easily programmable and the programmer circuit can be integrated
to the project circuitry with ease. Also, the microcontroller can be
programmed in BASIC which is much simpler compared to other
programming languages. Thus the easy reprogramming of the robot
is easily achieved. The robot senses the light intensity with the help
of a LDR and obstruction detection is done by using a bump switch
installed on the robot.
Mini Project 2009 Programmable Robot Using PICAXE-08M
CONTENTS
1. Introduction
2. The Concept
3. Functional Block Diagram
4. Component description
5. Circuit Diagram
6. PICAXE-08M
7. Motor Driver Circuit
8. List of Components
9. PCB Layout
10. Programming the PICAXE
11. Flow Chart and Program description
12. Applications
13. Conclusion
14. Future Scope
15. Bibliography
16. References
Mini Project 2009 Programmable Robot Using PICAXE-08M
INTRODUCTION
1
Mini Project 2009 Programmable Robot Using PICAXE-08M
THE CONCEPT
2
Mini Project 2009 Programmable Robot Using PICAXE-08M
PICAXE-08M
OBSTRUCTION
MOTOR DRIVER
DETECTION
L R
MOTOR MOTOR
3
Mini Project 2009 Programmable Robot Using PICAXE-08M
4
Mini Project 2009 Programmable Robot Using PICAXE-08M
COMPONENT DESCRIPTION
PICAXE-08M MICROCONTROLLER
L393D-MOTOR DRIVING IC
6
Mini Project 2009 Programmable Robot Using PICAXE-08M
BC 547
7
Mini Project 2009 Programmable Robot Using PICAXE-08M
9V BATTERY
LDR
The light sensing circuit of the robot consists of mainly an LDR.Its
resistance varies with the variations in the light intensity falling on it.
MOTORS
The Robot is designed to move on wheels. Two motor-powered
wheels and a castor wheel are provided for this. Two geared dc-
motors of the following specifications were used.
• 6 Volts DC motors
8
Mini Project 2009 Programmable Robot Using PICAXE-08M
• Weight = 90gms
• Rated Voltage = DC 6V
BUZZER
9
Mini Project 2009 Programmable Robot Using PICAXE-08M
CIRCUIT DIAGRAM
CIRCUIT DESCRIPTION
The circuit is built around a PICAXE-08M microcontroller.The Vcc for the
microcontroller is given from a 7805 voltage regulator which regulates
the supply voltage to 5V.Picaxe is operated at 4MHz frequency and the
built in oscillator generates this. The programming circuit consists of a
3.5 mm stereo socket, a 10k resistor and a 22 k resistor. The
microcontroller communicates with the PC via pin 2(serial in ) and pin
7(serial out). The 22k resistor clamps the serial voltage to 5V to prevent
damage to the chip. Serial in or pin 2 of the PICAXE should never be left
floating and the 10k resistor is used to ground it whenever it is not
connected to PC for programming. Pin 1 and Pin 8 are connected to the
positive power supply and the ground respectively.
10
Mini Project 2009 Programmable Robot Using PICAXE-08M
12
Mini Project 2009 Programmable Robot Using PICAXE-08M
PICAXE-08M MICROCONTROLLER
80 lines memory
1-4 inputs (configurable)
1-4 outputs (configurable)
2 8/10-bit Analog-to-Digital converters (ADC)
8MHz maximum operation speed (4MHz normally)
Supports
o Interrupts
o Digital temperature sensors
13
Mini Project 2009 Programmable Robot Using PICAXE-08M
o Servo control
o IR transmit/receive
o Plays user-defined musical tones
o PWM Motor control
Program Memory.
Data Memory
14
Mini Project 2009 Programmable Robot Using PICAXE-08M
RAM (Variables)
Storage Variables.
The special function variables available for use depend on the PICAXE
type.
PICAXE-08M SFR
15
Mini Project 2009 Programmable Robot Using PICAXE-08M
16
Mini Project 2009 Programmable Robot Using PICAXE-08M
The motor driver circuit is built around the high current half H -Bridge
IC LN 293D. For each motor connected, if the Enable is kept high and
DIR1 is made high, then the motor will rotate in the clockwise
direction. If Enable and DIR2 is made high, then the motor will rotate
in the ant-clockwise direction. If both DIR1 and DIR2 are kept at high,
then the motor will remain static. If enable is low, then the motor
remains static. The inputs DIR1 and DIR2 of each motor are driven by
outputs from the Pin 3(P4) and Pin 5(P2) of the PICAXE.
enable input is high the associated drivers are enabled and their
outputs are active and in phase with their inputs. When the ena ble
input is low, those drivers are disabled and their outputs are off and
in the high-impedance state. With the proper data inputs, each pair
of drivers forms a full-H (or bridge) reversible drive suitable for
solenoid or motor applications. A VCC1 terminal, separate from
VCC2, is provided for the logic inputs to minimize device power
dissipation. The L293D is characterized for operation from 0°C to
70°C.
18
Mini Project 2009 Programmable Robot Using PICAXE-08M
Input voltage, VI . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 7 V
…………………………………………………………………. . . . . . …………….2075 mW
19
Mini Project 2009 Programmable Robot Using PICAXE-08M
LIST OF COMPONENTS
COMPONENT DESCRIPTION QUANTITY
PICAXE-08M MICROCONTROLLER 1
BC 547 2
VOLTAGE L7805,5V 1
REGULATOR
RESISTORS R1",22k, ¼ WATT
R2",10k,
R5",10k,
R6",10k,
R3",1k,
R4",1k,
R7",330,
R8",330,
R9",47k,
10K POT
CAPACITORS C1",100n, C2",100n,
C3",100u,
C4",100u,
C5",10u,
LDR 1
SPEAKER 1
CONNECTOR 1
DIODE 1N4001 1
BUMP SWITCH 1
20
Mini Project 2009 Programmable Robot Using PICAXE-08M
PCB LAYOUT
21
Mini Project 2009 Programmable Robot Using PICAXE-08M
The serial download circuit is identical for all PICAXE chips. It consists
of 3 wires from the PICAXE chip to the AXE026 serial cable. One wire
sends data from the computer to the serial input of the PICAXE, one
wire transmits data from the serial output of the PICAXE to the
computer, and the third wire provides a common ground. See the
USB adapter section for details on how to use the USB port adapter.
The minimum download circuit is shown here. This circuit is
appropriate for most educational and hobbyist work.
22
Mini Project 2009 Programmable Robot Using PICAXE-08M
23
Mini Project 2009 Programmable Robot Using PICAXE-08M
24
Mini Project 2009 Programmable Robot Using PICAXE-08M
SUBROUTINES
25
Mini Project 2009 Programmable Robot Using PICAXE-08M
PROGRAM
MAIN PROGRAM
main:
if pin3=1 then reverseout 'reverse if S1 bumper bar closes
pause 2000 'pause for two seconds
readadc 1,b1 'check light level directly in front
gosub checkleft 'turn left, using subroutine
readadc 1,b0 'check light level to the left
gosub checkright 'turn right, using subroutine
readadc 1,b2 'check light level to the right
if b0<b2 then left 'if the left is brighter than the right,
' turn left, using subroutine
if b1<b0 then left 'if directly in front is brighter than
' the left, provisionally use subroutine
goto main 'repeat the process
reverseout:
pwm 1,21,20 'beep
high 2 'left motor backwards
high 4 'right motor backwards
high 0 'turn both motors on
for b0=0 to 40 'add a sound effect while reversing
pwm 1,b0,10 ' by varying the PWM duty cycle
26
Mini Project 2009 Programmable Robot Using PICAXE-08M
checkleft:
high 2 'left motor backwards
low 4 'right motor forwards
high 0 'turn both motors on
pause 600 ' for 0.6 seconds
low 0 'turn both motors off
return 'return to where the main program
left off
checkright:
low 2 'left motor forwards
high 4 'right motor backwards
high 0 'turn both motors on
pause 1200 ' for 1.2 seconds
low 0 'turn both motors off
return
left:
if b1<b0 then middle 'skip this if directly in front is
brighter
' than the left, using subroutine middle
high 2 'left motor backwards
low 4 'right motor forwards
27
Mini Project 2009 Programmable Robot Using PICAXE-08M
middle:
high 2 'left motor backwards
low 4 'right motor forwards
high 0 'turn both motors on
pause 600 ' for 0.6 seconds
low 0 'turn both motors off
goto straight 'drive straight ahead, using subroutine
goto main
straight:
low 2 'left motor forwards
low 4 'right motor forwards
high 0 'turn both motors on
pause 1200 ' for 1.2 seconds
low 0 'turn both motors off
goto main
28
Mini Project 2009 Programmable Robot Using PICAXE-08M
main:
readadc 1,b3 ;read the light level
debug b3 ;display the light level on screen (watch b3)
pause 100 ;pause 0.1 seconds
goto main ;repeat the procedure
29
Mini Project 2009 Programmable Robot Using PICAXE-08M
APPLICATION
30
Mini Project 2009 Programmable Robot Using PICAXE-08M
CONCLUSION
31
Mini Project 2009 Programmable Robot Using PICAXE-08M
FUTURE SCOPE
32
Mini Project 2009 Programmable Robot Using PICAXE-08M
BIBLIOGRAPHY
33
Mini Project 2009 Programmable Robot Using PICAXE-08M
REFERENCES
1. www.microchip.com
2. www.wikipedia.com
3. www.roboticsindia.com
4. www.electro-tech-online.com
5. www.howstuffworks.com
6. www.picaxe.co.uk
7. http://www.picaxeforum.co.uk
34