Hi, I have a puzzle with the well known HC-SR04 ultrasonic sensor:
it works well with Arduino Duemilanove and measures distances up to ~10 ft but the same program and same sensor transferred to the other board, namely, RBBB with Atmega328 chip http://shop.moderndevice.com/products/rbbb-kit provide reliable measurements only up to 2ft distance. All the distances larger than 2ft are returned as 2ft.
I don't have a scope at the moment to check the signals so I'm trying to nail the problem down using common logic and common sense. I would have suspected the power source if pure Vcc was used in the HC-SR04 comparator and if the Vcc on the second board was smaller compared to the "reference" one but it's not the case.
If pulseIn returns this number of microseconds then it's either the hardware of the Arduino board that reacts to the false signal from the sensor or from somewhere else or the sensor itself that produces this signal based on what it thinks. Both scenarios do not look real to me since I can't figure out what causes the difference but it's what I observe. Replacing the sensor doesn't change anything, either: it works with one board and it doesn't work at distances larger than 2ft with another one.
What else it can be? Thanks for the ideas.