Robot avoid obstacle and hill climbing problems.

Hi everybody,

This is my first project that use Arduino. It is about to make a 3 wheels robot that can avoid obstacle and can climb a hill.

For avoiding obstacle, I plan to use Ultrasonic sensor to detect an object.

For hill climbing, I plan to use Accelarometer.

I use X axis. If value is negative, robot will climb up, if value is positive, the robot will climb down.

My question is how to avoid Ultrasonic sensor detect a hill as a obstacle. And is there anyway to do this project?

Thanks for reading my question. :slight_smile:

nhatnmse61103:
My question is how to avoid Ultrasonic sensor detect a hill as a obstacle. And is there anyway to do this project?

Set a distance threshold in your code. Ignore detected objects above that distance (it's probably a hill). Below that distance, it's probably an obstacle.

Assuming a horizontally-aimed sonar, this will work best if the sensor is placed high on the robot (though this will hurt your ability to sense short obstacles). Alternatively, put the sensor low on the robot and aim it upwards a bit.

It's a bit confuse for me. It makes the robot being less flexible. :blush:

When robot is running and suddenly I put an obstacle below the "ignore distance" and robot will go wrong.

If you are driving a car your brain is the computer that decides the difference between a hill and an obstacle. While we do it unconsciously I suspect it requires a lot of sophisticated processing. Part of our ability is based on the improbability of something that looks like a hill being a wall with a hill painted onto it.

Obviously one of the inputs is the steepness of the hill - some hills are too steep to drive up and then come into the "obstacle" box. But even detecting steepness with a camera must be very difficult.

And one can't just do a "suck it and see" by having the car try to climb an obstacle - it might damage the obstacle or the car.

I would be surprised if an Arduino can manage this problem.

...R

nhatnmse61103:
When robot is running and suddenly I put an obstacle below the "ignore distance" and robot will go wrong.

Placing new obstacles was not part of your initial design criteria. Even so, I don't see this as an insurmountable goal. To help, we need you to:

Post all of your code in #code tags.
Tell us exactly what your robot is doing
Tell us what you want your robot to do instead