Update:
You can buy the parts now! (look below for details, will be updated as we arrange more kits)
Hires slideshow of finished robot here
Video at the bottom of the post
Hi guys,
Time to make a new version of "Start Here" (See top menu). This time it's cross compatible; Arduino or PICAXE can be the users choice, because PICAXE and I have worked together on a cross compatible shield, named "Instant Robot".
More about the shield later - you can actually buy it now (picaxe.com/instantrobot), but documentation is in the works as I'm writing this. I was allowed to announce it already :)
Other news:
This version of Start Here was made with LMRv4 (next version of letsmakerobots.com) in mind. In LMRv4, one can "include" other pages - sort of like a link, but a little more info and graphics will appear instead of just a link.
Therefore this version might appear extreeeemelyyyy looong - but you will have to imagine that when finished, parts of it will be on other pages, and just included as "optional reading".
How to make your first robot
This tutorial is the easiest way in the world to give you a fast start into building robots.
Welcome
Everything here is so easy, that after you have gone through it, you can make a new robot - with your own design - in a couple of hours, even minutes. Why can’t you do that now?
Because there are so many little things you need to know.
This is an attempt to let you know exactly all these little things, and nothing more.
There are other “How to get started building robots” out there. This one is focusing on getting you around everything extremely fast. You need no knowledge of … anything. And you will learn everything… well, the basics of everything
Materials needed
We are establishing several kits, but for now you can purchase all parts needed in this bundle.
No matter from where you get it, the following is what you will need:
(The following is all included in the bundle)
50 * Male “snap off” Header Pin
You get these in long rows, and simply break them apart.
3 * Shorting Blocks, Top Closed
If you place these over 2 pins next to each other, you make a connection between the pins! Should you ever need extra, you can sometimes find them in old computers and harddisks.
5 or more Female-Female Header Jumper cables
By using these jumpers, you can make quick connections without soldering, over and again.
1 * Standard hobby grade servo
Standard hobby grade servos are used in many robotic appliances. It’s usually a little box with wires to it, and a shaft that can turn some 200 degrees, from side to side.
They come with various “horns” to be mounted onto the shaft. Yours might have a round disc on top instead of the “rod” on mine. It does not matter
The microcontroller can decide to where the shaft should turn, and stay there. That is pretty handy; You can program something to physically move to a certain position.
1 * SRF05 distance sensor
It is cool because it looks like a set of eyes. Actually one of the cups is sending out a little “click” (ultra) sound (hard to hear for human), and the other is listening for echoes - much like a bat. That way the SRF05 unit is measuring distance to any objects in front of it.
1 * Battery clip to fit 8 AA batteries
Some boards needs an excact voltage. The ones I show you to use here have onboard voltage controllers, so they are rather forgiving, and you just need to provide them somewhere between 9 and 12 Volts.
8 times AA-type batteries, will do the trick with either rechargable onr non-rechargable batteries.
1 * Heat shrink tube (5 mm approx)
I’ll show you how to use this instead of insulating tape
1 * 2.1mm connector
"Arduino compatible connector"
1 * Geared Motor with Wheel
Any geared motor (must be geared, gearing ratio from 1:100 -> 1:200), that will run on 4 volt - and a wheel.
2 * free spinning Wheels
Just some form of wheel that can spin freely, and be placed (or is placed) on an axle.
Just note that you can not use 2 wheels that are locked to the same axle.
A simple ON/OFF switch
It’s not really nessecary, since you can just unplug the robot by taking out a battery. But it’s nice to have a switch
1 * Microcontroller in a board.. But.. You will have to chose which brand, read on :)
First, check this: This chip a microcontroller!
It can be placed in a board as shown below, and after that it can be programmed from your computer via a cable.
I have designed this tutorial in a way so that you can chose between two popular brands of Microcontrollers with their corrosponding boards.
The brand names are Arduino and PICAXE, shown at the picture above.
Which one to chose?
The systems are virtually alike, only real difference is how they are programmed, so let's look at that:
- Chose Arduino (left board), if you already are an experienced programmer and prefer “C-style”, object oriented coding, over “BASIC-style”.
- Chose PICAXE (right board), if you have never really been programming before, if you have programmed some, but found it difficult - or if you already master a little programming in the BASIC language.T
They are equally cool.. only difference really is how you like to work.
They are not the most expensive parts, and you can always change later, while stil using all the other parts, so just go for one if in doubt!
Note that you can purchase either (and the shield described below) in either “self assembly” or “factory premade” versions. I strongly recommend that you get “factory premade” versions for your first robot!
1 * programming cable to suit the board you chose:
Picaxe needs the AXE027 cable to be programmed.
This version of the Arduino just needs a standard USB (flat to fat), to hook up to your computer.
Either cable is used to transfer programs and testing-data between microcontroller and computer.
1 * Instant Robot Shield
A shield is an extra circuit board that fits onto the main board like a LEGO brick on top of another.
You could say that we “upgrade” the main board with this shield.
Thanks to Clive from PICAXE for making this board for us :)
(It is100% compatible with both Arduino and Picaxe)
***************************************************************************************
All of the above materials should be included in the LMR bundle.
You will also need the following, that you will have to supply yourself:
***************************************************************************************
1 * Computer
Linux, Windows, or Apple OS can be used.
1 * small speaker
You can find them anywhere - take something that used to be able to make a sound apart, and find a speaker inside. I figured it’d be silly to buy one for this project, because you can just get it for free, so it’s not included in the bundle :)
8 * AA batteries
You can use the clip in the bundle with either “normal”, or rechargable batteries. I recommend you to get rechargables. They come with different “mAh”, and you want that as high as possible. 2500 is good for an AA size.
Wooden sticks!
Painter sticks, paint sticks, wooden sticks, ice cream sticks.. or heck, use something else! In many stores you can get these free (or for pennies) where they sell paint. And since they are really easy to cut and glue, they are my personal favourite basic building material for small robots.
Of course you can just any material you want - you’ll just need something to build a simple frame.
TOOLS
A hot Glue Gun
Respect the hot Glue Gun! It is your most powerful tool. Ever.
(And get some glue for it as well)
Tip 1: No can glue Aluminium!
Tip 2: Can glue wooden sticks. Really well!
Tip 3: It will pop a fuse and die after a perhaps a year. Regardles of brand and quality. Fact of life.
Tip 4: Water your fingers before touching melted glue.
A Soldering iron and solder
Somewhere between 15 and 25 watts are good specs for the iron.
Apart from that; If you are new to soldering, this tutorial on soldering might interest you.
Oh.. And here is more about soldering.
My personal top-tip: Get any cheap soldering iron, and place an old dampened cloth on a plate.
When ever you have soldered something, while the iron is still hot, wipe off the dark stuff from the tip of the iron, and you will always have a nice, well working, clean iron. And it makes a cool sound! (tzzt!)
However! This is just my personal tip - soldering is like a relegion to many nerds - they will tell you other tips
A lighter and a cutter
Lighter for heat shrinking, cutter to… cut.
Yet another Tip: If you want to use the cutter to remove plastic insulation from wires, turn it this way; Imagine that you where sticking the cable right into the cutter from where you are now, into the table it is laying on (on the picture above). That way. And not from the table, and out to where you are. Then gently close around the wire, and pull the plastic off.
A screwdriver
It should be a size to fit into the screw terminals of the Instant Robot shield
A magnifying glass of some form is really nice to have!
A multimeter
This is also sometimes more correctly called “a measure thingey”.
You can find these for something like 10 USD in online shops etc. (Search for multimeter)
It can do all sorts of complicated stuff, but you only need to know how to do a couple of simple tricks with it
… Hmm…
That’s it!
(I think - please let me know if I missed something)
***************************************************************
Ready? Let’s make a robot
If you (against my advice) got the self-assembly base boards and or shield, make sure to assemble them first, according to the instructions they each came with.
Stacking the main board and the shield
Find the male snap off-header pins, and snap off pins to connect the two rows On the sides along of the main boards, as shown on the pictures:
Inserting the pins into the Picaxe or Arduino board will hold them nice and square, and guarantee that they will line up perfectly when you solder them to the Instant Robot Shield.
When all 28 pins are in place, solder on top of the shield.
Make sure there are no bad solderings!
Really; Make sure all solderings are connecting what they should, and nothing else. Not doing this, is the most common problem first-time-builders have. This is not glue that should just be applied with a loose brush - we are connecting electronic components, one connection by one.
When done, you can dis-assemble the two boards, and place the shield on another base, should you wish to do so.
This time you had the boards to hold the pins. Often that is not the case, and then you can just use some tape to hold the pins in place while flipping the board and soldering. Here’s an example:
Flip the board, the pins are not falling out because of the tape… - and solder.
Back to building the robot:
Placing the Shorting Blocks:
- on the boards
Chances are that all headers on your boards are already in place. But let’s make sure.
If you have the PICAXE board, blocks should be placed like this:
(Arduino needs no pins)
And the Instant robot Shield:
This set’s up XXX(Text waiting for final documentation of shield)XXX
Time for another General tip:
Extensions and alternations of wires and cables:
Connecting 2 wires “The right way” is almost a religion to some. Here is how I do it:
First, I simply twist the 2 wires together.
And cut a piece of heat shrink tube to cover the area.
Then I solder them together (cut some off, if it is very long), and bend it along the side of one of them.
Slide the tube over, and a lighter quickly heats it up.
This makes it shrink, hence the name, and it is a perfect insulation.
I don’t think you realize how hard it was to take that picture all by myself It had to be in focus on the right spot, you know. And yes, the wire got a little burned Good shot, if I may say so myself, but try not to burn the wires like I did.
From now on, I expect you to just extend wires that are too short. If a wire needs a female in one end, and it has none, cut a female-to-female jumper wire in two, and hook up the ends with headers to the wires where needed.
And also; If you need to connect something to a board, where there is only a hole… you simply add a pin yourself
Making a power cable with a switch
Your base board have a standard female plug for power, and you need a so called 2.1mm tip positive connector to feed it.
The “tip positive” is a standard that is often referred to with this pictogram:
It means that the center of the plug has the +, and the outer has the - of the power feed.
But what if you do not know + and -?
Well, I assume you know the VERY basic stuff: Power from a battery has a + and a -
That, and the following should be all you would need to know, in order to make quite complex robots, and read technical documentation:
+ is also known as positive, V, and usually the red wire
- is also known as negative, G or ground. That’s usually the black wire.
A “Circuit” is needed for anything electronic to work. To make a circuit, electricity should be able to flow from + to - through electronic components.
Electricity should never flow directly from + to -. If it flows directly, you have a short circuit, and that is not good.
V should flow from the battery, into the circuit board. In the circutry there, it can be split up into other V’s with individual characteristics. Maybe there is even a second battery pack, adding a V2. All of them flows back to the same G (All G are always connected, “Common Ground”), after doing something up in the robot.
If you insert a switch on one of the wires just next to (or from) the battery, you can “cut power off”, by disconnecting the entire flow from + to -. Good practice says to cut V, but it might as well be G.
I’d love to tell you more, but I think this is all you need to know to make this robot, and the web is full of more info on the subject :)
We are going to make this:
A switch and power plug, so you can power the robot, and switch it off.
You know how to solder the wires together, so all you need to learn now, is how to see what part of the connector is “the tip”, so you can connect that with the red wire from the battery (after it has passed through the switch).
To find which of the two wires on the connector is connected to the tip, put your multimeter on this position:
Multimeter on beep. They all have this fonctionality one way or the other.
Test that it is making a beeping sound when the two poles are connected
This should make it beep!
Now just find the one that is the center (touch center and the wire that makes it beep), and get soldering!
My switch has a nice plastic casing, and only 2 wires. If your switch has perhaps 3, 4, or 6 connectors, just use the multimeter; Test on 2 connectors when the switch is to one side, switch to the other, and notice if they now are connected. When you find 2 connectors that are switched On/Off this way, just use them :) (Switches sometimes have funky functionality, you just need a single on/off, and it is there, you just need to find the right pins to use)
Insert batteries into the clip, plug the connector into the board (with or without the shield), make sure the switch is on, and look for a light on the board:
PICAXE:
Arduino:
That is the “ALL OK” light you are looking for :)
If you are not getting this, quickly unplug your wire, and take out one battery from the clip. Check everything, ask for help. This could be because there is no circuit, but it could also mean that there is a short circuit, and you do not want to leave that on. Things will start smoking, it is not good :)
Setting a servo to center
Find your servo:
You can use any of the rows marked 2 and up to 7, to hook up servos. (Not the ones marked with an A0 - A7, use the other side) That way your robot could have up to 5 servos running direcly from the shield. (And more, but we will take that another time)
Servos come with different colors of cables, but they all share a standard:
Red is always center. And yes, this is V.
To its sides is a dark and a light cable.
The dark one can be anything from brown to black, and the light one could be yellow, white, or orange.
The shield has the text “Signal” for the light one. Or put differently; The darkest one should always be where the shield is marked with a - symbol.
It’s time to program the Microcontroller for the first time.
We will need to be able to move the servo, so we can set it at the right angle before assembling the robot.
Find your programming cable, and prepare to hook up your board to your computer.
In the next steps I cannot help you. You will need to read the instructions on the webpage of the manufacturor of the board you are using.
So, go to either picaxe.com or arduino.cc, and from there, download the free programming editor that matches your computer.
Follow the instructions on how to install the cable in order to program the Microcontroller.
When ready (Programming editor on computer, cable to your board, power on board), notice which port (number of pin-row: 2 to 7) that you have hooked your servo up to.
Now, I need you to upload the following program. The letter N should be replaced with the port number (number of pin-row) to which you have plugged the servo.
The code you should write is between the symbols ---
PICAXE:
servo s.N, 150
do
loop
Example, if you are using port 7, as I am on the picture above:
---
servo s.7, 150
do
loop
---
ARDUINO:
XXX
XXX
XXX
---
If everything works, your servo will turn a little, move into position 150, which we will regard as “center” from now on.
Try to have a little fun; Switch off the robot, gently spin the servo to one side, and switch it on again. It should go back to the excact same position of 150. This is in fact your first program :)
You are now pretty much ready to just plug and glue the robot together
Now it’s time to cut some wood, and use the hot glue gun!
To make my life a little easier and fun, I first made the robot, and had fun with that. Then I took it apart, while taking pictures of every step of that, so I could show you them in opposite order and pretend I was assembling it for you!
Therefore - in case you wonder why I have strange blobs of glue where you should place glue, it is because you are seing my dissasembly in reversed order ;)
First make some form of front axle. The 2 wheels should be able to drive independently.
To get a few tips on how you can make something like this, check out this old post of mine, one of the very first robots I ever mande: https://www.robotshop.com/letsmakerobots/node/35
It needs to have a place to mount the servo onto, and you should glue it on, somewhat like this:
It’s not important at all how this looks - you just need 2 free spinning wheels, with a servo - more or less as shown :)
Now prepare the geared motor and drive wheels somewhat like this:
Again, it is not at all important how this looks, make your own design as you please. As long as you have a stick or something with a wheel from a geared motor in the end, you are home free!
I used a cable tie to secure the wires after soldering them onto the motor.
We need enough space so we can have the battery there in front of the wheel, and then we need a stick to go out in a line along the wheel.
Important: Make sure your servo is at position 150.
Then check out the images, and mount accordingly :)
With the servo at center position, you want to allign the wheels so it is driving straight ahead (approximately)
Next, mount the battery clip as shown. Just give things a blob of glue, and you are good to go :) Remember; This is your first robot, not your last - It's nice to work fast, and make things in a way that they can be taken apart again.
On top of the battery clip, place a stick like the next picture.
OK, I had two sticks there. If I knew what I was doing, I would have just used one (longer) stick - no need for two sticks like that!
On top of that (them), mount the bundle of the board with shield mounted:
- and make sure the wires are long enough to plug in the power
.. and Motor
Plug the servo into slot 2.
And now for the SRF05.
If it comes without pins soldered, solder them in. Some SRF05's (the blue ones) does not have the extra holes. If yours does, make sure to use the right side (match the image) :)
Note how I am holding the pins alligned to the pins on the shield (you will also have to solder these pins in - use the tape trick to hold them while soldering)
Using female wires, connect each of the 5 pins on either side, to the pins matching the other.
Mount the wires with a blob of glue on the pin sticking out over the servo.
Mount the SRF05 in front of your robot. You want it to look a little up, rather than a little down.
Connect the speaker to BUFF12 on the shield.
Mount the speaker up under the stick, and you are done building!!
All you need to do now is program the robot.
And that is all the fun!
This is also where you will have to learn a lot.. a LOT by trial and error. It’s the only way.
Now, I will show you a couple of isolated things you can do, and then I will give you the complete program used in the video.
But you must promise me to experiment a LOT with the programming.
And a tip that can never be said enough. This is actually what will determine if you will fail for ever, or for ever be a hero of a robot builder:
Make one thing work at a time, and always start with the most crusial first.
You want to write that on your arm with a permanent marker.
Let’s say you wanted to write a new program for this robot.
Most crusial? hmm.. To be able to sense distance in front of the robot.
Make that work.
Next: be able to drive, and stop the motor if there is something in front. Make that work. What should “he” be doing then? Reverse a little, till distance is high enough? Make that work. Then beep? Make that work. Then look to one side, and see the distance? Make that work.. Keep on like that, and you will make good programs.
Jump to “the fun parts” right away, and you will never have fun, because it will just drive into a wall. You want good basics to build on, and expand.
NOTE: CODE SNIPPETS WILL BE ATTACHED DOWNLOADS, OR PRESENTED IN OWN CODE WINDOW ON NEXT GEN LMR
NOTE: I WILL ASK THE COMMUNITY TO PROVIDE ARDUINO CODE; I AM TOO INEXPERIENCED TO PRODUCE MY OWN FOR THIS.
PICAXE:
****
‘The distance in front of the SRF05 sensor
Symbol range = w0
main:
ultra S.5,range
debug
goto main
****
‘Drive the motor:
high s.8
high s.9
****
‘ Drive and stop
Symbol range = w0
servo s.2, 150
main:
ultra S.5,range
if range <10 then
gosub dreverse
goto main
endif
if range <20 then
gosub totalhalt
goto main
endif
gosub dforward
goto main
dreverse:
low s.8
high s.9
return
dforward:
high s.8
high s.9
return
totalhalt:
low s.9
return
****
' Drive along a wall, and return to you
Symbol range = w0
servo s.2, 150
main:
ultra S.5,range
if range <10 then
gosub dreverse
goto main
endif
if range <20 then
gosub totalhalt
gosub sidechose
goto main
endif
gosub dforward
if range < 40 then
servopos s.2, 200
goto main
endif
servopos s.2, 150
goto main
sidechose:
servopos s.2, 100
gosub dreverse
ultra S.5,range
if range < 30 then
goto sidechose
endif
servopos s.2, 200
return
dreverse:
low s.8
high s.9
return
dforward:
high s.8
high s.9
return
totalhalt:
low s.9
return
****
Symbol range = w2
symbol snakedir = bit0
symbol counter = b2
symbol faceturn = b1
faceturn = 150
servo s.2, 150
main:
ultra S.5,range
if range <10 then
gosub dreverse
inc snakedir
goto main
endif
if range <20 then
gosub sidechose
goto main
endif
gosub dforward
if range < 40 then
servopos s.2, 200
goto main
endif
servopos s.2, faceturn
gosub faceturner
goto main
faceturner:
inc counter
if counter > 2 then
counter = 0
if snakedir = 0 then
inc faceturn
if faceturn > 180 then
inc snakedir
endif
else
dec faceturn
if faceturn < 120 then
inc snakedir
endif
endif
endif
return
sidechose:
if snakedir = 1 then
servopos s.2, 100
gosub dreverse
ultra S.5,range
if range < 40 then
goto sidechose
endif
servopos s.2, 200
return
else
servopos s.2, 200
gosub dreverse
ultra S.5,range
if range < 40 then
goto sidechose
endif
servopos s.2, 100
return
endif
dreverse:
low s.8
high s.9
return
dforward:
high s.8
high s.9
return
totalhalt:
low s.9
return
****
Symbol range = w5
symbol snakedir = bit0
symbol counter = b2
symbol faceturn = b1
symbol trickturn = b3
faceturn = 150
servo s.2, 150
main:
ultra S.5,range
if range <10 then
gosub dreverse
sound S.12, (112, 1)
goto main
endif
if range <20 then
gosub sidechose
sound S.12, (100, 2) sound S.12, (103, 2)
goto main
endif
gosub dforward
if range = 60 then
gosub totalhalt
servopos s.2, 200 pause 300 servopos s.2, 190 wait 1 gosub stopani
servopos s.2, 110 pause 300 servopos s.2, 120 pause 1300 gosub stopani
servopos s.2, 100 pause 400 servopos s.2, 220 pause 500 gosub stopani
servopos s.2, 200 pause 500 servopos s.2, 100 wait 1 gosub stopani
sound S.12, (100, 2) sound S.12, (103, 2)
endif
servopos s.2, faceturn
gosub faceturner
goto main
stopani:
ultra S.5,range
if range < 20 then
gosub dreverse
sound S.12, (88, 5)
pause 200
return
endif
ultra S.5,range
if range > 70 then
gosub dforward
sound S.12, (100, 5)
pause 700
return
endif
ultra S.5,range
if range < 30 then
sound S.12, (124, 5) pause 10 sound S.12, (124, 5) pause 10 sound S.12, (124, 5) pause 10
goto main
endif
return
faceturner:
inc counter
if counter > 2 then
counter = 0
if snakedir = 0 then
inc faceturn
if faceturn > 180 then
inc snakedir
sound S.12, (range, 5)
endif
else
dec faceturn
if faceturn < 120 then
inc snakedir
sound S.12, (range, 5)
endif
endif
endif
return
sidechose:
if snakedir = 1 then
servopos s.2, 100
gosub dreverse
ultra S.5,range
if range < 40 then
goto sidechose
endif
servopos s.2, 200
inc snakedir
return
else
servopos s.2, 200
gosub dreverse
ultra S.5,range
if range < 40 then
goto sidechose
endif
servopos s.2, 100
inc snakedir
return
endif
dreverse:
low s.8
high s.9
return
dforward:
high s.8
high s.9
return
totalhalt:
low s.9
return
Congratiolations, you have now made a robot, following instructions. It’s time to start building yourself.
A bad thing about following tutorials is that you may not really go through the steps that should teach you stuff, so that is what you will need to do now.
So - “Strip things down”: Perhaps it’d be a good idea to take the robot apart, completely, and set a goal for yourself: Make a “machine” that can do this:
Beep
Ok, done? then try and have a look around in manuals, ask people, see if you can find an LED, and make that blink.
Done?
Now try and combine the two, so your machine is beeping and blinking.
Done? Time for next step, make a machine that can do this:
If something comes in front of the SRF05, it will beep. If not, an LED will blink.
And then, you might want to look into making a new robot with 2 motors; Place one in each side, and try to let the robot spin them in either direction..
There is a trillion things you can do now, and we are all looking forward to seeing the robots and other stuff that you create, so make sure to share with us :)
/ Frits
**** The below will not be a part of the instructions, but these are the values/instructions I have been using when making this tutorial, so if anything changes from the below, it should be handled :)
; Buffered outputs
; Buff 12 is S.12 1 = on, 0 = off
; Buff 13 is S.13 1 = on, 0 = off
;Motors
; Motor A
; Direction is S.8 1 = one way, 0 = the other
; On/Off/PWM is S.9 1 = on, pulsing=pwm, 0 = off
; Motor B
; Direction is S.11 1 = one way, 0 = the other
; On/Off/PWM is S.10 1 = on, pulsing=pwm, 0 = off
; PWM frequency is critical for good motor control
; and varies between motor types
; for instance 20% at 10kHz works, but 20% at 1kHz just 'hums'
; pwmout S.9, 99, 200 ; 50% at 10kHz
; pwmout S.9, 99, 80 ; 20% at 10kHz
; pwmout pwmdiv4, S.9, 249, 500 ; 50% at 1kHz
; pwmout pwmdiv4, S.9, 249, 200 ; 20% at 1kHz
; Good noise suppression is also essential on the motor
;Input Pins
; S.A0 to S.A5 are all digital inputs (if pinA.0 = 1 then)
; Can also be analogue inputs (readadc S.A0, b1)
; Can also be touch sensor inputs (touch S.A0, b1)
; Each has an optional jumper which connects a 10k pull down resistor
;General Input/Outputs
; S.0 to S.7 are general purpose outputs (or inputs)
; S.2 to S.7 can be servos (e.g. servo S.2,75)
; S.0 and S.1 can be hardware serial port (e.g. hserin/hserout)
;Ultrasonic
; Ping or SRF05 can be used on S.5
;Infrared LED
; IR transmitter can be used on S.6 (e.g. irout S.6,1,1)
;Infrared Sensor
; IR sensor can be used on S.7 (e.g. irin S.7, b1)
Power supply Jumper J1 options:
The 5V logic supply (e.g. for inputs) always comes from base
J1 Off
Shield power terminal is used for outputs only
Base must use its own power supply
J1 Right
Base power supply is used for everything, 5V supply to outputs
No power connection should be made to shield power terminal
J1 Left
Shield power connects to base VIn so either
- shield power only, also supplies base via Vin
- base power only, full Vin is applied to shield outputs
Buffered outputs
BUFF12 is S.12
BUFF13 is S.13
Motors
Motor A
Direction is S.8 1 = one way, 0 = the other
On/Off/PWM is S.9 high = on, pulsing=pwm, low = off
Motor B
Direction is S.11 high = one way, low = the other
On/Off/PWM is S.10 high = on, pulsing=pwm, low = off
PWM frequency is critical for good motor control
and varies between motor types
for instance 20% at 10kHz works, but 20% at 1kHz just 'hums'
pwmout S.9, 99, 200 ; 50% at 10kHz
pwmout S.9, 99, 80 ; 20% at 10kHz
pwmout pwmdiv4, S.9, 249, 500 ; 50% at 1kHz
pwmout pwmdiv4, S.9, 249, 200 ; 20% at 1kHz
Good noise suppression is also essential on the motor
Input Pins
S.A0 to S.A5 are all digital inputs (if pinA.0 = 1 then)
Can also be analogue inputs (readadc S.A0, b1)
Can also be touch sensor inputs (touch S.A0, b1)
Each has an optional jumper which connects a 10k pull down resistor
General Input/Outputs
S.0 to S.7 are general purpose outputs (or inputs)
(Ping or SRF05 can be used on S.5)
(IR sensor can be used on S.7 (e.g. irin S.7, b1))
(S.6 can be used as IROUT)
S.2 to S.7 can be servos (e.g. servo S.2,75)
S.0 and S.1 can be hardware serial port (e.g. hserin/hserout)
Ultrasonic
Ping or SRF05 can be used on S.
Infrared
IR sensor can be used on S.7 (e.g. irin S.7, b1)
(S.6 can be used as IROUT)
Now the bit you won't like - the resistor has to be 'user' solder in position (remember they have to solder the LED anyway!)
This is because the darlington buffer can have different voltages (e.g. due to the J1 options). Therefore the value of the infra-red resistor should match the power supply in use on the darlington buffer (5V, 9V, 12V etc.)
Servo
S.2 to S.7 can be servos (e.g. servo S.2,75)