Unlike most roaming 'bots, this one actually roams in such a way that it actually seems to be 'thinking'! With a BASIC Stamp microcontroller (Basic Atom, Parallax Basic Stamps, Coridium Stamp, etc.), a chassis of some kind, a few sensors, and some sophisticated code from this instructable, you can create a robot that will execute movements you never even programed into it!

Here's a video (it's kind-of low quality, but I'm working on that. (I am still trying to work out the part that it's too slow.)

Step 1: The Sensors

The (name?)...Well, let's just call it Bob. Bob has five sensors

  • Ultrasonic Rangefinder (aka "sonar")
  • 2 Sharp GP2D12 IR Sensors
  • 1 Standard IR Assembly (more on this later)
  • 1 CdS (Cadmium Sulphide) Photocell

The ultrasonic rangefinder helps Bob see obstacles that are right in front of him; they also tell him what distance the object is from him. This can be obtained from many sources. You can find them from (Parallax ; they call it the "Ping)))"), Acroname, HVW Technologies, and so many more sites. No matter where you go to find them, they all cost about the same (~ $30). The two IR sensors made by Sharp are very easy to use when used for simple object detection as in this case. You can get them at may online stores, such as the ones listed above. They help Bob see obstacles that the ultrasonic rangefinder can't; obstacles that are coming too close to the sides of the chasis. They cost about $12 to $15 depending on where you get them. The "IR assembly" I made myself; see step 2 for assembly. The CdS Photocell (or light-variable resistor, whatever your preference) is for detecting changes in ambient lighting. Bob uses them to know when he's in a dark or light room.

If anyone who has prior experience with any of the Sharp IR rangers, FYI, they are not being used for actual distance measurement in this robot. I do not have an ADC (Analog-to-Digital Converter), neither do I know how to use them that way. They are simply providing a HIGH or LOW signal to the BS2 microcontroller.

The datasheets for the Sharp IR's as well as the Ping))) sensor can be found on the net, but if you're lazy like me, you can scroll down a little further an there they are!
<p>this looks interesting, you can find whatever u need to make your own robot here:</p><p>http://www.amazon.com/s?marketplaceID=ATVPDKIKX0DER&amp;me=A2I0DT8TRUL79X&amp;merchant=A2I0DT8TRUL79X&amp;redirect=true</p>
<p>this looks interesting. You can find whatever you need to construct your robot here:</p><p><a href="http://www.amazon.com/s?marketplaceID=ATVPDKIKX0DER&me=A2I0DT8TRUL79X&merchant=A2I0DT8TRUL79X&redirect=true" rel="nofollow">http://www.amazon.com/s?marketplaceID=ATVPDKIKX0DE...</a></p>
Hi, I started on a project using IR sensors but for some reason my servos only keep moving forward even if the sensor detects an object ahead. I checked the code and it seems to be fine. the connections are according to the codes. so im not quite sure whats going on there. any ideas? <br>Here is the code if anyone sees anything wrong with it please let me know. <br> <br>/* <br> * Robotics with the BOE Shield - FastIrRoaming <br> * Adaptation of RoamingWithWhiskers with IR object detection instead of <br> * contact switches <br> */ <br> <br>#include // Include servo library <br> <br>Servo servoLeft; // Declare left and right servos <br>Servo servoRight; <br> <br>void setup() // Built-in initialization block <br>{ <br> pinMode(10, INPUT); pinMode(9, OUTPUT); // Left IR LED &amp; Receiver <br> pinMode(3, INPUT); pinMode(2, OUTPUT); // Right IR LED &amp; Receiver <br> <br> tone(4, 3000, 1000); // Play tone for 1 second <br> delay(1000); // Delay to finish tone <br> <br> servoLeft.attach(13); // Attach left signal to pin 13 <br> servoRight.attach(12); // Attach right signal to pin 12 <br>} <br> <br>void loop() // Main loop auto-repeats <br>{ <br> <br> int irLeft = irDetect(9, 10, 38000); // Check for object on left <br> int irRight = irDetect(2, 3, 38000); // Check for object on right <br> <br> if((irLeft == 0) &amp;&amp; (irRight == 0)) // If both sides detect <br> { <br> maneuver(-200, -200, 20); // Backward 20 milliseconds <br> } <br> else if(irLeft == 0) // If only left side detects <br> { <br> maneuver(200, -200, 20); // Right for 20 ms <br> } <br> else if(irRight == 0) // If only right side detects <br> { <br> maneuver(-200, 200, 20); // Left for 20 ms <br> } <br> else // Otherwise, no IR detects <br> { <br> maneuver(200, 200, 20); // Forward 20 ms <br> } <br>} <br> <br>int irDetect(int irLedPin, int irReceiverPin, long frequency) <br>{ <br> tone(irLedPin, frequency, 8); // IRLED 38 kHz for at least 1 ms <br> delay(1); // Wait 1 ms <br> int ir = digitalRead(irReceiverPin); // IR receiver -&gt; ir variable <br> delay(1); // Down time before recheck <br> return ir; // Return 1 no detect, 0 detect <br>} <br> <br>void maneuver(int speedLeft, int speedRight, int msTime) <br>{ <br> // speedLeft, speedRight ranges: Backward Linear Stop Linear Forward <br> // -200 -100......0......100 200 <br> servoLeft.writeMicroseconds(1500 + speedLeft); // Set left servo speed <br> servoRight.writeMicroseconds(1500 - speedRight); // Set right servo speed <br> if(msTime==-1) // if msTime = -1 <br> { <br> servoLeft.detach(); // Stop servo signals <br> servoRight.detach(); <br> } <br> delay(msTime); // Delay for msTime <br>} <br>
Can i use bs2 module instead of bs2e? it works the same way ??
do you know how much this costs? and were do i get the stuff to build it with? <br>This is awesome and please answer my questions.
This could, thanks to the sonar being used, theoretically be used to map places out, removing the necessity of a manual map-out of areas. This could be implemented in such things as automatic vacuums and such! The robot goes out to map the area, determines the best area covering and sets out on its mission. Coming upon an obstacle, it could update its maps, and hence never need user input!<br />
In step 4, what is the VDD voltage needed for the IR&nbsp;Detector? <br />
5v<br />
That's a really cute robot.&nbsp; The startup chirp is the best.<br />
to make it move faster remove the 100 milisec pause in the ping coding
...and I WOULD, except that that delay is required to wait for the ping sensor to refresh; without it, the sensor would not function properly because it is being polled too often.
why does the source code have an error....got error on string when i run it using the Matlab
hm... i want to build a robot, aswell but i dont' want to spend much money... so i guess my best bet would be to salvage parts from broken electronics... so where do i start and how much did this project cost you
The whole thing cost me about $210
$999,999,999,999,999,999,999,999,999,999,999,999,999,999,99?<br/>*Grabs chest* UGHHHHHHHHHH... *BANG*<br/>
you should try the $50 dollar robot on societyofrobots.com
try <a rel="nofollow" href="http://www.amazon.com/Robot-Building-Beginners-David-Cook/dp/1893115445/ref=pd_bbs_2?ie=UTF8&s=books&qid=1196876479&sr=1-2">this book</a>my son found it useful in making robots some out of &quot;found&quot; parts ....motors from broken toys parts from a mouse etc.<br/>
were do you get the mini bread boards they look really useful or did you jsut but the boe on the robot
I get those at Radioshack.
but theres no radioshack in candda :( only the crappy source witch dosent sell electonics
American Science and Surplus has a lot of parts for robot building. Just Google them. Not sure what the dollarUS/dollarCA exchange rate is any more.
Nice looking forward to build P.S fry lock is awesome
please could u tel me the range of the CdS photocell u've used...
**UPDATE** 'BOB V2.0' soon to come! BOB V2.0 will have hearing, extra brain power (master-slave) so he doesn't 'jerk-crawl' anymore, more stamina, sensors, and more advanced behavior! Keep your eyes open...
Woow. I just did the math on power consumption for the new power setup I'm using for 'BOB V2.0', and it's pretty striking. 'BOB 2.0' is going to need a switching regulator, because with 19.2V worth of rechargeables, and at least 250ma max current draw, that comes out to at least 3.55W power loss! I could have cooked an egg on that linear VR!!!
This is absolutely awesome! Is that just a aluminium base? looks really cool! Plus from me.
Yes, that's an all aluminum base. Thanks!
looks kinda like WALL-E!
Nice job, but I'm curious as to why you have it stop and go in a jerking motion?
Well, that's due to the slow microcontroller. I have the Basic Stamp loaded up with soo much code, and it is polling so many sensors and doing so much math, that it is a bit of a burden for it. The microcontroller only does like 4,000 instructions per second, where as your average AVR does like 20 MIPS! (million instructions per second). That's why I DON'T use the BS2 anymore! If I were to use the Arduino (I'm sure you've heard of it) as the 'brain' for 'Bob', then it would go REALLY fast!
Yeah my robot Walbot <a href="http://www.instructables.com/id/Make-a-wall-avoiding-Robot!/">http://www.instructables.com/id/Make-a-wall-avoiding-Robot!/</a> uses the Arduino board, and it works great.<br/>
Get the ServoPal from parallax or any servo controller, then you won't have to send the pulses to the servo every 20 or so milliseconds. Then it will run smooth and not jerk.
Yeah, but I don't believe in spending a crapload of money for some part that helps the handicap of a $50 microcontroller when I could purchase a $3 AVR chip that does three times as much as the BASIC Stamps, and is ***5,000*** times faster than the BS2 (and yes, it's that much faster)! Thanks for the info, though.<br/>
Here's video of an obstacle avoiding robot I made that uses no microcontroller, no programming, and only a single 9v battery. 2 distance sensors, 2 relays, 2 transistors, and a resistors/capacitors/diodes is all it takes.<br/><a rel="nofollow" href="http://youtube.com/watch?v=zW1pwJyjOVI">http://youtube.com/watch?v=zW1pwJyjOVI</a><br/><a rel="nofollow" href="http://youtube.com/watch?v=szJ0eleTgSk">http://youtube.com/watch?v=szJ0eleTgSk</a><br/><br/>
Great job on this one. The speed is impressive. How about posting an instructable on it?
That is really great, nice job!
hay i have that thats called the boe bot right? boe bot stand for 'borad of education bot'
if you give it a suicidal oersonality does it still avoid walls or does that only affect the drop off sensors
cool! you must be really smart to make something like this, unlike me, haha.

About This Instructable


103 favorites


More by RPisces: Room Visitor Counter with Relay Control ATX Power Supply --&gt; Cheap Bench-Top Power Supply Automated Plug-In Appliances
Add instructable to: