Thingy53: Battery Monitoring & Qwiic i2c usage example

Hi Nordic support team,I'm developing a custom application on the Thingy53 and have encountered challenges implementing two key features that aren't covered in the standard examples:1. Battery Monitoring (NPM1100)

  • Attempted ADC configuration for battery voltage reading
  • ADC read operations consistently fail with error code -22 (EINVAL)
  • Tried implementing battery percentage calculation and charge status detection
  • Need guidance on proper devicetree configuration for the NPM1100 fuel gauge IC
  • Attempted various ADC channel configurations and voltage divider setups

2. Qwiic/Stemma QT I2C Integration (DRV2605L)

  • Attempted I2C configuration using multiple instances (i2c0, i2c1, i2c2)
  • Tried various pin combinations for the Qwiic connector
  • Implemented full DRV2605L driver with Zephyr's built-in support
  • I2C scanning consistently returns "I/O error (EIO)" for address 0x5A

What I've Tried:

  • Device tree overlays with different I2C instances and pin configurations
  • Added pull-up resistors (bias-pull-up) and GPIO power management
  • Verified I2C driver initialization and device tree parsing
  • Tested with both I2C_BITRATE_STANDARD and I2C_BITRATE_FAST
  • ADC configuration attempts with different channel mappings and voltage references

Current Configuration:

&i2c0 {
    compatible = "nordic,nrf-twim";
    status = "okay";
    clock-frequency = <I2C_BITRATE_STANDARD>;
    pinctrl-0 = <&i2c0_default>;
    pinctrl-1 = <&i2c0_sleep>;
    pinctrl-names = "default", "sleep";
    
    drv2605l: drv2605l@5a {
        compatible = "ti,drv2605";
        reg = <0x5a>;
        actuator-mode = "LRA";
    };
};

&pinctrl {
    i2c0_default: i2c0_default {
        group1 {
            psels = <NRF_PSEL(TWIM_SDA, 0, 5)>,
                    <NRF_PSEL(TWIM_SCL, 0, 4)>;
            bias-pull-up;
        };
    };
};
Questions:
  1. Are there additional GPIO configurations or power regulators needed for the Qwiic connector?
  1. What's the correct I2C instance and pin mapping for the Thingy53's Qwiic port?
  1. Can you provide basic devicetree examples for both NPM1100 battery monitoring and Qwiic I2C setup with some basic battery reading and i2c scanning code?
  1. What causes ADC read failures with error code -22 (EINVAL) on the Thingy53?
I'd appreciate any guidance before investing in hardware debugging tools. The application builds successfully, but both ADC and I2C communication fail at runtime.Thank you for your help!
  • Hello,

    Sorry for the late reply.

    For battery measurements, please refer to the sample:

    NCS\zephyr\samples\boards\nordic\battery

    As this does battery monitoring. 

    This sample was originally written for Thingy:52, but perhaps you are able to re-use some of it. If not, it is also worth looking into the NCS\nrf\applications\matter_weather_station, which is written for the Thingy:53, and you can look at it's src\battery.h/cpp. This is written in C++, but it is almost standard c-code.

    Regarding the I2C, What does the application you are currently testing look like? Is it possible to upload it here?

    • I2C scanning consistently returns "I/O error (EIO)" for address 0x5A

    Are these pins connected to anything? And what API exactly is it that returns this value?

    Best regards,

    Edvin

Related