Devantech SRF04 and 05 Ultrasonic Sensor

The Devantech SRF04 and SRF05 ultrasonic sensors are easy to use and reasonably accurate distance ranging sensors. To use them, you send the sensor s pulse of 10 microseconds on its INIT pin. Then the sensor sends out an ultrasonic pulse and waits for the pulse to bounce off something and return an echo. The sensor then pulses its ECHO pin. The length of the pulse in microseconds is proportional to the distance of the object from the sensor. The code below reads a Devantech sensor on an Arduino or Wiring module.

Continue reading “Devantech SRF04 and 05 Ultrasonic Sensor”