Comments (6)
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.
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.
Also try connecting the QSTRT pin to GND.
from max1704x.
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.
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
from max1704x.
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)
- Question about power consumption HOT 5
- Clone max1743 address 0x76 wrong readings HOT 7
- Aliexpress 0x32 Clone Support HOT 16
- Use Wire1 HOT 1
- Stopping charge HOT 8
- Fuel Gauge at 0x32 HOT 1
- I'm having issues regarding showing the battery percentage. HOT 5
- Battery never shows more than 90% charge HOT 7
- ESP32 WEMOS LOLIN32 lite HOT 5
- Esp8266 Compilation Error HOT 1
- Why read sensor error,What do I do HOT 2
- Library should not initialize I2C subsystem itself HOT 2
- Add ESP32 support HOT 1
- Question. Is ok with max17040 or 17041? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from max1704x.