LC709203F - OSError

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
_JonT_
 
Posts: 10
Joined: Thu Jan 05, 2023 3:30 pm

LC709203F - OSError

Post by _JonT_ »

I am using an LC709203F battery gauge with a BQ27074 charger and a pico w. The application requires long-term availability and is meant to be running for days. However, after a few hours the Micropython application quits with an OSError 5. I have tracked this down to the LC709203F. If I disconnect the battery and reconnect it, all is well again. Looking at various forum posts, the issue seems to be that the LC709203F is putting itself to sleep and causing an I2C error to occur when it is accessed. The access function that I have written does actually wake the LC709203F up, but this does not seem to be addressing the issue. While I have seen lots of chatter about this issue, I haven't found anyone who has found a solution. Does anyone have any experience of this using Micropython?

User avatar
bidrohini
 
Posts: 202
Joined: Thu Oct 20, 2022 10:03 am

Re: LC709203F - OSError

Post by bidrohini »

Which library did you use?
This one? https://github.com/chris-reichl/MicroPython_LC709203F

User avatar
_JonT_
 
Posts: 10
Joined: Thu Jan 05, 2023 3:30 pm

Re: LC709203F - OSError

Post by _JonT_ »

Yes.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: LC709203F - OSError

Post by adafruit_support_mike »

What sampling interval are you using?

User avatar
_JonT_
 
Posts: 10
Joined: Thu Jan 05, 2023 3:30 pm

Re: LC709203F - OSError

Post by _JonT_ »

adafruit_support_mike wrote: Thu Jan 26, 2023 11:07 pm What sampling interval are you using?
In the test rig I was using I was sampling every 20 seconds.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: LC709203F - OSError

Post by adafruit_support_mike »

That would do it.. the auto-sleep time is 1s to 1.5s.

The wakeup time is 400us, or about 40 pulses of the I2C clock. Try doing a dummy read to wake the chip up, then wait 1ms, and take a real reading.

User avatar
_JonT_
 
Posts: 10
Joined: Thu Jan 05, 2023 3:30 pm

Re: LC709203F - OSError

Post by _JonT_ »

Thanks. I will have a try and report back. Did I miss that in the data sheet somewhere?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: LC709203F - OSError

Post by adafruit_support_mike »

It's in Table 5 on page 6, toward the bottom of the table:

https://cdn-learn.adafruit.com/assets/a ... 1599248750

It's easy to miss that kind of thing until the becomes specifically relevant.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”