Voltage monitoring on a 3.7v battery 18650 wrong voltage.

Hello I'm trying to read the voltage of a 18650 battery that is 3.7v on a analog pin 0. I'm using the normal example from the arduino ide.

void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
  // print out the value you read:
  Serial.println(voltage);
  
}

When i hooked the 3.7v battery up and ground sense i know the arduino can go up to 5v on the input pins i tried it intead of displaying 3.7v it shows 3.92v Not sure why the difference can someone please help me?

Lithium ion batteries go from 4.2V fully charged down to about 3.6V when nearly empty.

You know that that code will not work when the battery is used to power the Arduino, right? Because in that case, the voltage on the battery will be the same voltage as the power supply, which is what it's using as the analog reference, so it will always read 1023.

Hello thanks all for the reply i looked more into this problem and what i found for a fix is a voltage monitoring circuit of some kind i will need to look into it more. If anyone haves any idea please let me know. Thank you.

When i hooked the 3.7v battery up and ground sense i know the arduino can go up to 5v on the input pins i tried it intead of displaying 3.7v it shows 3.92v

How are you measuring the 3.7V cell voltage ?

Hi,
Ditto post #4, how do you know it is 3.7V, I very rarely find batteries that have terminal voltages at the case quoted voltage.
The terminal voltage depend on temperature, state of charge, load of the measuring circuit.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

Hello I'm not currently measuring the voltage with the arduino now the battery suppose to be 3.7v from the package but after charging i put on my meter and i get 3.9v from it.

Hi,
What voltage does the arduino read at the sametime as the DMM is reading the battery voltage?
Compare the two readings please.
Tom.... :slight_smile:

after charging i put on my meter and i get 3.9v from it

I would expect a fully charged 18650 to be around 4.2V

Multimeter said 3.67v and the arduino reads 3.96v

UKHeliBob you are right if full charge but i haven't had a change to fully charge this battery i just recently got it.

josephchrzempiec:
UKHeliBob you are right if full charge but i haven't had a change to fully charge this battery i just recently got it.

I was responding to you saying

after charging i put on my meter and i get 3.9v from it

Yes i have seen some people said 4.2v when fully charge you are right about that.

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks... Tom... :slight_smile: