Instructables

Autonomus Wall Following Obstacle Avoiding Arduino Rescue Bot

Picture of Autonomus Wall Following Obstacle Avoiding Arduino Rescue Bot
0617111536a.jpg
0617111536b.jpg
0701111520.jpg
I'm an Electrical Engineering major and each year my college's branch of IEEE competes in a student hardware competition. Last year's competition was inspired by the natural disasters in Haiti and Chile (the competition was held one week after the earthquake in Japan). This was a very large project that was tackled by a group of people. I was the programmer of the group but also helped with some of the sensors that the arduino would be directly interfacing with. I will only cover those parts that i was involved with, however i will briefly talk about the other parts so that readers can get a better understanding of the scale of the competition.

The playing course was meant to imitate a hotel that had been damaged during an earthquake. As seen below  there were 4 rooms with a central hallway. In each room there could be up to 4 "Victims", as well as various pieces of "debris" and a "Hazard". The victims were composed a 3" PVC cap with a magnetic coil, and an status indicator LED. the debris was various sizes of 2X4 & 1X1 lumber painted white.  The hazard was a large magnetic field  at a different frequency then the victims.One of the biggest challenges was being able to navigate the course with the possibility of your path being blocked by debris. That's where I came in!

This is my first instructables(hopefully not the last). Unfortunately I wasn't really planning to write it at the time ( I was to focused on the completion) so I don't have any pictures of the robot under construction.I finally have some time to do a write up and the Microcontroller contest was just the incentive i needed to complete it. I'd really appreciate any comments and suggestions, and I'll try to answer any questions you have. If you like my instructables please vote for me in the Microcontroller and/or Make It Move contest!

 
Remove these adsRemove these ads by Signing Up
srah11 year ago
Awesome project. Do you have a video of the robot in action?
kailash1742 years ago
Great work!!!
arif_00702 years ago
I am trying to use a Victor 884 speed control to operate the robot. I am using a Ping sensor to make it avoid walls. Have you had any experience with Victor 884? How can I use it with Ping sensor? My code for the speed control is not working the ping sensor code that I got from you. Thanks.
wkuace (author)  arif_00702 years ago
i've never used a Victor 884, I used a Sabertooth 2x12 for my code. The sabertooth uses serial commands. I googled your Victor 884, it looks like it uses a PWM signal to control it. The Arduino can create a PWM signal with the analogWrite commands. I don't know it it will work for you. I've had some trouble driving continuous rotation servos with it. You can also try using the Servo library, it generates PWM signals that work much better with servos so it might work better. You'll have to spend some time figuring out how to drive your motors at the correct speeds. then replace those Serial.write commands. Once you can get it driving forward, you'll probably have to work with the different delay functions to get your robot to turn 90deg corners, Those numbers were all designed for my robots turn speed. I hope you can get it working
Thanks for you thoughts. Which pins did you use for the Ping sensors? I couldn't differentiate Ping sensor codes from serial.write codes. My ping sensors do not work simultaneously.
wkuace (author)  arif_00702 years ago
when you have the program open click the "EDIT" menu and select Find. then search for "void ping", this will take you to the ping sensor subroutine. all of the pings are mounted on pins 2-6 and pin 11. This was done because pin 7 broke on our arduino and we needed a quick fix. you can set it back to pin 7 by deleting the If statement and removing the else statement around the the ping routine. in the program you'll see several IF statements that compare distcm[] or durat[]. You can change these numbers to the numbers for the sensors on each side of your robot. If you are not using the same number of sensors, then the program will lock up because its waiting for a pulse from the missing ping. You can modify the code by shrinking the arrays for durat,distcm,and distin and shrinking the FOR statement in the ping routine.
Thanks for your reply. Its been great help. I also have 6 ping sensors; front, front right, front left, left, right and back. Did you put the sensors in the same way? I tried to figure it out couldn't confirm, can you please let me know the mounting pin for each ping sensors. Thanks for your help.
wkuace (author)  arif_00702 years ago
I want to say 2 and 5 were the right side, other than that i'm not sure anymore, its been over a year since i programmed it. I used a simple modification of the PING example code that created an array to test just the sensors. There was no pattern, i just attached which ever wires were long enough and fit best. Its probably best to just change the numbers in the IF statements to match your sensors.
I uploaded the engineering demo day code to see if my ping sensors work. Uploading was successful however, on the display it was showing weird symbols instead of the distance. The lights were blinking on the sensors but they weren't working. I was getting those symbols even when the pings sensors were not connected. Can you please tell if I need to change anything else? Thanks.
wkuace (author)  arif_00702 years ago
Those symbols are the "ASCII" values of the Serial.write commands that control my sabertooth motor controller. The code is setup in a say that even if you have no ping sensors attached it will always send the code to drive forwards(default), my guess is that when you had no pings connected you got those symbols much slower then you did with the pings correct? The program will wait a few seconds for the pings but eventually gives up and will then send a serial command for forward, then go back to the beginning and try the pings again.

If you are still using the Victor 884 motor controller then you will need to change those Serial.write commands to a cooresponding AnalogWrite or a command from the servo library.

If you want to view the outputs of the pings then past the following code into the PING subroutine between the line that says distcm[x] = cm; and delay(1);

Serial.print(durat[x]);
Serial.print(" uSec ");
Serial.print(distin[x]);
Serial.print(" Inchs ");
Serial.print(distcm[x});
Serial.println(" cm");

this data coming out will screw up a serial motor controller like my sabertooth, but your PWM based Victor will be just fine.
agis682 years ago
nice job, well done. I wish to see a video but its ok....
wkuace (author)  agis682 years ago
Thanks, I was in a hurry to get it posted for the microcontroller contest so i left out the video, but i'll try to add it soon