Ultrasonic Rangefinder (SRF05) Expected Results?

I have the SRF05 right next to me , running the code I posted here, and it works fine..

The example with the distances you gave, means that the SRF05 doesn't actually work.

Now, I can only assume three obvious things:

  1. The SRF05 is damaged
  2. Your cables and your connections are bad
  3. Software problem

Solutions I may think of, providing the SRF05 is not damaged:

  1. Check your cables; also check the connections again.Use only one Mode ( either SRF04 Compatibility or SFR05) and make sure you have all connected properly

Can you tell us what mode you use and the pin connections of your SRF05 and Arduino?

  1. I don't think you have a software problem, but to elliminate that possibilty, you can try all this on a Windows running computer.

teoxan