When detecting low battery voltage using LPCOMP and ADC, the detection voltage changes (occurs approximately 5%)

HI

We are mass producing products using nRF52832.

However, during production, a PCB was found to not detect low battery voltage for about 5%, so we are inquiring about it during review.

1-1) The circuit configuration is as follows.

1-2) SW configuration is as follows.

- Basic LPCOMP settings -> LPCOMP event occurs -> Switch to ADC to read battery voltage -> When below the reference voltage, LED display

- LPCOMP

static void lpcomp_event_handler(nrf_lpcomp_event_t event)
{
    uint8_t bsp = 0;
    if (event == NRF_LPCOMP_EVENT_DOWN)
    {
       
        //voltage_falls_detected++;
        //voltage_falls_total++;
        
        if( getlpcomp_chceck() == 0 )
        {
           bsp =  getBsp_led_indication_stage(); 
           if( ( bsp == BSP_INDICATE_IDLE ) || ( bsp == BSP_INDICATE_CONNECTED_OFF ) || ( bsp == BSP_INDICATE_USER_STATE_OFF ) )
           {
                bsp_indication_set( BSP_INDICATE_USER_STATE_BAT_ON );


           }
        }
    }
}


static void lpcomp_init(void)
{
    uint32_t                err_code;

    nrf_drv_lpcomp_config_t config = NRF_DRV_LPCOMP_DEFAULT_CONFIG;
    config.input = NRF_LPCOMP_INPUT_2;
    // initialize LPCOMP driver, from this point LPCOMP will be active and provided
    // event handler will be executed when defined action is detected
    err_code = nrf_drv_lpcomp_init(&config, lpcomp_event_handler);
    APP_ERROR_CHECK(err_code);
    nrf_drv_lpcomp_enable();
}

- ADC

         nrf_drv_lpcomp_disable();
         temp_bat = getBatVoltage();
         nrf_drv_lpcomp_enable();



int32_t getBatVoltage( void )
{
    uint8_t i;
    int32_t temp_adc = 0;

    for( i = 0; i < BAT_VOLTAGE_CNT; i++ )
    {
       temp_adc += BatVoltage();
    }

    temp_adc /= ( BAT_VOLTAGE_CNT  );
    gBatVoltage = (int32_t)( ( (float)temp_adc / 0.166666667L * 0.6L / 1024L ) * 1000 );



    return gBatVoltage;
}

2-1) Review Symptoms

- LPCOMP: When it is lower than the reference voltage, check that it wakes up normally

- ADC: After LPCOMP wakes up, if the ADC is read and it is lower than the reference voltage, the LED should turn on, but the LED remains OFF

-> The strange thing is that after lowering the voltage below the low battery voltage and checking the wake-up by LPCOMP,

If the low voltage LED does not turn on by ADC, and the voltage is slightly increased by 0.1V, the low voltage is detected by ADC.

Parents Reply Children
  • HI

    The circuit is simple, as shown below.

    From a 4.5V battery, we use an LDO to supply 3.3V to the LED and the nRF52832.

    - LDO 3.3V

    - Battery voltage divider resistor

       Battery voltage (up to 4.5V)

    - nRF52832 input

    - LED is implemented in matrix mode with LDO 3.3V voltage

  • I looked up the LED and Vf is not 2.0 volts but much higher, around 3 volts depending on the LED selection code. Coupled with the voltage drop across the driver this makes my explanation probably correct, there is insufficient voltage at VDD 3 volts to turn on the LED until the voltage is raised by 0.1 volts. Verify this by putting a red LED with lower Vf  in parallel with the white LED and see if the red LED lights up

  • Thank you for your reply.

    The LED model name is incorrectly written in the circuit diagram.

    The LED actually used is the product in the specifications below.

    mm.digikey.com/.../B1931UY--20D000114U1930.pdf

    Previously, Vf was referred to as 2V, which is the intermediate value below.

    1) Assuming Vf maximum voltage of 2.4V

    2) Battery voltage is detected as low voltage at 3.3V

    3) When detected, LED supply voltage is 3.3V

    4) Considering Vf of PNP TR of 0.3V, actual LED is 3.0V

    https://www.keccorp.com/jp/product/product_view.asp?idx=1143

    => In conclusion, it shouldn't be a problem because the input voltage of 3.0V is greater than the maximum Vf of 2.4V, right?

  • The comparator trips and starts the voltage measurement when below 2.06 volts measured at R1&R2 at which point Vbatt must be below 3V (2M/1M voltage divider). Vbatt below 3V means the LDO drops out of regulation and the available voltage to the LED is well below 3-0.27-0.3 ie well below 2.7V and also the transistor input voltage is now also lower. I think the 5% is simply worst-case net voltages for some devices and precise behaviour of the LDO when out of regulation is not predictable.

    Recommend increase LPCOMP ref to 2.44V or higher; discharging the battery to below 3V is most probably not good for the battery in any case.

Related