• @Espruino_user_dk, if the values for Z1 and Z2 cannot made that high that for practical reasons the drain can be ignored, a dynamic measurement could help if the circuitry for that does drain less ant to the point of where the drain can be ignored... What about an 'overkill' with the theoretical circuitry below?

    The basic idea is to charge a very low leakage capacitor and then measure it's discharge (or charge behavior).

    With fast D1 and D2 and R3..R6 properly sized, the B2 and C0 processor pins are safe (on power on and beyond). With both pins open, (mainly) R4 and R5 will charge C1 to the point where Vb - Vt = VBatt. Now only the 'leakage of' C1 and T1 keep draining. (If no reasonable sizing for R1..R5 can be found to avoid T12 from switching on during C1 charging process, adding a D in between R3 and Vt point of C1 has to be added.)

    For measuring, Pin B2 is switched to on - B2.set() - which switches T1 on. T1 on pulls Vb to ground and pushes Vt to negative (-VBatt). R3, R5, and R6 (via D2 up to a certain point) will pull Vt up to about what R3 and R5 voltage divider on B2(High) defines, say (theoretical) Vm. In other words, C1 is discharged and re-charge in reverse polarity.

    The times for Vt to reach GND and then a particular percentage of (theoretical max) Vm correlate to VBatt (after being pushed to negative by pulling down Vb) correlate with VBatt. It would be quite interesting to see on an a scope what Vb, Vt, Vm, and Pin B2 do...

    Behavior of Vb and Vt (and Vm) after measuring should not pose any problems (C0 would go on open input and after that B2. Latter switches T1 off. Since Vb is negative vs Vb, C1 is discharged and then re-charged with re-reverse polarity... - worst case - Batt empty and low impedance (low inner R), another D between GND and Vt point of C is needed, but would have also have an effect on measurement).

    As said, this is all theoretical... and I have not much clue how to size the Rs and C, and figuring out the formula to map time to voltage is a totally different ball game. So I'm interested in anything that can say at first sight: It cannot work. ;-)


    1 Attachment

    • measureSolarBatVoltage.png
About

Avatar for allObjects @allObjects started