Congratulations Richard R, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

What Kind Of Sensor Do I Need

Assistance Requested

Help bhouston with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

bhouston claims to have checked these sources:

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?

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.

Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


@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...


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.



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.


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


Wow ! You guys are quick! An IR sensor it is then.