grounding a resistor divider circuit through the pin for extreme power savings

Hi there, I have a potentially dumb or creative question that i cant seem to get a good answer on.

I am running a device that is going to be conscious of uA level power consumption. It will be in deep sleep for most of its operating life.
I want to make a low accuracy battery monitoring circuit using a resistor divider network.
I see other designs using multiple transistors to enable and disable this simple circuit. the board is only 14x14mm so i dont have space for much of anything.

I had the idea of grounding the resistor circuit through a pin on the nrf52840 set as a low output. and then when i want to disable the network for no power draw i will set the sink and ADC pins to high impedance and then deep sleep the processor.

I don't see this being done anywhere which makes me nervous.

I would be careful to make the ADC high impedance first and then the sink pin to avoid exposing the ADC pin to the battery voltage and then when i wake up the processor i would make the sink pin low output and the ADC an input.  

My understanding is that the pins will be left floating and disconnected in this high impedance state, I have seen people suggest that voltage in to a pin before vdd is connected can backfeed and cause issues with power on, then during the case of populating the raw pcb, and providing power, my question would become, " for an unprogrammed stock NRF52840, what state are the pins defaulting to?" 

Other context. I am using a QKAA BGA, the VDDH and VDD is configured to external supply. a potential scenario is the battery is charging at 4.2v, processor is off,  vddh is connnected to 4.2v, nothing on vdd. since it may not be configured yet or disabled in sleep.  now i have 4.2v through a resistor into a high impedance ADC and nothing on vdd.  Is this an issue?

  • Nothing you can do will "disconnect" any SADC or port io pin and any voltage on the pin will phantom power the internal nRF52 VDD via the schottky protection diode connected to the pin if the external voltage is above that VDD+300mV. This is an approximation of the internal circuitry of the SAADC; D1 and D2 are connected to the pin regardless of whether the pin is SAADC input, port output, port input or port "disconnected":

    //         |                |    VDD                                         VDD                    |
    //         |                |   --#--                                       --#--                   |
    //         |                | D1__|__                    Auto-adjust:         |   160k              |
    //         |                |    / \                     Bias inputs at VDD/2 +-| Bias Hi/Lo/Both   |
    //         |                |   /-+-\                     VDD1_2                |<-                 |
    //         |                |     |   PIN_VOLTAGE_1                           +-|                   |
    //         |          P0.28 |     |   AIN4          |----'T'-Mux-P---|        |            P SAADC  |
    //         #--------#-------O-----#------#-------#--+ +----#-------+ +--#-----#------#------#-->    |
    //         |        |       |     |      |       |  | |    |       | |  |     |      |      |       |
    //         |        |       | D2__|__  -----     |  ----   +-|    ----- |     +-|   +++     |       |
    //         |        |       |    / \   -----     |   |       |<--+  |   |       |<- | |   -----     |
    //  Rref  +++ 100nF |       |   /-+-\    | 3pF   |   |     +-|   |  |   |     +-|   | |   -----     |
    //  2k0   | |     -----     |     |      |       |   +---- |--------#   |     |     +++     | 2.5pF |
    //  1%    | |     -----     |   =====  =====     |         |     |  |   |     |      |1M0   |       |
    // (0.1%) +++       |       |    ===    ===      |       =====   |  |   |   =====  =====  =====     |
    //         |        |       |     =      =       |        ===    |  |   |    ===    ===    ===      |
    //         |        |       |                    |         =    Select  |     =      =      =       |
    //         |        |       |                    |                      |                           |
    //         |        |       |                    |                      |                           |
    //         |        |       |                    |  |----'T'-Mux-N---|  |                           |
    //         |        |       |                    +--+ +----#-------+ +----+                         |
    

    As ketiljo suggests, 2 high value resistors and a capacitor is the minimum board area solution; however, a flying capacitor is a better solution with almost zero power drain but that takes a little more space.

    maximum-possible-saadc-differential-voltage Add a 2nd capacitor C to the SAADC input, such that Vbatt becomes Vbatt/2 when measured

Related