IR SENSOR ROBOT

Posted on 11/10/2009 by miklos
Modified on: 13/09/2018
Project
Press to mark as completed
Introduction
This is an automatic import from our previous community platform. Some things can look imperfect.

If you are the original author, please access your User Control Panel and update it.

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 ...


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
LikedLike this to see more

Spread the word

Flag this post

Thanks for helping to keep our community civil!


Notify staff privately
It's Spam
This post is an advertisement, or vandalism. It is not useful or relevant to the current topic.

You flagged this as spam. Undo flag.Flag Post