-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having issues regarding showing the battery percentage. #15
Comments
I added a standalone sketch called Debug to the examples folder. It will display the device register values as well as the calculated values. This may help debug your issue. Output from SparkFun fuel gauge:
Output from clone device (this device does not work):
|
Alright, so from what I am seeing in the Serial monitor is that I am not receiving SOC HIGH and LOW, as well as VCELL LOW BYTE.
|
If the voltage is correct, the battery is low and 0% makes sense. The voltage should be above 3.7v to operate effectively. At 100% it is usually at 4.2v or more. It is odd, however, that the VCELL LOW byte is 0. |
Here I am again, as of right now I got it 'working'. What issue seems to be occurring now is the follwing, I have a battery holder which can hold 2 batteries and it showcases a total of 5.12V (They have a max of 7.4V and they aren't fully charged. They have around 6V of power.) This isn't changing at all. I've implemented the adc and it's the same also, it remains at 4095. Nothing higher, nothing lower. What does change is the percentage, it's continuously rising and not stopping at 100%. However this is in my part of the code, when I am using your debugging code. It shows something completely different. ADDRESS...........: 0x36 (54) PERCENT...........: 0.00% I'm mainly using this code: LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup(){ lcd.begin(16, 2); lcd.clear(); void loop(){ float capaciteit = FuelGauge.percent(); Serial.print("Battery Percentage: "); Serial.print("Battery Voltage: "); delay(2000); lcd.setCursor(0,0); lcd.setCursor(0, 1); lcd.setCursor(10, 0); |
The MAX17043 can only read a voltage of a single cell up to approximately 4.7V. Using two batteries in parallel would not be supported either. Try issuing a reset() and then a quickstart() during initialization. See this example for more details: https://porrey.github.io/max1704x/examples/basic. |
So, for the last month I've been using this code and the module that someone suggested to and everything in your code works, except one thing that's quite crucial to my project. Which is showing the percentage of the battery through my LCD. I've made sure everything was connected properly and everything else worked properly which it does fortunately. I can show the voltage on the LCD but the percentage constantly stays at 0.00% which is rather strange to me.
![64151a68ee4de04e02e47f2667c2d9be](https://user-images.githubusercontent.com/84501093/155282497-342dd772-5a56-4e7a-ad93-392fe2471206.png)
You'll see that I have a voltage going through, but no percentage. I've tested the other properties in your code and they work properly.
I'm currently doing this through a Serial monitor on Arduino fyi
The text was updated successfully, but these errors were encountered: