Posts

Showing posts from October, 2018

Current draw of a D1 Mini in deep sleep

To measure the deep sleep current draw of the D1 Mini, I hooked up 4 NiMH AA batteries in series (~5.2V) to its 5V and GND pins. The sketch uploaded to the D1 Mini was a nominal: void setup() { ESP.deepSleep(60)*60*1000000UL, WAKE_RF_DEFAULT); } void loop() { } The current draw was a pretty steady 0.8mA, or 800uA. That's a obviously a far cry from the sub-100uA reportedly achievable with the barebones ESP-01 due to all the extra components on the D1 Mini. Reported deep sleep current draw for the D1 Mini is all over the place, from 0.21mA (5V) , to 0.3mA (3.3V) , to 6mA (USB) ! Notes: 1. Connecting a 18650 battery (~4V) to the 5V pin did not work. In theory, the MC6211 LDO used by the D1 Mini means anything higher than 3.56V should work . But when connected, the onboard LED started to flash in a slow but erratic fashion, I suspect it is randomly resetting (because each time the D1 Mini powers up, the onboard LED flashes briefly). 2. Connecting a 18650 battery to

Coulomb, mA and mAh

I am sure I will forget all this later, so... A Coulomb (C) is defined as 1A * 1sec. This implies 1A = 1C/sec. In the previous example , we have a 4V/2600mAh battery driving a 1K resistor. Through the LTC4150, we are measuring consumption of 0.614439C in 150.8s,     Load = 0.614439C / 150.8s = 0.004075C/s = 4.075mA     Therefore battery should last 2600mAh/4.075mA = 638 hours What if you have varying loads? eg.     (1) Load = 0.614439C for 180s = 0.00341C/s = 3.41mA for 3 mins     (2) Load = 0.614439C for 60s = 0.01024C/s = 10.24mA for 1 min     (Repeat) Then the average load is:     Average load = 2 * 0.614439C for 240s = 0.00512C/s = 5.12mA     Therefore battery should last 2600mAh / 5.12mA = 507.8 hours

Measuring current draw with LTC4150 + ESP-12E

Image
My LTC4150 Coulomb counter has finally arrived! For testing, I hooked up the unit to the spare ESP-12E I have lying around: All the jumpers on the LTC4150 are soldered (SJ1 = interrupt-driven counting; SJ2, SJ3 = 3.3V circuit). The code for driving the Coulomb counter is as follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 #include <Time.h> #include <TimeLib.h> const int BATTERY_CAPS = 2300 ; const byte INT_PIN = D1; const float INT_TO_COULUMB = 0.614439 ; bool trigger = false , init_done = false ; unsigned long total_time = 0 , total_interrupts = 0 ; volatile unsigned long num_interrupts = 0 ; volatile unsigned long time1 = 0 , time2 = 0 ; void debug ( const char * format, ...) { char buf[ 256 ]; va_list ap; va_start(ap, format); vsnprintf(buf, sizeof (buf), form