My analogRead value is greater than 4095, why? [SOLVED]

I am using an ultrasonic which is supposed to range to Vcc when 5 meters away.
What is strange is that even at 2 meters I am getting about 11000 from analogRead(A3);
It is on pin A3 and power is supplied by 3v3*.
I’ve even gotten a reading as high as 32011. It’s like there is a multiplier in there somewhere but I am taking the raw reading and printing it to serial.

Any thoughts?

Hi @ruben

I think you are going to have show us some code. How is the variable that takes the analogRead() value declared? It should be an int or int32_t. How are you doing the print? With Serial.print or sprintf or some other way?

Another good thing to check is to hook a voltmeter up to the pin and measure the voltage as a double check.


Thank you. I figured it out after backtracking. It looks like it had something to do with my wiring but that was compounded by my using serial.print with 6 dig digits. Shouldn’t have done that. I put it back to default and looks good.