Vmeter only reads upto 3v and then the ADC value loops
-
The ADC value at 0v volts is approx 65,536 and then decreases to 0 as the voltage is increased until approx 3v, and then will reset again to 65,536 then decrease again to 0 for 3-6V. So I can only measure over the 3v range.
Trying to change the gain has no affect.
I am using a raspberrypi.
ie
i2cget -y 1 0x49 0x00 w -
@erkel
This sounds like a poor solder joint at the internal voltage divider (the 11k and 680k resistors). -
@holofloh
I have three of them and they are all the same. -
@erkel
Here is the E2prom dataroot@raspberrypi:/projects/battery_blancer/battery_balancer# ./c6
Address 0x00 - 0x0f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x10 - 0x1f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x20 - 0x2f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x30 - 0x3f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x40 - 0x4f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x50 - 0x5f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x60 - 0x6f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x70 - 0x7f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x80 - 0x8f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0x90 - 0x9f: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0xa0 - 0xaf: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0xb0 - 0xbf: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0xc0 - 0xcf: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0xd0 - 0xdf: ff ff ff ff ff ff ff ff 01 1d d9 1d d8 00 00 00
Address 0xe0 - 0xef: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Address 0xf0 - 0xff: 04 13 e6 13 e2 00 00 00 ff ff ff ff ff ff ff ffOr is the calibration data wrong and that is why the reading it simply rolling over every 3 volts.
The voltage divider seems ok.
I get ~0.4v at the mid point between the resistors with a 24V supply. -
@erkel Well, seeing as how you are not connecting it to a M5Stack product, but a RPi, what library (driver) are you using?
Also: What language are you programming it in? -
Not using any drivers / library abstraction.
Just reading the registers over the I2C bus.Have tried both Python, C and simply i2cget -y 1 0x49 0x00 w on the command line etc.
Just one layer above bit banging sort of thing.Does the E2PROM calibration data look correct?
-
@erkel
It is working now.
Just a noob issue.
It was the endianesse of the values. it gives the output as expected when converted to little endian, rather naturally reading the value.,
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login