Professional Documents
Culture Documents
Mi Primer Robot
Mi Primer Robot
Robot
By Frits fritsl Lyneborg
http://letsmakerobots.com/user/
!"F by #$ster
Fin% out more on:
http://letsmakerobots.com/
2
&ontents !age
'.
(.
). *ntro%uction
. Before you start
+. How to start
,. *tems nee%e% - !*&#./
0. *tems nee%e% - 1otor "ri2er
3. *tems nee%e% - 4er2o
5. *tems nee%e% - 4ensor
'6. *tems nee%e% - 1otors
''. *tems nee%e% - 7ther *tems
'(. 8etting 4tarte%
'). 4ticking 9ogether
'. 9he Brains
'+. !ro$ect Boar%
',. !ro$ect Boar% (
'0. 1otors
'3. 4er2o
'5. 4ensor
(6. Let there be Life
('. 4etting the 4ensor
((. Fully Built
(). 4tarting to !rogram
(. !rogramming
(+. 4ample &o%e
(,. 4ample &o%e - continue%
(0. #%% some /:tras
(3. How to fin% !ica:e manuals
(5. (3 pin !ro$ect Boar% ;#./6(6<= !ica:e for %ummies
)6. 8roun%>
)'. ?
)(. ?' @ ?(
)). !ower on the boar%
). !eripherals
)+. #= B= &
),. "= /= F
)0. 8= H
)3. 4omething ;slightly< interesting...
)5. How to connect 4RF6+ to pica:e (3 pin pro$ect boar%
6. 4RF6+ &o%e
3
*ntro%uction
9ime to buil%: ( hours
ARL to more information:
http://2i%eo.google.com/googleplayer.swfB%oc*...
&ost to buil%: C3+
#ctuators / output %e2ices: ( geare% motors
&!A: !ica:e
!ower source: ## batteries
!rogramming language: !ica:e basic
4ensors / input %e2ices: 4harp *R
9arget en2ironment: in%oor
This project requires no knowledge of electronics, and it will not get much into that, it will
only start you up with a robot really fast.
It is based on a system called Picaxe that is really simple yet powerful.
If you know that you want to get more into the electronics part of building, spend more time
on learning, and use the system called Arduino, you should
check out this irst robot!project that uses Arduino and a breadboard.
4
Before you 4tart
Welcome. before we get started, here are some things you should know:
For your own sake= rea% this before you go any further
*f you are looking for an e2en cheaper an% faster pro$ect= this one might ha2e your
interest: http://letsmakerobots.com/no%e/30
*f you ha2e ne2er buil% a robot before= the 2i%eo here might inspire to how easy it is
to construct= you %o not nee% special materials to buil% robots:
http://letsmakerobots.com/no%e/)+
9o inspire to where you can go from here= * ha2e ma%e a part **
7D E Fow letGs get starte% :<
5
How to start
How to start a cool* robot for approx $8
9his is coolH because:
9he electronics use% are real parts ;not little homeEma%e things that wont
really work unless you spen% hours of tweaking= an% not a kit that you $ust
assemble an% thatGs it<.
Iou can e2ol2e from here= e2en with the same parts ;if you can bare to take
your robot apart<.
*t is cheap.
"ouble si%e% a%hesi2e tape ;for mounting= the foamy sort is best<
4ome wire
# screw%ri2er
7ou could also get, while you8re at it:
4ome L/"Os if you want your robot to be able to signal to the worl% or make
cool flashingEeffects.
1ore ser2os to make your robot mo2e more..erh..armsB 7r ser2os with ser2os
on etc.
# tiny speaker if you woul% like your robot to pro%uce soun%Eeffects an%
communicate to you.
4ome sort of beltEtrack system. Robots with belt tracks are way cool as well=
an% the controller an% the rest will be the same.
Here is an e:ample to what you coul% take it to with belt tracks 9#1I*#
makes cool beltEtrackEsystems= an% this one is also a fa2orite of mine
Here is more info on beltEtracks.
Re% nee%s to be connecte% to ?'= that is ;in this setup< anything marke% ?=
or is connecte% to this.
8roun%
8F"
?ee
?ss
Fegati2e 4upply
E #ll the same>
9his is simply where current goes to when it comes from the other pole on the
battery ;the positi2e= M<.
Khen something can be connecte% to your boar% using L$ust a single wireL= it
always also has to ha2e a secon% wire= connecte% to this groun%.
*f you want to hook up to groun%= you can use any of these connections on the
boar%:
31
?
#lso referre% to in ran%om as :
!ositi2e supply
&urrent
!ower
?&&
?M
BM
?""
#ctually the reason for ha2ing a 1icroEcontroller on a boar% is= that you shoul% let
the microEcontroller control when you sen% current to something ;turn it on or off<.
Howe2er= Nuite often= you will nee% to fee% peripherals with current ;an% groun%= this
goes unsai%<= on top of what you sen% to it 2ia the microEcontroller
!erhaps you are connecting a 4harp *R range fin%er= it has ) wires: Black= Khite
an% Re%. 9he black is 8roun%. 9he Re% then will be ?= to power the mo%ule= an%
the white will be a signal returning from the 4harp mo%ule to the microEcontroller on
your boar%.
!erhaps you want to control a 4er2o. 9hat will also nee% a 8 an% a ? to power itGs
circuit an% its motor. #n% on top of this= it nee%s a pulseEsignal from the microE
controller= the last wire E what colour it may be on the particular mo%el.
9he stan%ar% setup of the boar% looks like this= all these areas are ?:
32
?' @ ?(
/o 4 what>s with the H! 6 H#I
Kell= e2erything returns to groun%. But it can come from %ifferent sources. #n% they
can ha2e %ifferent 2oltage.
9his way you can power a ser2o with ?(= while the pulses that signals to the ser2o
where it shoul% turn to= is from the 1icroEcontroller that runs on ?'. #ll to the same
8.
9his (3 pin !ro$ect Boar% has ( options:
/tandard: 4ee illustration abo2e. ?' @ ?( are connecte%= result: 9here is only one
?. #s you may ha2e rea% from the %ocumentation: *t is the little $umper in the corner
that connects ?' @ ?(= an% when it is on= there is only ? @ 8 on the boar%.
# power supplies: 4ee illustration below. 9ake off the $umper= an% connect a
separate powerEsupply to ?( ;an% that power supplies 8 to groun%= goes unsai%
from now J< E an% the boar% will ha2e ?' to the circuits an% inputs= ?( to power
e:ternal stuff= an% 8 for all of it.
9hat way you can fee% the chips with +?= an% the motors with '(? that woul%
otherwise kill the chips.
33
!ower on the Boar%
/o if you hook up a board with # power4supplies, this is where you ha(e
current and ground:
34
!eripherals
.. Khat is leftB
7nly the interesting stuff> :<
!ower they nee%= the peripherals.. But it is the inputs an% outputs that are
interesting.
Fone of the abo2e connections can be controlle% by the 1icroEcontroller= an% unless
you burn something= the 1icroEcontroller %oes not sense weather you connect
something to these or not.
9his is where the inputOs an% outputs come into the picture:
9hese connect to the 1icroEcontrollers legs. Suite often= for a%2ance% usage=
things can be altere%J #n input can be switche% in mo%e= so that it is an output
etc. But you will figure that out= this is $ust the basics= as things are wire% in
%efault.
35
#= B= &
,: Fhe digital inputs:
&onnect a switch to ?' an% one of these. *n the program e%itor you can then write
;letOs say you ha2e connecte% to leg = there are 3 in this area<
If pin9 ; 3 then
...
G: Fhe analogue inputs
How much current from ?' ;or another source not more powerful then ?'< comes to
this pinB
Kell E it is not a Nuestion i ask= but what the pin asks :<
9he answer is then returne% into a 2ariable= e:ample= pin ( out of the in this area:
readadc *, b3
Fow the 2ariable b' is a 2alue between 6E(++= %epen%ing on how much current
from ?' ;or another source not more powerful then ?'< comes to this pin.
+: Fhe *34area
9his is a Nuite un%ocumente% feature on the boar%> *t is use% if you want to use
stan%ar% 9?Eremote controlEprotocols to sen% to your microEcontroller
Iou can hook up *R insEan% out to anything= to measure *R= for instance to see if
something is near or far= or white or black.. but you will ha2e to %o with analogue
le2els of signal an% similar= you will not be able to transmit LsignalsL that can be
translate% to numbers such as 9? remotes %oes. 1ost *R remote controls use )3
DHP subEcarrier= an% this area letGs you hook up to that Nuite simply. Iou shoul% only
use it for that>
36
"= /= F
&: Fhe /erial communication
9he sNuare on the picture shoul% perhaps inclu%e the $ack socket :< 9his is the serial
connection use% to program an% more.
Iou can also use outputE an% %igital input pins for serial connection= but the ones on
" are har%Ewire%
.: &irect outputs from the picaxe
9hese shoul% ;only< be use% if you are trying to communicate Lchip to chipL. * think
this is calle% 99LEle2el= where you let the chips talk to each other 2ia pulses. 9his
shoul% not be use% to %ri2e anything= but it shoul% always be use% if you want your
chip to talk to others= like in this e:ample:
http://letsmakerobots.com/no%e/,,
J: 9utput pins
9hese are what you shoul% start with= *1H7: &onnect a L/" or something
;Remember L/"Gs shoul% turn the right way aroun%< to one of these ;other L/"Eleg
to groun%<.. letGs say you connect to leg ) out of the 3 in this area. Krite:
high ,
to turn power on
low ,
to turn it off
Fote that if you are using a motor controller= you shoul% not use leg = += , an% 0 for
anything else>
9hese pins are also use% for stan%ar% ser2o connection.
37
8= H
1: 'otor connections , K G
9he boar% is ma%e for the typical applications= an% one is where you want to control
( motors= an% being able to switch %irections on them.
7f course if you only can turn things on or off= it can be har% to re2erse a motor.
Iou can purchase a L(5)" motor controller E chip= an% place it in here.
9hen rea% the %ocumentation for how to make output = += , an% 0 control ( wayE
%ri2e of ( motors connecte% to # @ B outputs. ;one motor to # an% one to B= not (
times #MB<
H: Fhe reset switch
*f you mount your boar% in a case or something= an% woul% like to be able to
remoteEreset the 1icroEcontroller= a%% a switch to this= press it an%.. HelloB *
remember nothing= letGs start all o2er>
38
4omething ;slightly< interesting...
or not.
Iou will most likely only see names like ?&&= ?//= ?44 an% ?"" on chip pins. *f
you see ?&& an% ?// it means that the chip is ma%e out of bipolar $unction
transistors ;aka BQ9s< an% if you see ?44 an% ?"" it means that the chip is ma%e
out of metalEo:i%e Esemicon%uctor fiel% effect transistors ;aka 174F/9s<.
?&& means L?oltage at the collector pin of a BQ9L
?// means L?oltage at the emitter pin of a BQ9L
?44 means L?oltage at the source pin of a 174F/9L
?"" means L?oltage at the %rain pin of a 174F/9L
* know Frits wonOt really care about that information :E<
By $ip
39
How to connect /3J2 to )icaxe #8 pin )roEect board
03" to more information:
http:66www.re(4ed.co.uk6docs6srf22.pdf
4ensors / input %e2ices: 4RF6+
&escription:
*f you are a newbie= you may only ha2e learne% that the !ica:e (3 pin !ro$ect
Boar% has some inputs an% outputs.. #n% you may ha2e purchase% an 4RF6+
;that !ica:e refers to as 4RF66+<= an% you are trying to connect the %arn thing..
without resultB
Reason is likely to be that you are connecting the output from the !ica:e to the
4RF6+ through the %arlington on the boar%.
9he 4RF6+ nee%s ;like many other things< a !ulseEsignal= not $ust a Lpower on /
offL. 9he signal therefore must come %irectly from the !ica:e chip.
Luckily the boar% has little Lhi%%enL holes for that kin% of connections. ;Blue wire=
the signal in to the 4RF6+ %irectly from the chip<. 9hese holes= howe2er= are not
%escribe%= simply omitte% in the manual for the boar%. 4o * won%er how a newbie
shoul% e2er fin% out= personally * burne% a 4RF6+ or two in my frustrate%
attempts to get it right :<
*f you follow the illustration abo2e= you shoul% be able to make the below co%e
work $ust fine. Iou will know that the 4RF6+ is getting a pulseEsignal when the
little re% L/" on itGs back is flashing re%.
40
4RF6+ &o%e
HHHH
symbol trig B % < 7efine output pin for Trigger pulse
symbol echo B @ < 7efine input pin for =cho pulse
symbol range B w! < 3> bit word #ariable for range
main:
pulsout trig,# < produce *+u) trigger pulse %must be minimum of 3+u)&
pulsin echo,!,range < measures the range in 3+u) steps
pause !2 < recharge period after ranging completes
< now con#ert range to cm %di#ide by ?.@& or inches %di#ide by 39.@&
< as picaxe cannot use ?.@, multiply by 3+ then di#ide by ?@ instead
let range B range * !2 6 8 < multiply by 3+ then di#ide by ?@
debug range < display range #ia debug command
goto main < and around fore#er
HHHH
Lotes:
* %i% not ha2e a fresh 4RF6+= an% so there are %rille% e:tra holes an% sol%ere% pins
on the one on the picture.
Be aware that if you also connect ser2o;s< to the same !ica:e chip= program
e:ecution may be bumpy with little irregular breaks when using things as the 4FR6+
that nee%s pulses. *f it is important for you to ha2e a stea%y program e:ecution= or if
a ser2o acts totally irrational= it sometimes helps to ha2e a small pause or turn off a
ser2os pulse for a short time in the co%e:
Llow )L or Lpause '6L. #pparently there is no system= it is $ust trial an% error with
your particular setup.
9his pages might ha2e your interest: 4ee what Robot 4ees