Giter Site home page Giter Site logo

Inconsistent values about max1704x HOT 6 CLOSED

porrey avatar porrey commented on July 16, 2024
Inconsistent values

from max1704x.

Comments (6)

porrey avatar porrey commented on July 16, 2024

First things first, I noticed the example code display the voltage as V instead of mV. The output of FuelGauge.voltage() is in mV and not V (my mistake). In your example, the reading 4903.75 v is really 4.9 V.

I connected my Spark Fun fuel gauge to a Nano with a li-po battery measuring about 3.9 v. The fuel gauge out of the example is:

Version:       3
ADC:           3178
Voltage:       3972.50 mV
Percent:       72.41%
Is Sleeping:   No
Alert:         No
Threshold:     4
Compensation:  0x97

(I changed v to mV).

I connected the GND pin to GND on the Nano, the SDA pin to A4 and the SCL to A5. I left the Vcc, pin on the fuel gauge disconnected. With Vcc connected to the 5V pin on the nano I get the same result. Note that leaving Vcc disconnected allows the battery to drain.

I tested a handful of other batteries and all reported proper voltage and percentage correctly.

What version of the breakout board do you have? I ask because I was able to produce similar results using a (random) different address. I read that some boards use 0x32 (the library uses 0x36). See the discussion in this Forum.

I will be releasing an updated library that allows specifying the address. In the meantime you can try copying the library files into the folder where your INO file is and change the address in MAX1740X.H to 0x32.

from max1704x.

domix75 avatar domix75 commented on July 16, 2024

Thank you for your answer,
OK I understand for the mV/V
it seems mine is a genuine SparkFun, it's on a red board with their logo (kinda flame, in white) under the white text "Fuel Jauge", the connector is black.
besides I checked with a I2C scanner and it's on the 0x36

I'll do some more checkings tonight without the Vcc.
I just connect SDA, SCL and GND, directly on the corresponding pins, without any resistor

cheers

from max1704x.

porrey avatar porrey commented on July 16, 2024

Also try connecting the QSTRT pin to GND.

from max1704x.

domix75 avatar domix75 commented on July 16, 2024

I eventually had it work.

There are 2 issues but I'm not sure the hardware can do better, are measuring a jauge is quite hard...

  • one is the value of "percent" : the lipo is sold for 3.7 and the specif says that it's max is 4.2, then when I calculate the max value I should have according to the voltage and the percent I endup by 4.5/4.6
  • the other issue is that I was connecting the VCC. this was making the percent become totally inconsistent (like 3% instead of 87% and a few min later, showing the same voltage, it was 45...)

as for the QSTRT it does not change much the readings in my case

thanks again and have a great day
dom

from max1704x.

porrey avatar porrey commented on July 16, 2024

I'm glad you sorted it out. Here is some final information as I close the issue that may help others reading this exchange.

I checked a few other batteries that I had, particularly some "cheap" ones and found that they measure over 100%. The voltage on these was higher than expected. Most of the batteries I use I have obtained from Adafruit or SparkFun. These batteries seem to be the highest quality and work the best.

Here is a picture of my circuit if it helps at all. Note the reading from the output of the Fuel Gauge is is 3.76 V. I checked this with a Fluke 87 and it is spot on. The out put from the program is:

Device Reading:
Address:       0x36
Version:       3
ADC:           3010
Voltage:       3762.50 mV
Percent:       27.82%
Is Sleeping:   No
Alert:         Yes
Threshold:     32%
Compensation:  0x97

Circuit1

Circuit2

Circuit3

Circuit4

from max1704x.

domix75 avatar domix75 commented on July 16, 2024

Thanks

well maybe there is somth. I had missunderstood in the function of the battery. I see on yr example that the volatge is 3.76 and the percent is 27% so the relation betw voltage is more complicated that I had understood.
with the values I got on https://blog.ampow.com/lipo-voltage-chart/ my readings are actually consistent.

from max1704x.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.