IR SENSOR ROBOT

This is my second robot, it is the same basic "cutting board" robot but now using the Sharp GP2Y0A02YK0F to avoid objects and walls. The code have comments and functions in portuguese like frente() = forward(), it was the way i found to undestand how to do it and to help other people from my country to understand it too. I think it is very basic code and if you have some advice to improve it .. it is welcome!

After testing i found that the values readed by the sensor have the following relation:

600 = 20 cm
500 = 35 cm
400 = 45 cm

So... changing that values in the code changes the distance that the robot stop when it detects an objetc.
That sensor have a good range , about 1.5 meter but that is not usable because the readings get very unstable.

The logic in the code makes the robot go ahead > stop when object is detected > turn head left > scan > if clear > turn left. If there is and obstacle in the left it scans to the rigth and if clear turns rigth. If there is obstacle in front, left and rigth it turns rigth again to try scape the trap. It always go back a little to make easy turning around.

Avoiding objects and walls

  • Actuators / output devices: 3 servos
  • Control method: autonomous
  • CPU: Arduino Duemilanove
  • Operating system: Arduino
  • Power source: 4 AA batteries and 1 9 V batterie
  • Programming language: Arduino
  • Sensors / input devices: Sharp GP2Y0A02YK0F
  • Target environment: Indoor or outdoor

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/ir-sensor-robot

Verry good
I like it !!!

Looks great
Looks great. I like the chopping board :slight_smile:

Unable to stop the Servo motors

Hello, I am making a robot, the programming and the circuit is pretty similar to your robot, my problem is that for some reason I am unable to stop the servo motors, sensors are working correclty, any recommendation? thank you.

Hi!

Please use the link below to see my code for this robot, maybe it can help:

https://docs.google.com/leaf?id=0B4nH-dLKWTKmMDI5NWJlOWItMWYxYy00YjNjLWFkNDctNWEyYmMwYzJhZDlj&hl=pt_BR

Good Luck!

First saw the video and was

First saw the video and was thinking "man, that’s a chopping board, what the hell is he doing with this?"

Well done, especially the chassis :wink:

Love it

I especially like your application of a landing strut as a sensor tower.  Cooool.

landing gear

Yes! it is a landing gear from an old model plane… you are very good observer!