• @Kartman, I assume your 12V battery has not long term issue w/ this constant drain of 2.44mA... when all things go to sleep, this may though be a significant drain when running on less power capacity than your setup.

    EDIT - 2.44 is 1 order off... see next two posts...

    A solution that does not constantly drain - only when capacity is measured - is with an additional optocoupler in the feed line of the voltage divider. Yes, the (infrared) switch driver LED consumes more than that... at least the double, but it is only for a very short period... The scale factor has then to be adjusted with the voltage drop of the coupler's switch transistor (which is also dependent on the the overall current flowing and the LED driving current. Some measurement with a multi-meter and different (strong enough*) voltage source can be used to figure out the 'curve'... and show if there is need for a non-linear scaling factor...

    Rough schematics:

    `
    VBat ------------------------+---------------­--+-------+----
                 .-----------.   |                 |       |
                 | 3..3.3V   |   |                 |       |
    3..3.3V -+---+ Voltage   +---'                 |       |
             |   | Regulator |                     |       |
             |   '-----+-----'                     |       |
    ESPRUINO |         |                           |       |
    iTracker |         |          Optocoupler      |       |
    .--------+---.     |          .-------------.  |       |
    |   Opto-    |     |          |             |  |       | +
    |   coupler- +--------[RES3]--+--.        .-+--'    _______
    |   driving  |     |          |  |        | |         ___
    |   pin      |     |          | _|_       / |       _______
    |            |     |          | \ / --> |/  |   Bat   ___
    |            |     |          |  V  --> |>  |       _______
    |            |     |          | -+-       \ |         ___
    |            |     |          |  |        | |       _______
    |            |     |       .--+--'        '-+--.      ___
    |            |     |       |  |             | .|.      | -
    |            |     |       |  '-------------' |R|      |
    |            |     |       |                  |E|      |
    |            |     |       |                  |S|      |
    |            |     |       |                  |1|      |
    |     Analog |     |       |                  '|'      |
    |     read   +---------------------------------+       |
    |     pin    |     |       |                  .|.      |
    |            |     |       |                  |R|      |
    |            |     |       |                  |E|      |
    '-----+------'     |       |                  |S|      |
          |            |       |                  |2|      |
          |            |       |                  '|'      |
          |            |       |                   |       |
    GND --+------------+-------+----------------­---+-------+----
    `
    
About

Avatar for allObjects @allObjects started