XIAO BLE Sense battery level and charging status

I haven’t tried to access the LSM6DS3, but here’s the deal:

There are discrepancies between schematic and software that I haven’t figured out yet.

I’m leaving this project for the time being (got other fish to fry). Maybe, just maybe someone can get help from the folks at Seeed. Like, perhaps a real schematic and software examples that really work.

Here are some issues (Pardon my verbosity, but I just can’t seem to boil it down)

Issue 1:
The schematic shows pin 31 (P0.31) as the input to the ADC to read battery voltage through its voltage divider. We have all discovered that this does not work.

On the other hand, as I discovered, the arduino_pins.h header in the variants directory for this board defined PIN_VBAT to be 32.

That’s P1.0, but the schematic labels P1.0 as P1.00_PDM_CLK. I haven’t tried any PDM functions.

Bottom line: P1.0 works to read the ADC

Score so far: Software wins. (At least as far as reading the Battery Voltage.)

Issue 2:
Everyone on this thread, (including me) has used pin 14 (P0.14) as the active-low signal to ground one end of the voltage divider so that the battery voltage is scaled properly. This is shown on the schematic as P0_14_READ_BAT (with a bar over the ‘READ_BAT’ to indicate active-low).

However, in the arduino_pins.h, there is the following:

#define PIN_LSM6DS3TR_C_POWER (14u)

The Seeed_Arduino_LSM6DS3 library that you are apparently using causes PIN_LSM6DS3TR_C_POWER to go high once (during the begin() method) to access the LSM6DS3. I don’t know if that is the actual connection. In this case, the schematic shows the power pins and Chip Select pin for the LSM6DS3 are connected to a signal named 6D_PWR, which goes to P1.08 on the CPU, which is numerically pin 40.

Bottom line: If you can get the LSM6DS3 to work by making pin 14 High and you can read the battery by making pin 14 go low, then you have to set pin 14 high (every time) after reading the battery before accessing the LSM6D3. This might pinpoint the problem, but doesn’t sound practical in an application.

The problem is, of course, those connections are hidden below the shield, and I’m not going to pry things apart to see what really goes where, and I don’t have time for more software exploration.

Sorry, but I’m done for now—maybe done with Seeed forever. Got other (non-Seeed) things to do that actually pay the bills.

Regards,

Dave

6 Likes