Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: headingwest on February 17, 2013, 12:42:53 AM

Title: How many HC-SR04 sensors
Post by: headingwest on February 17, 2013, 12:42:53 AM
Hi All,

My first attempt at a robot has 2 ultrasonic sensors slightly off to the left and right. They are run by a Picaxe 20X2 and the robot is managed by an IOIO / Android. They seem to work... sometimes. I always get a good signal when the robot is idle or being tested, but when it zooms across the room it tends to have a lot of crashes.

Can anyone guide me on a good number of sensors and where it's effective to place them please?

Thanks for your help, Jim.
(http://jimsrobot.com/wp-content/gallery/robot-with-sensors/sensors1.jpg)
Title: Re: How many HC-SR04 sensors
Post by: waltr on February 17, 2013, 09:17:03 AM
Quote
but when it zooms across the room it tends to have a lot of crashes

The robot 'crashes' into objects?
or the processors 'crash'?

Are any of the wires getting loose when the robot moves? Vibrations can cause this.
Title: Re: How many HC-SR04 sensors
Post by: headingwest on February 17, 2013, 03:06:45 PM
So far I've only tested in our lounge room which has plenty of soft furnishings. But I guess the sensors often fail to see chair legs (30mm wide), angled surfaces and soft furniture.

My guess is I need a 3rd sensor facing directly forward as well.
Title: Re: How many HC-SR04 sensors
Post by: waltr on February 17, 2013, 05:41:45 PM
Soft and narrow objects can be a problem with the US sensors.
It can still be a a loose wire or other problem so try setting up a controlled environment to pin point the issues.
Even some cardboard set up as walls would be helpful to determine if the sensors and code is working or if there is a hardware problem.
Title: Re: How many HC-SR04 sensors
Post by: jwatte on February 17, 2013, 11:36:06 PM
Also, only run one sensor at a time! Wait some amount of time (say, 30-50 milliseconds) before running the other sensor, and do them ping-pong style, else you may get crosstalk.
You can mount them so they sense in an "X" pattern -- turn the leftmost to face right, and rightmost to face left. This gives you some amount of "center" sensing, hopefully enough to avoid a crash.
Also, try going slowly, not allowing a very fast top speed, until it's all tuned and working well. Then slowly increase max speed.

Finally, to compensate for the shortcomings of US sensors, you can also use a Sharp IR sensor, which works great for soft textiles, but is narrower in its sensing pattern. I use both on my rover robot.