Ultrasonics

Ok so next week I will be showing a bunch of 6th graders how to work with sensors and basic robotics tasks. I would like to demo an ultrasonic by maybe making it traverse a room without witting obstacles. Unfortunately I have almost no experience with this sensor. I have gotten it to work to an extent but it has problems when it is not facing directly at the wall. Has anyone ever played around with this sensor? Do you have any ideas for this or another ultrasonic task?

Thanks, Titan 103

My favorite ultrasonic demo is to create a squarebot with the sensor pointing forward. When the sensor reads about 18" away from the wall it backs up for 4 seconds. You then turn the controls over to a roboteer and have them drive into the wall as fast as they can. It should start backing up about 3" from the wall (once the sensor fires and the motors overcome momentum.)

In order for the ultrasonic sensor to detect something it needs to have something large for the sound waves to reflect off of. So something like a table leg would be hard to detect because of its small profile. Things like walls are much easier to detect. It also needs something where the waves can bounce off and return to the sensor. So a robot would have trouble detecting a wall if it is headed towards the wall on an angle because the waves would bounce off the wall but not return to the sensor. Unfortunately there isn’t much if anything you can do to prevent this from happening. It’s simply the sensor’s weak spot.

One thing that my school figured out after many hours of frustration is that if you have multiple sensors, than you need to fire them off a few milliseconds apart, because they tended to pick up the other sensors’ waves when they all fired at once.

A simple ultrasonic project is the Scaredybot in this document. It backs away from you when you get into range.

A very simple variation on this is the Pit Bull bot. Same as Scaredybot, but simply reverse the motor wires, and it attacks/advances when you get into range.

I was able to make a pretty good code today. It traverses a room and it uses bumper sensors and an ultrasonic to avoid obstacles. I also made a line following code so that if you place somthing on the line the robot turns around and follows the line the other way. This one works very well, it will pick up a pencel standing up in front of it.

Titan 103