Wire.Begin() changes analogRead Values (arduino uno)

I'm reading an analog value from a voltage sensor. It works as expected when logging the output to the serial monitor. Then I attach a LCD display to display the voltage. It uses Wire.Begin() after that call my analogRead value changes. 12,5 volts to 14,4 volts.

Anybody know why this is happening?

olven:
I'm reading an analog value from a voltage sensor. It works as expected when logging the output to the serial monitor. Then I attach a LCD display to display the voltage. It uses Wire.Begin() after that call my analogRead value changes. 12,5 volts to 14,4 volts.

Anybody know why this is happening?

The Wire library uses Analog pins A4, A5. So you cannot use these pins for Analog input while using I2C communications.

I would be helpful if you would include a copy of your sketch, and a description of the circuit.

Just saying 'I'm read an analog value from a voltage sensor', is not very helpful. And it would be nice to know which Arduino you are using? Is it a Due using 3.3v or a Uno running on 5v, have you directly connect 12.5 volts to an Analog input pin(critically bad idea) or are you using a SPI A/D converter?

Chuck.


Check out my Kickstarter Project Memory Panes an expansion RAM Shield for Mega2560's. It adds 1MB of RAM for those projects where 8KB is not enough.

An analog pin is a voltage sensor, I think you mean a resistor divider?

What resistor values if so?