IR sensors - "Avoiding obstacle robot"

Hi guys,
Could you help me?
I would like to develop an “avoiding obstacles robot” but I have some doubts and problems.
I want to place two IR transmitters and 1 IR detector forward (like the ones in the photo) and other two IR transmitters and 1 IR detector backward.

  • Do you think this solution can work?
  • In order to allow the robot to avoid all the obstacles situated along its path without any interruptions , what is in your opinion the best solution?
    Thank you so much in advance for your help!

Andrea :wink:

Hi there

I am a noob. So take my words under caution!

I am also making a similar one and hooked up 3 distance sensors, 1 facing directly forwards and two facing diagonally to rt and lt. This way I can scan for a safety corridor ahead.

At present I can scan for the clearance fairly well with it but am fighting with triggering all sensors with one digital pin just to save pins for other purposes.

I am using HCSR04 distance sensors. The ones that look like bug eyes.

I did not think of using IR. Wont it get absorbed in a unpredictable way with all the materials around the house and make it hard to judge obstacles. Remember I am a noob.

Good luck.

Dear Skodela,
thank you so much for your reply!
What do you think about the backward sensors?
Do you think are unnecessary?
Thanks again,

Andrea

Hi there

After reading your post I went and ordered the IR sensors to play.

With regards to sensor backwards, it really depends on your application. In my case I did not put a sensor behind since I am planning to make it run forwards, if it finds an obstacle it will reverse a little - just where it has been before so there should be no new static obstacles, then make a turn and go forward until clear. This is of course not completely reliable.

As of now the distance sensors complain when triggered together, I am going to put a millisecond or so delay between reading each sensor - so as to avoid hearing echos from other sensors.

In the end I may end up triggering them individually. I have 3 sensors facing forward to get clearance ahead and to right and left sides.

I think easiest way is to add one item at a time and test/debug before going to next.

Hope that helps some.

Hi skodela!
thank you so much for your help! :slight_smile:
In your reply you said "In my case I did not put a sensor behind since I am planning to make it run forwards, if it finds an obstacle it will reverse a little - just where it has been before so there should be no new static obstacles, then make a turn and go forward until clear. "

When the sensor detects an obstacle, how much the robot should reverse/turn? Until the sensor continues to detect the obstacle? Or the turn angle is fixed/unmovable?
Your kind help will be very useful!
:wink:

In my case I did a reverse for 1sec, turn left, forward for 1 second, straighten. This process is repeated until there is a clearance ahead. So a multipoint turn. The RC car I destroyed to get the motor and wheels is old and it's right turn circle is much wider than the left turn - hence the choice of left turn!

I guess how you do it depends on your design and need. For eg: my bug is made of foam and a few bumps won't do any damage. However if you rather avoid all bumps and make it error proof, you can always scan 5-6 directions around the bug and maintain a constantly updated field clearance. Then you can pick the best number from the array - with most clearance and aim to turn that way.

Myself, only doing it for fun and play. So if it seem to bump itself on the walls, even more fun :slight_smile: Obviously I won't be designing rovers for NASA!

Hi skodela! :wink:
Many thanks for your reply!

I have another doubt...
The robot can detect an obstacle situated at different distances.
In order to avoid it, the robot should turn left or right for xx°.
The problem is that the turn angle shouldn't be the same for all the distances. Infact, to avoid an obstacle situated near the sensor, the robot needs a big turning angle, while for higher distances it needs a smaller turning angle.
How can I control the relationship between the distance and the turning angle?
:wink:

andreadil87:
How can I control the relationship between the distance and the turning angle?[/b]

Think that one through and I'm sure you'll figure it out, at least in principle.

How does your robot turn- fast and slow on opposite side wheels or do you have a 3rd wheel to turn at a certain angle?

In either case, what makes a shallow or sharp turn? Then just have an if with a bunch of elses: if distance is very close, do whatever you need for a sharp turn; medium distance?- medium angle, and so on.

(Or if you feel fancy you could perhaps establish a math relationship- I'd go for a few bands: very near, near, not so near, quite far or whatever and have a hard-coded angle for each.)

Hi All.
I have built a few bots, mostly I use U/S sensors of the HSC05, this sends out a burst of ultrasonic sound (about 40KHz) and records the time it take to return, this time is easy to convert into distance, so no only do you know if there's something there but how far too. If you mount this on a servo it can scan left to right, looking..

IR sensors are only suitable for close distances like a few CM! Ok for line following, or mounted over wheels to see they don't hit anything.

You can see some of my bots here: www.melsaunders.co.uk under Electronics.

Hope it helps.
Regards

Mel.

Hi Cactusface!
You said that the ultrasonic sensors are able to record the time and convert it into distance.
Using IR sensors, could I use the same function? Is it possible?

Your robots are fantastic!! :slight_smile:
If I want to use fixed IR sensors (not mavable) forward, do you think it's necessary use more than 1 sensor (for example 3, like the ones in the following page)?

http://store.qkits.com/images/FK1111.jpg

Cactusface:
Hi All.
I have built a few bots, mostly I use U/S sensors of the HSC05, this sends out a burst of ultrasonic sound (about 40KHz) and records the time it take to return, this time is easy to convert into distance, so no only do you know if there's something there but how far too. If you mount this on a servo it can scan left to right, looking..

IR sensors are only suitable for close distances like a few CM! Ok for line following, or mounted over wheels to see they don't hit anything.

You can see some of my bots here: www.melsaunders.co.uk under Electronics.

Hope it helps.
Regards

Mel.

Hi Cactusface , your bots look pretty cool, I love the one before last, with US sensor on a stepper. I am pretty new to the arena and learning slowly. Seeing projects like yours is a motivation. Thanks