How to Make an Arduino Controlled Servo Robot SER

14
http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/ Home Sign Up! Browse Community Submit All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech Arduino Controlled Servo Robot (SERB) by oomlout on November 21, 2008 Table of Contents License: Attribution Share Alike (by-sa) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Intro: Arduino Controlled Servo Robot (SERB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 step 1: Parts & Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 step 2: Cutting Pieces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 step 3: Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 step 4: Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 step 5: Testing & Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 step 6: Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 step 7: Finished, Others Who Have Finished & the Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Transcript of How to Make an Arduino Controlled Servo Robot SER

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    Home Sign Up! Browse Community Submit All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

    Arduino Controlled Servo Robot (SERB)by oomlout on November 21, 2008

    Table of Contents

    License: Attribution Share Alike (by-sa) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Intro: Arduino Controlled Servo Robot (SERB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2step 1: Parts & Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    step 2: Cutting Pieces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    step 3: Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    step 4: Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    step 5: Testing & Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    step 6: Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    step 7: Finished, Others Who Have Finished & the Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    License: Attribution Share Alike (by-sa)

    Intro: Arduino Controlled Servo Robot (SERB)What better way to start experimenting with open source micro-controllers ( Arduino ) then by building your very own open source robot ( CC (SA -BY) )?What to do with your SERB?

    (here) - How to connect your SERB to the internet and drive it over a Skype video call.(here) - How to Control Your SERB Using a Wii nunchuck's accelerometers(here) - How to Add Obstacle Detecting Whiskers to Your Robot(here) - How to make 30 kits (Open Manufacturing)

    Features:

    Fully programmable using an Arduino Duemilanove micro-controller (or another micro-controller of your choosing).No need to solder.Choice of cutting options for acrylic pieces. (scroll saw, access to a laser cutter, purchasing pre-cut pieces)Easily expandable and modifiable with extra bolt holes and included breadboard.Dual ball bearing rear wheel.Up and running in 1-2 hours. (from kit)Open source design (build as many as you like)

    (Shameless Plug)In the UK and like Arduino stuff? check out our newly opened web store oomlout.co.uk

    A quick video of a completed Arduino controlled servo robot - (SERB) running the included test program (step 6)

    Note: Source files are available on a parallel Instructable (Source Files For) - How to Make an Arduino Controlled Servo Robot - (SERB)

    Image Notes1. A completed Arduino controlled servo robot - (SERB)

    Image Notes1. An Arduino Controlled Servo Robot - (SERB) - Kit. All the pieces you need tohave your own SERB up and running in a couple of hours (available from theoomlout.com store)

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    Image Notes1. An Arduino Controlled Servo Robot - (SERB) - Hardware Kit (available fromthe oomlout.com store)

    Image Notes1. An Arduino Controlled Servo Robot - (SERB) - Chassis Kit (available from theoomlout.com store)

    step 1: Parts & ToolsAll bolts can be found at your local Home Depot. The other parts can be found online (I have included a link to my favorite source for each).Parts List:

    A bundle containing all hardware items can be purchased at oomlout.com's store ( here ) ($120)Nuts and Bolts:

    3mm x 15mm bolt (x20)3mm x 10mm bolt (x12)3mm nut (x34)3mm washer (x12)8mm x 25mm bolt (x2)8mm nut (x2)Skate Bearings (x2) ( VXB ) (these are standard skate bearings so they can be salvaged from a pair of roller-blades or a skateboard)

    Tires

    Large O-ring (4.5" ID 3/16" Bead Dash #349) (x2) ( McMaster-Carr Product #9452K407 )Small O-ring (3/4" ID 3/16" Bead Dash #314) (x1) ( McMaster-Carr Product #9452K387 )

    Electronics

    Arduino Duemilanove (x1) ( Maker Shed )Continuous Rotation Servo (x2) ( Parallax )400 Contact Breadboard (x1) ( All Electronics) )Quad AA Battery Box (x1) ( All Electronics )9V Battery Clip (x1) ( All Electronics )2.1 mm Plug (x1) ( All Electronics )3 pin header (x2) ( All Electronics )A-B USB Cable - Printer Style (x1) ( All Electronics ) (not included in kit)

    Batteries:

    AA Battery (x4) (not included in kit)9v Battery (x1) (not included in kit)

    Wire:(all wire is 22 AWG solid I purchase mine through McMaster-Carr )

    15 cm Purple (x2)15 cm Black (x1)5 cm Black (x2)5 cm Red (x2)

    Tools

    Screwdriver (x1) (Philips)Needle-nose Pliers (x1)

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    Image Notes1. Continuous Rotation Servo (x2)2. Quad AA Battery Box (x1)3. Arduino Duemilanove Micro-controller (x1)4. 400 Contact Breadboard (x1)5. 2.1mm Plug6. 9V Battery Clip (x1)7. Wire - (Black 5 cm (x2)), (Black 15 cm (x1)), (Red 5 cm (x2)), (Purple 15 cm (x2))8. 3 Pin Connector (x2)9. 8 mm x 25 mm Bolt (x2)10. Skate Bearing (x2)11. 8 mm Nut (x2)12. Large O-ring (x2)13. Small O-ring (x2)14. 3mm x 15mm Bolt (x20)15. 3 mm Washer (x12)16. 3mm Nut (x34)17. 3mm x 10 mm Bolt (x12)

    step 2: Cutting PiecesPlease chose which steps to follow based on the cutting option you have chosen.

    Option 1 (Purchasing Pre-cut Parts)

    Purchase a pre-cut chassis from oomlout.com's store ( here ) ($60 including shipping to the USA and Canada)Option 2 (Digital Manufacturing (ie. Ponoko ) / Access to a Laser Cutter)

    Download the laser cutter layout ( "03 SERB Ponoko Cutting Layout P2.eps" or "03-(SERB)-Ponoko Cutting Layout (P2).cdr" )Cut the files using Ponoko or on your own Laser Cutter (using 3mm, .118" acrylic (sometimes sold as .125")

    Option 3 (Scroll saw and Drill)

    Download and print the PDF pattern (please choose the file corresponding to your paper size) 03-(SERB)-ScrollSaw Pattern (letter).pdf 03-(SERB)-ScrollSawPattern (A4).pdf(it is important to not scale the drawing while printing)Measure the ruler on the printout against a ruler you trust, if they do not match the pattern has been scaled and you need to look at your printer settings beforereprinting. If they do match up, onwards.Glue the pattern to the acrylic sheet (3mm, .118" (sometimes sold as .125").Drill holes.Cutout pieces using a scroll saw

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    Image Notes1. An Arduino Controlled Servo Robot - (SERB) - Chassis Kit - (available from theoomlout.com store)

    Image Notes1. Scroll saw pattern ready to glue to acrylic

    Image Notes1. 03-(SERB)-ScrollSaw Pattern (letter).pdf

    Image Notes1. 03 SERB Ponoko Cutting Layout P2.eps

    File Downloads

    03 SERB Ponoko Cutting Layout P2.eps ((1008x1041) 212 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to '03 SERB Ponoko Cutting Layout P2.eps']

    03-(SERB)-Ponoko Cutting Layout (P2).cdr (46 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to '03-(SERB)-Ponoko Cutting Layout (P2).cdr']

    03-(SERB)-ScrollSaw Pattern (A4).pdf ((595x842) 35 KB)

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    [NOTE: When saving, if you see .tmp as the file ext, rename it to '03-(SERB)-ScrollSaw Pattern (A4).pdf']

    03-(SERB)-ScrollSaw Pattern (letter).pdf ((612x792) 35 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to '03-(SERB)-ScrollSaw Pattern (letter).pdf']

    step 3: AssemblyCongrats on making it this far 90% of the process is complete just download the assembly instructions on this step (04-(SERB)-Assembly Guide.pdf) & after a littlelego/mechano style assembly you'll be ready to wire.

    To entertain you along the way here is a time-lapse of my assembly:

    Image Notes1. All the pieces ready to assemble

    Image Notes1. Arduino Controlled Servo Robot - (SERB) - Assembly Guide Cover

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    Image Notes1. Arduino Controlled Servo Robot - (SERB) - Example Assembly Step

    File Downloads

    04-(SERB)-Assembly Guide.pdf ((595x842) 1 MB)[NOTE: When saving, if you see .tmp as the file ext, rename it to '04-(SERB)-Assembly Guide.pdf']

    step 4: WiringWith all the big pieces together its time to add the little electric veins which will allow our robot to be controlled. To do this download and print the wiring diagram (05-(SERB)-Wiring Diagram.pdf). A first glance at it can look quite daunting, however if you make each connection sequentially and take your time it comes togetherremarkably quickly.

    The wiring is quite simple and no harm can come to your circuit until you add batteries. So wire everything up double check it, then add power.

    Image Notes

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    1. An Arduino Controlled Servo Robot - (SERB) - Fully wired and ready to test.

    File Downloads

    05-(SERB)-Wiring Diagram.pdf ((612x792) 54 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to '05-(SERB)-Wiring Diagram.pdf']

    step 5: Testing & TroubleshootingIf you ordered a kit your Arduino has come preloaded with a test program. Just put in 4 AA batteries and plug the 9v battery into the Arduino. And if everything has beendone correctly your robot will begin moving (it will turn in a random direction for a time between 0.1 and 1 second before going forward for a random time between 1 and 2seconds then pause for 2 seconds before starting again).If you have not purchased a kit an additional step is required. Download the attached zip file (07-(SERB)- SERB-Test Arduino Program.zip). Then unzip it in your Arduinosketch directory (default "my Documents\Arduino\") and download it to your arduino board. (if you are new to Arduino jump ahead one step where there are links to greatgetting started tutorials)Common Problems:

    My SERB moves slowly when it should be stopped.This is a result of your servos not being calibrated quite right, to calibrate your servos wait until your program has the servos stopped then with a small screwdriver turnthe potentiometer inside the servo (the little opening in the servo casing just above where the wires are). Rotate it either left or right until the servo is truly stopped.Things aren't quite working properly.Send us an e-mail with your symptoms and we'll try and help you out, while you're waiting for a reply double check all your wires with the wiring diagram from step 4.

    If you encounter any problem please either add a comment to this Instructable or send an e-mail to [email protected] and we'll try our very best to help youget your SERB working

    File Downloads

    07-(SERB)- SERB-Test Arduino Program.zip (72 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to '07-(SERB)- SERB-Test Arduino Program.zip']

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    step 6: ProgrammingThe physical robot is finished time to start giving it a brain.

    Before we get into the details of programming an Arduino Controlled Servo Robot - (SERB) - a few links to some excellent Arduino programming resources on theinternet.

    Arduino Starter Guide - A guide to help you start with Arduinos, from downloading the programming environment to writing your first program.

    Arduino Programming Reference - A complete easy to reference guide to the Arduino programming language.

    How Servos Work - A quick primer to how servo motors work.

    Arduino Servo Library - How the Arduino Servo library works (how we control our servos).Alright with the learning out of the way lets get programming. There are three ways to get started programing your Arduino Controlled Servo Robot - (SERB).Option 1: (Modifying SERB_Test.pde)Sometimes when programming the easiest thing to do is take a working program and start adding your own code to it. To do this download the SERB_Test zippedprogram (07-(SERB)- SERB-Test Arduino Program.zip). Proceed to unzip this in your Arduino sketch folder (default "My Documents\Arduino\"). Finally open the Arduinoprogramming environment and download it to your Arduino. The code is well commented.(or copy and paste the code from the appendix on this step to a new Arduino Sketch)Option 2: (Adding SERB Routines to your program)Add some simple routines to your pre-existing program (like goForward(), setSpeed(int) etc.). To do this download the routines in the text file (07-(SERB)- SimpleRoutines Text.txt).1. Copy and paste the preamble portion to the beginning of your program.2. Copy and paste the routine portion to the body of your program.3. Add a call to serbSetup(); to your setup() routine.Option 3: (Creating your own program from scratch)This is not too difficult. All that is required is to familiarize yourself with the Arduino Servo Library. Then the right servo is connected to pin 9, and the left servo to pin 10.

    note: Additional programs will be added here as they are developed; or if you develop something and would like it featured send me a private message and it can beadded.

    Appendix: (SERB_Test.pde Code)

    /* * Arduino Controlled Servo Robot (SERB) - Test Program * For more details visit: http://www.oomlout.com/serb * * Behaviour: A simple test program which causes the SERB * to turn randomly either left or right for a * random time period between 0.1 and 1 second. * The SERB will then drive forward for a random * time period between 1 and 2 seconds. Finally * pausing for 2 seconds before starting again. * * Wiring: Right Servo Signal - pin 9 * Left Servo Signal - pin 10 * * License: This work is licenced under the Creative Commons * Attribution-Share Alike 3.0 Unported License. To * view a copy of this licence, visit * http://creativecommons.org/licenses/by-sa/3.0/ * or send a letter to Creative Commons, 171 Second * Street, Suite 300, San Francisco, California 94105, * USA. * */ //--------------------------------------------------------------------------// START OF ARDUINO CONTROLLED SERVO ROBOT (SERB) PREAMBLE#include #define LEFTSERVOPIN 10 #define RIGHTSERVOPIN 9Servo leftServo; Servo rightServo; int speed = 100; //sets the speed of the robot (both servos) //a percentage between 0 and 100// END OF ARDUINO CONTROLLED SERVO ROBOT (SERB) PREAMBLE//--------------------------------------------------------------------------/* * sets pins to appropriate states and attaches servos. Then pauses * for 1 second before the program starts*/ void setup() { serbSetup(); //sets the state of all neccesary //pins and adds servos to your sketch randomSeed(analogRead(0)); //sets the random number seed with //something mildly random delay(1000);}/* * turns the robot either left or right (randomly) for a period between * 0.1 and 1 second. Before going forward for a random time period * between 1 and 4 seconds. Before pausing for two seconds then starting * again.*/void loop() { turnRandom(100,1000); //Turns randomly left or right for a //randomtime period between .1 second //and one second goForwardRandom(1000,2000); //Goes forward for a random time period //between //1 and 2 seconds goStop(); //Stops the robot delay(2000); //pauses for 2 seconds (whilst stopped)}/* * turns the robot randomly left or right for a random time period between * minTime (milliseconds) and maxTime (milliseconds) */void turnRandom(int minTime, int maxTime){ int choice = random(2); //Random number to decide //between left (1) and right (0) int turnTime = random(minTime,maxTime); //Random number for the pause //time if(choice == 1){ goLeft();} //If random number = 1 then turn //left else {goRight();} //If random number = 0 then turn //right delay(turnTime); //delay for random time }/* * goes forward for a random time period between minTime (milliseconds) * and maxTime (milliseconds) */void goForwardRandom(int minTime, int maxTime){ int forwardTime = random(minTime,maxTime); //determine a random time to //go forward goForward(); //sets the SERB forward delay(forwardTime); //delays for random time period}//------------------------------------------------------------------------//START OF ARDUINO CONTROLLED SERVO ROBOT (SERB) ROUTINES/* * sets up your arduino to address your SERB using the included routines*/void serbSetup(){ setSpeed(speed); pinMode(LEFTSERVOPIN, OUTPUT); //sets the left servo signal pin //to output pinMode(RIGHTSERVOPIN, OUTPUT); //sets the right servo signal pin //to output leftServo.attach(LEFTSERVOPIN); //attaches left servo rightServo.attach(RIGHTSERVOPIN); //attaches right servo goStop();}/* * sets the speed of the robot between 0-(stopped) and 100-(full speed) * NOTE: speed will not change the current speed you must change speed * then call one of the go methods before changes occur.*/ void setSpeed(int newSpeed){ if(newSpeed >= 100) {newSpeed = 100;} //if speed is greater than 100 //make it 100 if(newSpeed

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    step 7: Finished, Others Who Have Finished & the FutureCongratulations on getting this far and I hope you're having fun with your Arduino Controlled Servo Robot - (SERB).Michael Beck's SERB -Michael found the plans for the SERB over at Thingiverse.com and cut his out of yellow and red acrylic. I think it looks great.

    Mike's SERB - Mike (of St. Louis Area robot club ROBOMO ) had a friend laser cut a SERB chassis, and used his own robotic know-how to get it up and running. I thinkit looks awesome done in blue. (check out his website for details on this as well as his other robots (here)This section will have details on future developments and attachments (they will be featured here before they are properly documented). But i would also like to show offpictures of other peoples SERB's.

    So if you've finished send me a private message with a photo and a few words (be it a description or a link to your website) and I'll add it here.(Shameless Plug)If you liked this instructable check out oomlout.com for other fun open source projects.

    Image Notes1. Mike's SERB - Mike (of St. Louis Area robot club ROBOMO] ) had a friendlaser cut a SERB chassis, and used his own robotic know-how to get it up andrunning. I think it looks awesome done in blue. (check out his website for detailson this as well as his other robots http://mikesrobots.wordpress.com/mk3/

    Image Notes1. AN Arduino Controlled Servo Robot - (SERB) - With an added laptop desk(ASUS eeePC) with the addition of a simple web server a SERB becomes aninternet connected tele-pressence robot.

    Image Notes1. An Arduino Controlled Servo Robot - (SERB) - With added sweeper botattachment, two bump sensors and a Swifer pad turn your SERB into anautonomous floor sweeper

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    Related Instructables

    Add ObstacleDetectingWhiskers toYour Robot byoomlout

    OpenManufacturing -(How to Build 30(SERB) Kits) byoomlout

    DIY CNC (guide)by InstructablesGuides

    Make a WebConnectedRobot (for about$500) (using anArduino andNetbook) byoomlout

    PuttingTogether theRoboduino bySoldier6575

    A Little SwitchandPotentiometerBox for YourArduino byoomlout

    simpleWalker:4-legged 2-servo walkingrobot byedwindertien

    Easy DIY HomeAutomation(using servoswitches) byoomlout

    Advertisements

    Comments50 comments Add Comment view all 53 comments

    ardebot123 says: May 16, 2010. 4:39 PM REPLYCould you power this with solar cells?

    dunnos says: Dec 30, 2008. 1:07 AM REPLYHello mister mcfarlan sir, I am new to this whole robot stuff and all, i once built a robot called beetlebot following the BEAM principle ( that means no chip) isan ardiuno the same a pic? because that is the only controller i can get around here ( my parents don't like the idea of ordering from the internet) i know thatthe pic has some programming language... i really should investigate that... Anyway, my question: can i get a pic and do all the arduino projects? Thanks inadvance, Dennis

    i like k nex says: Jan 26, 2010. 1:17 PM REPLYOMG UR DP IS CALVIN!!!!!

    dunnos says: Jan 26, 2010. 10:54 PM REPLYCALVIN AND CAPS LOCK FOR LIFE!!!!!!!!!

    i like k nex says: Feb 21, 2010. 8:23 AM REPLYAGREED (THIS IS A BIT LATE THOUGH)

    oomlout says: Dec 30, 2008. 2:54 AM REPLYHey Dunnos.

    BEAM robots are good fun to play with.

    An arduino does the same kind of thing as a PIC but is a little different. Sorry for being so vague. I recommend checking out the Arduino web-site (http://www.arduino.cc ), for all the details.In terms of getting a PIC to do all the arduino projects the short answer is yes. However it is slightly more technical in you have all sorts of decisions tomake (different boards, programming languages compilers etc etc.). (some people really enjoy this). Choosing an Arduino takes care of those details.I hope you have fun in your electronics persual, and if you have any more questions (or would like me to answer your original ones better) feel free tosend me a message.

    Regards;Stuart McFarlan

    Good luck in your

    dunnos says: Dec 30, 2008. 8:16 AM REPLYHey stuart, i know, I love beam robots, currently making one that follows a black line. I dont find that at all vague, something like: it is the same butthe pin layout is different code used is different and so on ... i love a challenge, if it wasn't for school i'd be doing that my whole day :) i only would liketo know if i would have to learn how to program an arduino also. Also, what does an arduino starter kit cost?

    luke says: Jan 11, 2009. 11:14 PM REPLYhey dunnos, im kind-a in the same place as you, but i just bought my first arduino 2 days ago(im still wating for it to arive in the mail) i got it of aebay seller for $30usd including postage. its a arduino clone, but it all works the same.i also sprung for a motor controller shield ( im planing on building a tank.)but yes you do have to learn to program the arduino ( check this out for a bit more info )

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    i have downloaded the programing utility and have started looking at the examples, trying to get my head around it, so far it seems to be ok.luke :D

    dunnos says: Jan 12, 2009. 6:38 AM REPLYyes but you actually HAVE an arduino i just got my pic 16f628 and a programmer in the mail

    ursine100 says: Jan 11, 2010. 7:56 PM REPLYWill a Mega fit OK on this?

    Thanks,

    Dave

    wozub says: Dec 8, 2009. 10:04 AM REPLY A person would have to have god-like skills to successfully go with option 3.

    microman171 says: Jan 6, 2010. 8:03 PM REPLYMine doesn't look like the laser cut one, but it does resemble a SERB... It took about 3 hours to cut out all of the pieces.

    electronic boy says: Oct 23, 2009. 9:55 AM REPLYdose anyone sell these

    Derin says: Oct 11, 2009. 2:21 AM REPLYHow can I get rid of the nosewheel and steer with the back wheels only?

    Derin says: Oct 11, 2009. 9:20 AM REPLYNevermind,I just realized that the nosewheel was just on bearings and not on a servo of its own.

    markinraleigh says: Jun 29, 2009. 10:31 AM REPLYThanks can't wait to get to the shop, http://techshopdurham.com , and lase me one one of these.

    Ninni says: May 23, 2009. 9:11 PM REPLYCan we use Arduino Diecimila for the bot?

    znunez says: Apr 23, 2009. 7:12 AM REPLYI need major help!!!!....I'm trying to add an additional servo with a ultrasonic range finder (SRF 05) to this robot but i need the program to control all servoscombined together... i have a program to control just the servo and the sensor but i would love to combine it all together!! Thanks

    robsummitt says: May 21, 2009. 9:33 PM REPLYYour probably going to need a servo controller shield or controller. I believe the Arduino servo library only supports 2 servos.

    microman171 says: Apr 4, 2009. 12:32 AM REPLYSorry mate, forgot to give you a picture.

    http://picasaweb.google.com/Microman171/Robots#5302953069155480482

    get to da parakeet says: Mar 27, 2009. 9:47 AM REPLYerm... how do you make the 9v battery thing??

    mattameo213 says: Mar 11, 2009. 3:25 PM REPLYWoah. Is that the Stuart McFarlan I know (Troop 350?)

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    hamed345 says: Mar 7, 2009. 6:55 AM REPLYThanks friend!

    akatsuki666 says: Feb 12, 2009. 7:13 PM REPLYhi.um how an you make a sevo only spin arout 90 degrees.pls respond ty

    becauseican says: Feb 21, 2009. 1:42 PM REPLYwhen you first buy a servo unmodded it can only spin 180.

    becauseican says: Feb 19, 2009. 7:11 PM REPLYi want to build a ghetto version of this i just added up the cost and it is $33.50 not including a motor controller. Before I order anything i have to ask do i needa motor controller because i read that without one the arduino will get fried is this true please explain.

    rics says: Feb 10, 2009. 6:53 AM REPLYHi Stuart, What do you think, is it possible to create the robot from aluminium considering cutting and bigger weight of the result? Bests, Richard

    geeklord says: Feb 1, 2009. 1:26 PM REPLYyea, $175 is a little too much for me. I'm workin on skis right now anyways.

    rics says: Jan 23, 2009. 6:53 AM REPLYDear Stuart, I am new to electronics/mechatronics, so I still thinking on the assembly (before start, I hope). As I see the AA batteries look downward. Is not itpossible that they simply fall down when the robot goes on bumpy terrain? Bests, Richard

    oomlout says: Jan 23, 2009. 7:40 AM REPLYHey Rics; No worries here, the battery box holds the batteries in place with rather strong springs. Regards; Stuart

    rics says: Jan 18, 2009. 6:18 AM REPLYHello,

    The robot really looks nice.Why you do not need to use an H-Bridge motor driver contrary to this 2 similar Arduino project: here and here ?What is the difference? The Arduino or the servo type?

    Thanks in advance,Richard

    oomlout says: Jan 18, 2009. 7:42 AM REPLYHey Richard; Thanks. The reason there is no need for an H-bridge is the servo-motors have the h-bridge circuitry inside them. So you feed them powerand a signal (a pulse between roughly one millisecond (full speed reverse) and 2 milliseconds (full speed forward)). Then the circuitry inside theservomotor takes care of the power switching. Stuart

    microman171 says: Jan 17, 2009. 3:55 AM REPLYHey, This project is great! I couldn't afford laser cutting, and I didn't have a scroll saw. So each piece is hand cut. Doesn't look too flash, but I've never donethis before (This wont be the last time :-D) I am going to get the hardware tomorrow, and hopefully get the bearing in the mail soon. I am going to run thisrobot on a BASIC Stamp (Hope there is room...). Should provide a great robot base for when I figure out what I want to do. After I finish assembly, I will postyou a pic :-) Cheers, Micro

    Redneck2 says: Jan 15, 2009. 12:57 PM REPLYI know this is kind of a stupid question but what do you use this robot for?

    Nunavutnewsrules says: Dec 20, 2008. 7:22 AM REPLYnice instructable. I am thinking of making a cheap version of it with an ATtiny or a ATmega, does any one see any problems with that? Thanks

    askjerry says: Dec 14, 2008. 8:25 AM REPLYWe went to the Friday Night Build Session (FNBS on the ROBOMO forum) Mike was like a little kid wanting to build the robot so badly. We jumped in the carand drove the 10 miles back to my house, looked in the closet... no clear plastic. I dug a bit and asked, "How about blue? " It cut very nicely... I wasimpressed with the method to join the sides using the screws, tabs, and captured nuts. (I'll be stealing that idea for future projects. )It's a great chassis... I may have to revisit a design or two of my own and finally make a post here. Anyway... it took just over 1/2 hour to cut all the parts fromthe 6mm (1/8 inch) sheet. I had to rearrange the parts to fit my laser which has a 600x300mm (24x12 inch) bed. There is plastic remaining... so I'm thinkingI'll need to design some accessories like a rangefinder holder or camera mount. (At least it's something to think about.)

  • http://www.instructables.com/id/How-to-Make-an-Arduino-Controlled-Servo-Robot-SER/

    Jerry

    oomlout says: Dec 14, 2008. 3:11 PM REPLYGreat I'm excited that you liked the design, I look forward to seeing what improvements and attachments you come up with. Stuart

    WinfieldMike says: Dec 9, 2008. 11:37 PM REPLYI liked it so much I am having a friend cut one out on his laser. Should have it up and running Friday night. I'll send a pic per your request.

    iain010100 says: Nov 24, 2008. 2:24 PM REPLYVery cool! How do we make it self-aware? :-)

    oomlout says: Nov 24, 2008. 3:08 PM REPLYThanks. The original draft of the Instructable included steps to achieve this, but for the good of humanity I omitted them when publishing

    WingDings says: Dec 6, 2008. 6:00 AM REPLY:D

    Brandon121233 says: Nov 26, 2008. 2:08 PM REPLYSweet nice job, looks alot like my robot Walbot http://www.instructables.com/id/Make-a-wall-avoiding-Robot!/

    guschabal says: Nov 22, 2008. 9:58 AM REPLYI liked the idea to start handling robot with Arduino. very good.

    Migacz says: Nov 22, 2008. 2:40 PM REPLYIs it remote controled? If not, how does it work?

    oomlout says: Nov 24, 2008. 3:20 PM REPLYdark sponge is right. You can program it with what ever your heart desires. There are some great examples of what can be done with an Arduino atthe Arduino Playground . We also have plans on showcasing a few things we get up to with our SERB's at oomlout.com.

    guschabal says: Nov 24, 2008. 8:00 PM REPLYcheck this is my blog my blog, is in spanish but i publish some things with Arduino.

    dark sponge says: Nov 22, 2008. 6:01 PM REPLYThe Arduino board is a microcontroller that you can program to do just about whatever you want. In this robot, it is programmed to go forward for arandom amount of time, turn for a random amount of time, then repeat.

    dark sponge says: Nov 22, 2008. 6:07 PM REPLYYou should change your power source to 6 AA rechargeable batteries instead of one 9v battery. It would last longer on a charge and also follow the rules ofthe contest. Currenty you aren't doing what the contest says to do.

    "Simply build something neat that runs on AA, AAA, C, or D batteries, share it on Instructables, and win some eneloop batteries to power your projects in anenvironmentally safe way!"

    oomlout says: Nov 24, 2008. 3:18 PM REPLYIt is a good idea and one I toyed with however I was unable to find servo motors which were rated for 9 volts (6 x 1.5). So in the interest of not including acomplex power supply I went with the two battery option. However one of the great things about the Arduino is it's ability to run on power from the USBport. So you can program and test away without chewing through batteries.

    dark sponge says: Nov 24, 2008. 6:12 PM REPLYA 7805 is the simplist way to get a nice, regulated 5 volts. I used one in a robot I made a while ago. It used a arduino diecimila, two regular motors, aservo with an infrared sensor on it, and a motor controller board I built myself. Because the robot was drawing close to 1 amp, the regulator wasgetting extremely hot. I had to put a gigantic heat sink on it in order to stop it from overheating. A switching regulator is more effecient, but moreexpensive. Too bad the robot doesn't work anymore. One of the diodes in the motor controller board blew and I haven't had enough free time tochange it yet...

    view all 53 comments