user33314: 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.


user28569: 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).

33314: <p>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 <code>voltage=readVoltage(a,'pin')</code>. I'm very new to this, so any help would be appreciated.</p>

<p><a href="https://i.stack.imgur.com/Tfhms.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tfhms.jpg" alt="thats my circuit"></a></p>
 28569: <p>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).</p>
