I just got a new sensor (ultrasonic) which turns distance output as voltage, depending on how far the obstacle is. Output voltage gets to 0-10V, but since I
m using voltage divider 2 times, I get 0-5V. The problem is I cannot read analog voltage correctly, mismatch information with my multi-meter. I wonder if you have any idea what could be wrong. Im using arduino mega, on top of that is motor shield (for my project). Wtih dc/dc converter I get from 5V to 24V as input. My multimeter gets stable results as I move the obstacle, futher voltage gets bigger and the other way. If it gets out of range, or too close, it gets max output (5V). Arduino debbug output shows pretty much random numbers, not even close with what multimeter shows, stable data, depending on range.
What I tried to do is here: https://www.arduino.cc/en/Tutorial/ReadAnalogVoltage
Sensor: Sensor link