Ultrasonic sensor Vs pressure sensors

Can i use a pressure sensor in place of a ultrasonic sensor in a robot type situation.

An ultrasonic sensor is usually used to detect distance to obstacles. How would you use a pressure sensor?

Well he could use a spring loaded bumper to move a switch or 4 or connect a microphone to the bumper and listen for the bump although it might not work too well for a couch or a large sleeping dog... but you could certainly use the reflective IR device home made or purchase one, I've seen both red and IR commercially. Make one is the easiest way though easily calibrated and if you pulse the device it should work or find a photo interrupter and gut it for the source/sensor and do the same. IR phototransistors are easy to find so are IR LED's inexpensively too. IR photodetectors can be made from LED's as well but that takes an op-amp, phototransistors are much easier, some even bring out a physical base lead to adjust sensitivity. Easy task too. IMO

Doc

Thanks Docedison I'm going to substitute a spring bumper and have it hit a pressure sensor, just until I get my ping ultrasonic sensor.