Giter Site home page Giter Site logo

Aliexpress 0x32 Clone Support about max1704x HOT 16 CLOSED

porrey avatar porrey commented on July 16, 2024
Aliexpress 0x32 Clone Support

from max1704x.

Comments (16)

porrey avatar porrey commented on July 16, 2024

I am willing to make and changes necessary and provide support for clones. Do you have any idea what is needed? I need to try to purchase at least one clone to experiment with.

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

Currently, all i got is how to read it... i don't understand the readings yet, they do work in the sense that the readings go down as the battery is used. Just not sure how to get them right.

The original chip has a measuring range upto 5v, but this seems to top out at 4.2v. Because a fully charged and measured at 4.2v cell gives you the output of 4.9v. So maybe the 10bit readout is just scaled for the max of 4.2v.

Percentages go up to around 200% at fully charged. So there is some logic behind this, just need to figure it out.

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

I hooked up to my bench power supply. It tops out at 4.3v like I though. 4.364v according to my multimeter, at this point the chip reads 5115mv... and if you go over that, it loops back to 5mv. So the 12bit readout is scaled to 0 - 4.3v. Instead of the 0-5v.

It seems to have 10mv steps, so not sure if its 12bit.

At 4.25v it reads 200%. And at 2.75v its at 0%. These are both multimeter readings.

Highest percentage reading is 217.42%.

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

I just divided the percentage by 2 (or is this too simplistic, does it put the 50% value at a wrong point?.. also, 2.7v as 0% is kinda low.. ), and i think that fixes that.. then the 12bit voltage readout needs to be just correctly scaled. And that should fix that.

At what voltage does the authentic chip say 0%?

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

Adjusted the increments to 1.065 in the MAX17043.h. Now the voltage readings are perfectly accurate. Percentage with divider of 2.

image

image

image

Put to sleep works, wake up works. Reset works. Clear alert works. Setting threshold works.
Alert percentage should be also adjusted to show correctly. There is also a pin for the alert? I have not tested that.

12bit ADC value maxes at (accurate voltage reading):

image

So everything expect the alert works now perfectly. 4% alert percentage was triggered at 2% with the divider of 2. And 10% alert was triggered at 5%. So of course the alert needed a divider of 2 also to show correct values on the output print.

So the alert threshold values that are given to the chip need to be multiplied by 2, and outputs divided by 2.

So i can set the threshold between 2-16%. Probably reading the bits somehow wrong.. thats something i'm not good at. It probably needs double the bits! More bits.

So i think this is everything, and its now working 100%.

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

image

Well, if this is what the original outputs.. then the percentages are still way off. As this one is at around 57% if the divider of 2 is used at 3.6v.

from max1704x.

porrey avatar porrey commented on July 16, 2024

Can you try changing the compensation value to see how or if it affects the readings?

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

Can you try changing the compensation value to see how or if it affects the readings?

By the compensation value, you mean the 0x97? Ill try fiddling with it. Have no idea what to change it into.

from max1704x.

porrey avatar porrey commented on July 16, 2024

I have a clone on order and will start to test with it as soon as I get it.

from max1704x.

porrey avatar porrey commented on July 16, 2024

I received my clone and did some testing side by side with a SparkFun chip. The readings below are from the same battery.

SparkFun Chip:

Device Reading:
Address:       0x36
Version:       3
ADC:           3230
Voltage:       4037.50 mV
Percent:       80.59%
Is Sleeping:   No
Alert:         No
Threshold:     4%
Compensation:  0x97

Clone:

Device Reading:
Address:       0x32
Version:       3
ADC:           3772
Voltage:       4715.00 mV
Percent:       166.95%
Is Sleeping:   No
Alert:         Yes
Threshold:     4%
Compensation:  0x97

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

Did you change the voltage increment for this? If you change that, you will get accurate voltage readings. But i have not figured how to get the percentages to make sense.

I contacted the factory through alibaba, and got some files. But havent had time to check them properly.

from max1704x.

porrey avatar porrey commented on July 16, 2024

In the above example, the increments can be changed to something like 1.07 to match but the reading wasn't consistent. There is also the issue that it always returns 0 unless quick start is used just prior to the VCELL reading. Lastly, even if the VCELL reading is compensated, the percentage is way off and there is no way to adjust this. The internal formula is not linear so it wold require knowing how the percentage is calculated to somehow applying a "smart" adjustment. All of this seems more work than needed to get these chips working.

If you can share the files/information you received I can spend some time looking into it.

from max1704x.

cranefist avatar cranefist commented on July 16, 2024

Yes, you always have to do the quick start before the reading. And the correct adjustment was 1.06, and that makes sense considering how it tops at 4.3v instead of 5v having 12bit range.

The percentage was the actual issue, as that does not make sense. I dont think the readings are in any way "smart", i think there is just a curve. But on these fake chips, the percentage seems linear.

If you connect the authentic chip to a lab supply, and just adjust the voltage from 4.3v to around 3v.. i think you will see how the percentage is calculated and that it probably just has a precalculated curve.

Here is the file : https://aleksikoski.com/temp/MAX17043.zip

from max1704x.

github0013 avatar github0013 commented on July 16, 2024

Just FYI, but I bought this one (I believe it's a copy of Sparkfun's?), and the address was 0x36.
I used your library (porrey/max1704x), and it worked just fine without modifying the code.

from max1704x.

porrey avatar porrey commented on July 16, 2024

Just FYI, but I bought this one (I believe it's a copy of Sparkfun's?), and the address was 0x36.
I used your library (porrey/max1704x), and it worked just fine without modifying the code.

This one appears to have a genuine Maxim Integrated chip instead of a clone. The price is good too.

from max1704x.

porrey avatar porrey commented on July 16, 2024

Clones of the MAX1704X chip appear to not work accurately. I have found no way to adjust this library to work with them. If anyone stumbles across a way, I will be more than happy to update the library as log as it does not affect the genuine chips. For no I am closing this issue as there are no apparent issues with the current library.

from max1704x.

Related Issues (16)

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.