Simple battery charging and battery measurement guide

Hi there

I’m still confused about the “perfect” way to charge a battery and measure its current state of charge (voltage level) with the XIAO.
I have it somehow working, but don’t know if it’s correct. The battery seems to be charging super slow (even a small 50mAh which should be charged in 1 hour even if I messed up the charging power in my code).

So, would anyone be so kind to post 2 code examples?

  1. how to charge with 50/100mA (including correct port etc.)
  2. how to measure and print the current voltage

Thanks! :slight_smile:
Raphi

I think this will be helpful.

POST_nRF52_XIAO_VBAT_READ_TEST.zip (918 Bytes)

1 Like

Hi there, & Don’t hold your breath! :nauseated_face:
RANT=ON…

Only works with non embed AFAIK, Unless you spin around, jump up. and wave a chicken over the Xiao with BSP 2.9.2 and change the varriant’s or pins ? or something SEEED has failed :dizzy_face:to address it fully. However strong Attempts have been made which you are aware of, in about 4-5 threads on here with the heavy lifting being done by users.
VERY UNFORTUNATE; None of the smart Engineers :disguised_face: :nerd_face: :cowboy_hat_face:at seeed could fix it and provide a simple demo, and YES reading the battery’s condition for a wearable or rechargeable device is PARAMOUNT but not to Seeed Studio.
Doing a search yields over 50 threads and battery issues since 2022… :poop:

None of the competitors like Adafruit, DFrobot or Micro-chip, even STM’s BlueNRG offerings with similar small footprints Have this issue ONLY SEEED’s XIAO does.
(like those it should be the same across revisions)
RANT-OFF

HTH
GL :slight_smile: PJ

How it should look from a BLE perspective. REALLY

https://docs.particle.io/assets/images/ble-powersource.mp4
GL :slight_smile: PJ

I stopped following “mbed” because of the high sleep current. I rewrote all my projects “non emed”.

edit
After seeing this thread, I checked the version of mbed BSP for the first time in a while and it was 2.9.2. And the bug seems to be fixed.
XIAO_BLE_Sense(mbed 2.7.2) battery charge and voltage monitor, analogRead(P0_31) does not work - #65 by msfujino