Arduino Uno 9v batteries and sensors, an observation

By default the analog inputs use the 5v chip supply as its reference , so when running off a 9v battery it’s likely the reference voltage is falling below 5v and hence your analog reading rises .
The answer is

  1. A 9v battery is not good enough for the job.
  2. Use the internal voltage reference on the chip and a voltage divider on the input .
1 Like