XIAO_BLE_Sense(mbed 2.7.2) battery charge and voltage monitor, analogRead(P0_31) does not work

Thanks for the information !
I see. You created a voltage divider and you read the value with the A0 pin.

image

I’m not planning to use the mbed OS, so I should be fine.
If I want to plug the battery through the pads and read the battery voltage from PIN_VBAT,
would that give me an accurate reading ?

From what I read in that post, I was under the impression there was an issue with inconsistent readings.

I there a difference with reading the battery voltage from VBAT and from P0.31?

I see there is a risk to burn out the P0.31 pin if the ADC function of Pin P0.14 is off (which is done with setting the Pin P0.14 high).

You cannot apply VBAT directly to any port of nRF52840. According to datasheet the absolute maximum input voltage is (VDD + 0.3V) or 3.6V. A charged battery can rise up to 4.2V and so you must always use a potential divider to step down the voltage.

You can also easily calculate the voltage at P0.31 to be around 3.6V when the battery reaches 4.2V and P0.14 is off. This is the risk mentioned by Seeed.

As long as you use correct ADC resolution and potential divider values, the voltage measurement will be fine.

1 Like

Thanks for the clarification !

So Still
Looking for an UPDATE from SEEED on this XIAO_BLE_SENSE Board file situ, 2.9.1 and reading the battery voltage along with IMU and BLE operation. concurrently :slight_smile:
NO tricks , No hacks, Patched or Not ? What’s the deal on this battery powered device?
TIA
GL :slight_smile:

Seeed nRF52 mbed-enabled Boards v2.9.2 was released on June 6.
Bugs related to LEDs and battery voltage reading were fixed.

nRF52_XIAO_mbed_VBAT_READ_TEST.zip (911 Bytes)

Hi there,
I see, but it broke the interrupts from IMU demo. works with 2.9.1 but not 2.9.2
?
I’ll retest and let you know.
TY
GL :slight_smile: PJ

Hi there,
Yes it’s confirmed that the Sleep does NOT work after updating to 2.9.2. the Battery does read and track well, the

notice the 0 in the lower left corner of display shows usb cable PLUGGED in charging "0"

Unplugged changes to “1” NOT charging…

which is great, but not helpful if the SLeep function that worked in all previous BSP’s
does NOT work anymore.
Try any of the TAP to wake demo’s on here.
the MCU won’t stay asleep until tap’d.
So for me BSP 2.9.2 is Broken

I combined the test and the Battery read . One should load with 2.9.1 BSP , Sleep works
(3button presses)
load BSP 2.9.2 battery read works , but 3 button presses (User Button) Xiao won’t stay sleeping. Until double tap “wakeUp”
sketch_sep5a_PARK_IMU_copy_Posted.zip (4.6 KB)
HTH
GL :slight_smile: PJ

PJ,
Confirmed that Sleep mode cannot be maintained; BSP 2.9.2 is not yet available.
It is difficult to properly communicate this problem to the Seeed developers.
I think the problem is that there is no menu to submit issus to “GitHub - Seeed-Studio/ArduinoCore-mbed”.

edit
I also tried with BSP2.9.1+patch, but it does not seem to be able to maintain Sleep mode.
Is there any difference in how to check?

  1. Click the button three times.
  2. “SLEEP!” is displayed.
  3. The display will disappear after about 5 seconds.
  4. LED flashes in the order of G->R->B
  5. Acceleration and voltage will start to be displayed.

msfujino,
Yes with BSP 2.9.1 , when 3 button presses , and sleep is displayed it will stay off(asleep) until double tap is performed. System will reset on wakeup, ie. startup sound test and LED test R,G,B… flash!
HTH
GL :slight_smile: PJ

yes a GitHub - menu would be good.

I also tried with BSP2.9.1+patch, but it does not seem to be able to maintain Sleep mode.
bsp291+patch.zip (1.6 MB)

edit
Sorry, I was checking with XIAO non Sense.
With BSP2.9.2, BSP2.9.1+patch, I confirmed that it cannot maintain sleep mode and wakes up after about 5 seconds.
BSP2.9.1(no patch) is good, but can’t read voltage.

//#define int2Pin PIN_LSM6DS3TR_C_INT1
#define int2Pin P0_11

It worked with BSP 2.9.2.

Hi there,
WOW , Indeed it does.
INT2_P.011
I’ll test some more, Awesome find my guy. :disguised_face:
GL :slight_smile: PJ :man_bowing: