CODE
This
project
was
coded
in
BASIC
on
the
PICAXE-20M
IC
chip.
When
the
program
starts,
outputs
3
and
7
are
turned
on,
which
activate
the
transistors
in
each
H-
bridge
that
makes
each
motor
turn
in
the
forward
direction.
The
robot
keeps
going
forward
until
input
0
or
2
receives
a
high
value
from
a
pushbutton
on
the
front
of
the
robot
(meaning
it
hit
a
wall).
At
this
point
a
sound
is
played
through
the
speaker
on
output
4,
then
runs
its
turning
procedure.
Here
it
will
turn
on
pins
2
and
6
which
will
make
it
go
in
reverse.
It
will
reverse
for
a
short
amount
of
time
(approx.
1s).
Outputs
2
and
7
or
3
and
6
activate
depending
on
if
the
left
or
right
button
was
pressed
causing
the
motors
to
spin
in
opposite
directions,
thus
turning
it
left
or
right
90
degrees
(angle
determined
by
time
outputs
are
on).
It
will
then
go
forward
again
and
repeat
the
program.
The
lights
are
also
turned
on
according
to
the
direction
of
the
motors.
Green
for
forward
(output
7),
yellow
for
back
(output
6)
and
red
for
stop
(output
5).
A
combination
of
green
and
yellow means the robot is turning.
Source Code
To
download
the
source
code
and
try
it
for
yourself
visit
my
github by clicking the link below.
For additional information email me at
OmidGhayouri@outlook.com
Self Navigating R2-D2
This self navigating R2-D2 robot was made using an
aluminum pop can and basic electronic components. It
uses two push buttons located on the front of the robot
to find obstacles and move out of the way accordingly.
When one of the buttons is pressed, the robot makes
noise, flashes an LED depending on the side of impact,
then moves away and continues in the forward direction.
COMPONENTS
•
Pop can
•
Transistors (NPN)
•
2x Geared motors & wheels
•
Speaker
•
2x Push buttons
•
LEDS
•
9V battery
•
Various resistors
•
Wires & wire strippers
•
Soldering Iron & solder
•
Prototype Matrix Board
PICAXE 20M
The
PICAXE
is
a
small
programmable
microcontroller
that
can
be
used
in
a
wide
variety
of
applications.
It
can
be
programmed
in
BASIC
or
through
graphical
flowchart
software.
The
20M
is
a
20
pin
chip
including
multiple
input
and
outputs.
Its
compact
size
makes
it
great
for
projects like this.