Make a Web Connected Robot (for about $500) (using an Arduino and Netbook)

 by oomlout
Featured
01-WEBB-Computer and Robot.jpg
01-WEBB-Control Diagram.png
This Instructable will show you how to build your own Web Connected Robot (using an Arduino micro-controller and Asus eee pc).

Why would you want a Web Connected Robot? To play with of course. Drive your robot from across the room or across the country, using nothing more than Skype and a web browser (nothing to install on the controlling computer). After that? Dig into the software & adapt it however you like, add a GPS so you can watch where you're driving on a map, add temperature sensors to map temperature gradients in your house, or sonar sensors to add controls on what you're web drivers can and cannot run into.

Features:
  • Inexpensive - (~$500 if you purchase all parts new and considerably cheaper if you dig around in your parts bin)
  • Once up and running controlling the robot requires only a web browser - (and Skype if you want to see where you're driving)
  • Open Source and Easily Adaptable - (uses an Arduino micro-controller, Processing for the web server & all software can be run on Linux (all the code is also heavily commented to make jumping in and changing things easy))
  • Modular Design (not a completely integrated system, if you want to use a different video conferencing service no worries, or if you have a Basic stamp rather than an Arduino just right a small piece of code and slot it in)

Here's a quick video of my Web Connected Robot being driven out of the kitchen.

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts & Tools

Only a few parts are required:

Robot: Arduino Controlled Servo Robot - (SERB)
($175 @ oomlout.com ) or (make your own)
  • An open source robot which uses an Arduino micro-controller as it's brain.
(any dual servo robot platform with an arduino can be used (option 1) (please message me if you discover any other options)

Computer: Asus eee PC 4G
($280) (@Best Buy)
  • A small inexpensive laptop that is perfect for this purpose.
(any laptop (or desktop if you want to run with a chord) capable of running Processing sketches can be used)

Laptop Desk: Laser Cut Acrylic
($25 (@ oomlout) ) or (build your own step 3)
  • A few additional acrylic pieces which bolt onto a (SERB) to give it a desk for the laptop to sit on.

Nuts and Bols: (available at home depot)
  • 3mm x 10mm bolt (x4)
  • 3mm x 15mm bolt (x4)
  • 3mm nut (x8)
ameggs says: Jun 1, 2010. 11:59 AM
 Can someone post the arduino code in an easier form so us NOOBS and use it. I really love this idea and Im already building the chassis now... just need the software.
shonlh in reply to ameggsApr 27, 2013. 10:50 AM
Here is the code cleaned up.  I did not get a chance to test it.  It does past check in Arduino though. 

/*
 * Arduino Controlled Web Connected Robot (WEBB) - Serial Host 
 * For more details visit: http://www.oomlout.com/serb  
 *  
 * Behaviour: The Arduino listens to its Serial port for a command 
 *            in format 254, 88, 88, (COMMAND), (TIME) 
 *            Supported Commands - 'F' - 70 - Forward 
 *                                 'B' - 66 - Backward 
 *                                 'L' - 76 - Left 
 *                                 'R' - 82 - Right 
 *                                 'S' - 83 - Speed 
 *                                 'X' - 88 - SetSpeedLeft 
 *                                 'Y' - 89 - SetSpeedRight  
 *                                 'C' - 67 - Stop  
 *            Supported Times - 0 - 255 (0 to 25.5 Seconds) value 
 * 100 milliseconds  
 *sp 
 * 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 SERIAL SERVER PREAMBLE
 //Defining constants corresponding to each command (also the ascii code number) 
 #define FORWARD 70       //F
 #define BACKWARD 66       //B
 #define LEFT 76           //L
 #define RIGHT 82         //R
 #define SETSPEED 83         //S
 #define STOP 67           //C
 #define SETSPEEDLEFT 88   //X
 #define SETSPEEDRIGHT 89 //Y
 
 /*The three check bytes (used to keep the robot from responding to random serial *data) currently "AAA" 
 */
 #define checkByte1 65   // "A"
 #define checkByte2 65   // "A"
 #define checkByte3 65   // "A" 
 //--------------------------------------------------------------------------
 // START OF ARDUINO CONTROLLED SERVO ROBOT (SERB) PREAMBLE
 #include <Servo.h>
 #define LEFTSERVOPIN  10    //The pin the left servo is connected to
 #define RIGHTSERVOPIN  9    //The pin the right servo is connected to
 Servo leftServo;           
 Servo rightServo; 
 int leftSpeed = 50; //holds the speed of the robots leftServo
//a percentage between 0 and 100
int rightSpeed = 100; //holds the speed of the robots rightServo
                        //a percentage between 0 and 100
// END OF ARDUINO CONTROLLED SERVO ROBOT (SERB) PREAMBLE
//--------------------------------------------------------------------------
//Gets everything up and running
 
void setup()
{  
  Serial.begin(9600);                //Starts the serial port  
  serbSetup();                      //sets the state of all neccesary
//pins and adds servos to your sketch}
//The main program loop
}
 
void loop()                     
{  serbPollSerialPort();             //continuously looks to the serial port
                                    //if there is data it processes it
}
//-----------------------------------------------------------------------
//START OF ARDUINO SERIAL SERVER ROUTINES
/* 
* Processes commands delivered to the arduino's serial port 
*/
 
void serbPollSerialPort()
{  
int dta;                              //variable to hold the serial  byte  
 
if ( Serial.available() >= 5) {       //if 5 bytes are in the buffer (length pf a full request)    
dta = Serial.read();     
if ( dta = checkByte1){                        //Checks for first check byte        
dta = Serial.read();        
if ( dta = checkByte2){                    //Checks for second check byte
dta = Serial.read();            
if ( dta = checkByte3){                //Checks for third check byte
int command = Serial.read();        //Fourth byte is the command
int param1 = Serial.read();         //Fifth byte is param1
interpretCommand(command, param1);  //sends the parsed request to it's handler
}
}
}
}
}
 
/* 
* Takes the command and parameter and passes it to the robot 
*/
 
void interpretCommand(int command, int param1)
{
if       (command == FORWARD)
{
goForward(); 
delay(param1 * 100); 
goStop();
}   //if forward   
 
else if(command == BACKWARD)
{
goBackward(); 
delay(param1 * 100);
goStop();
} //if backwards  
else if(command == LEFT)
{
goLeft(); 
delay(param1 * 100); 
goStop();
}         //if left  
else if(command == RIGHT)
{
goRight(); 
delay(param1 * 100); 
goStop();
}       //if right  
else if(command == SETSPEED)
{
setSpeed(param1);
}                 //if setting speed  
else if(command == STOP)
{
goStop();
}                               //if stop  
else if(command == SETSPEEDLEFT)
{
setSpeedLeft(param1);
}           //if setting left speed  
else if(command == SETSPEEDRIGHT)
{
setSpeedRight(param1);
}         //if setting right speed  
else
{                            //if unrecognized command do a little shimmey
goLeft(); 
delay(150); 
goRight(); 
delay(150); 
goStop();
}
}
 
//------------------------------------------------------------------------
//START OF ARDUINO CONTROLLED S ERVO ROBOT (SERB) ROUTINES
 
/* 
* sets up your arduino to address your SERB using the included routines
*/
 
void serbSetup()
{  
setSpeed(leftSpeed);  
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)
{  
setSpeedLeft(newSpeed);                 //sets left speed  
setSpeedRight(newSpeed);                //sets right speed}
}
/* 
* Sets the speed of the left wheel 
*/
 
void setSpeedLeft(int newSpeed)
{  
if(newSpeed >= 100) 
{
newSpeed = 100;
}     //if speed is greater than 100
//make it 100  
 
if(newSpeed <= 0)
{
newSpeed = 0;
}       //if speed is less than 0 make
//it 0   
leftSpeed = newSpeed * 0.9;               //between 0 and 90}
}
/* 
* Sets the speed of the right wheel 
*/
 
void setSpeedRight(int newSpeed)
{    
if(newSpeed >= 100) 
{
newSpeed = 100;
}     //if speed is greater than 100
//make it 100  
if(newSpeed <= 0) 
{
newSpeed = 0;
}       //if speed is less than 0 make
//it 0   
rightSpeed = newSpeed * 0.9;               //scales the speed to be 
 
}
 
/* * sends the robot forwards 
*/
 
void goForward()
leftServo.write(90 + leftSpeed);
rightServo.write(90 - rightSpeed);
}  
 
/* 
* sends the robot backwards 
*/
 
void goBackward()
leftServo.write(90 - leftSpeed); 
rightServo.write(90 + rightSpeed);}  
/* 
* sends the robot right 
*/
 
void goRight()
leftServo.write(90 + leftSpeed); 
rightServo.write(90 + rightSpeed);
}
 
/* 
* sends the robot left 
*/
 
void goLeft()
leftServo.write(90 - leftSpeed); 
rightServo.write(90 - rightSpeed);
}
 
/* 
* stops the robot 
*/
 
void goStop()
leftServo.write(90); 
rightServo.write(90);
}
 
//END OF ARDUINO CONTROLLED SERVO ROBOT (SERB) ROUTINES
 
//---------------------------------------------------------------------------
sgms2 says: Oct 5, 2012. 12:12 AM
Apparently this was just an advertisement for oomlout.

They do not respond to any enquiry. Probably gone out of business by now .


Apr 4, 2010. 11:45 AMdaveo84 says:
Using this code and the wiring diagram supplied, when I connect my arduino board via usb to any machine both servos start spinning...

What gives?

I had this problem too.

I can't work it out either
erockizon says: Oct 2, 2012. 12:07 AM
how do you communicate with the robot with your laptop. as in how do you read values from the robot from your laptop.
cpie says: Sep 11, 2012. 1:18 PM
if you wanted you should try video conference facilities.
pkelley4 says: Dec 2, 2011. 8:00 PM
The oomlout links for the chassis are not functioning. Are these still available?
synchr0nize says: Nov 15, 2011. 6:18 AM
Is there a way to bind the keys you use to the keyboard instead of clicking left/right on the screen?
Avadhut.Deshmukh says: May 16, 2011. 6:59 AM
Good Job ! i like robot pc!
Puze says: Feb 6, 2011. 1:11 PM
Does anyone know how you can run this on linux?
ZsurzsaLaszlo says: Nov 9, 2010. 11:25 PM
Hy, can someome tell me where can i find the Pattern for the wheels and the lower part of the robot?

Thanks,
crxksa says: Aug 11, 2010. 3:32 AM
can you give me the code plz i am tring for 2 month still no progress crx.ksa@gmail.com
D5quar3 in reply to crxksaSep 8, 2010. 3:36 PM
try using http://www.instructables.com/id/how-to-build-MACKRA-a-serb-variant/step7/the-software-arduino/
crxksa says: Aug 9, 2010. 11:53 PM
can any one sent me The code for the arduino webserver crx.ksa@gmail.com
kyle brinkerhoff in reply to crxksaSep 8, 2010. 9:45 AM
dude just use vspe , all your problems will be solved, for the video feed use webcam xp
crxksa says: Aug 21, 2010. 3:34 PM
hi i build the robot it took 3days to do it , after i got the code from a member http://www.youtube.com/watch?v=OuyOQKXwtUA ok bye
DingleNutZ says: Mar 30, 2010. 2:32 PM
(removed by author or community request)
crxksa in reply to DingleNutZAug 10, 2010. 1:55 AM
can you give me the code plz i am tring for 2 month still no progress crx.ksa@gmail.com
zmaster4 says: Jul 26, 2010. 5:39 AM
really good tutorial :)
daveo84 says: Apr 4, 2010. 11:45 AM
 Using this code and the wiring diagram supplied, when I connect my arduino board via usb to any machine both servos start spinning...

What gives?
robotmaker says: Feb 14, 2010. 10:05 AM
nice job tooo but missing 05-webb arduino.zip
nanni78 says: Dec 27, 2009. 2:54 AM
hello missing file 05-WEBB-Arduino Code.zip? good job
danielemur says: Nov 20, 2009. 9:17 AM
Could you use Lego mindstorms?
adrian.robb says: Jul 8, 2009. 11:25 PM
I'm pretty sure Oomlout is an internet store only.
Either http://www.oomlout.com or http://www.oomlout.co.uk
ze.gmonteiro says: Jul 3, 2009. 3:05 PM
Congratulations! I liked it very much... but wouldn't it be better if made from a Wishield instead of a netbook? (sorry about the English) http://asynclabs.com/home
cats92 says: May 1, 2009. 10:41 PM
Very nice and easy to use. Works well on the first try. Thanks
max_ruls says: Mar 18, 2009. 1:54 AM
hay dood i love your web car well thats what i wood call it if i made it i wish that you coud tell me of an oomlout shop near brisbane if you can pleas can you email me at reif@tpg.com.au
psymansays says: Feb 23, 2009. 9:13 PM
You can also use a VPN (LogMeIn Hamachi makes them easy) and write some simple TCP/IP client/server programs, to add proportional joystick support, and get better command-throughput than over HTTP.

I have something a little bit like this, that I built: http://www.youtube.com/watch?v=c4M8YzrSBqc
DSCN0556.JPGServerScreenshot.jpgClientScreenshot.jpg
raykholo says: Feb 18, 2009. 8:04 PM
cant it just take commands from some website? maybe it would look at the blog section for text commands and u could password protect the site so it can do everything as u did here?
raykholo in reply to raykholoFeb 18, 2009. 8:06 PM
never mind - i just realized that thats what u did, i was thinking more about something without all the numbers, so u could just go onto www.(whatever).com , login, and take it from there...
rics says: Feb 10, 2009. 6:50 AM
Hi Stuart, Am I right that for a bigger laptop parts should be scaled properly? Bests, Richard
rics says: Feb 10, 2009. 6:30 AM
Hi Stuart, you mention the cdr and eps files in step 2 but there is no link to them as it was with SERB. Could you add them? (I already got the electronics working and I have a cardboard prototype robot but now I am thinking about waterjet cutting and these files may be helpful.) Bests, Richard
vince086 says: Jan 30, 2009. 9:47 AM
this is really cool !! 2 questions, Can this work with a windows 98 SE computer ? and Can it work using 9 pin Serial port instead of usb? never really got usb devices to work on old computer
joejoerowley says: Jan 19, 2009. 7:25 PM
Great Instructable! 5 stars!
luke says: Jan 9, 2009. 4:14 AM
i have a eee, (check my instructables, would like to know what you think ) and last night i bought a arduino ..... that is creepy i think i may have to build this, but with tracks :D ( as i have them "in stock") very very nice job you have done by the way.
mrbleh says: Nov 29, 2008. 10:04 AM
I cant help but think of this: xkcd ROCKS!
new_pet.png
fishyfish777 in reply to mrblehDec 16, 2008. 4:34 PM
Yeah.
evanwehrer says: Dec 4, 2008. 11:02 AM
If you wanted to you could add a USB webcam so that you can have the laptop lid closed.
mrbleh says: Nov 29, 2008. 10:07 AM
Oh, and that's completely awesome, by the way.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!