I'm trying to read the battery voltage using Arduino, using a 9V battery. I keep getting the same voltage (4.99). I connected my Arduino to Matlab so I'm only using the command voltage=readVoltage(a,'pin')
. I'm very new to this, so any help would be appreciated.
1 Answer
Analog inputs on the arduino will measure 5v maximum. If you want to mesure higher voltage you will have to use a voltage divisor circuit (resistors).
-
1Also your analog input might now be dead from providing almost twice the voltage it's designed for.– MajenkoMay 2, 2017 at 9:42
-
-
Thank you all, somehow I didnt damage the analog input, thank God. But i tried with resistors (10k) and its still measuring the same voltage... May 2, 2017 at 17:20
-
And if you measure with a multi-meter the voltage at the Arduino input ? May 2, 2017 at 17:21
-
1@SoundoussSassi could you show/describe how you have connected the resistors (just to make sure it is a proper voltage divider)? I also wonder if it is necessary to select a proper reference (there should be an internal and external reference possible).– GhanimaMay 2, 2017 at 18:53