Question
Asked January 21 2015

Community Question

I want to put a sensor on a robot to keep it from running off the table or down a flight of stairs. Something that can sense the drop off. What do I need for this? is there a way to configure an Ultrasonic sensor to do this?
Thanks
January 21 2015
@Bob... This is what I use for that... IR Detector

This will work too (depending on how low to the ground your bot is)... Basically an off/on analog switch... Short range IR sensor

These would use the analog ports and are easy to use... Roombas use this kind of sensor too to keep from falling down stairs...
January 21 2015
Others have used a sharp IR sensor for this. I just mounted one to the front of my Roli, but I haven't written the script needed yet. The Sharp Distance Sensor EZ-Builder object stops the movement when you get too close to something rather than when you get too far from it, so unless DJ can add an object, we'll need a script to monitor the ADC port and over-ride the Movement Panel or movement script(s) when it senses a drop-off.

A ping sensor would probably work, but I think the IR sensors are more sensitive to close objects.

Alan
January 21 2015
I use ir detectors for my wall-e pointing down.

The type of sensor only depends on the distance you need to measure. An IR sensor will measure short distances really well (a couple of inches) where a Ultrasonic sensor will measure a few feet. Also, the sensor you pickup for this could go further or shorter depending on the brand of the sensor. Ultrasonic isnt as good for really close up (a few inches) for the most part.
Jeremie
Synthiam
January 21 2015
An OPB704 is an ideal sensor for that application but it does require a couple external resistors to be added in order to work well with the ez-b. There should be a few application circuits floating around the intertubes, but it's a common reflective sensor for robotics.

edit: It's best to hook up to an analog port just like the sharp sensors
January 21 2015
Wow ! You guys are quick! An IR sensor it is then.
Thanks