Chat freely about anything...

User avatar
By stavbodik
#53331 I need help please with knowing if my calculations for batteries life time are OK and help with improving it .

So my project based on ESP8266 module , TC1262 LDO , US 100 Ultrasonic Sensor .

The main activity of the device is to wake up each x minutes take sensor record, transmit go sleep while in night hours the device should sleep .

data :

Batteries supply : 14Ah / 4.5V

Power Consumptions (voltage and current draw ) :
ESP 3.3V / Transmit 0.075A / DeepSleep 0.000000035A
Sensor 3.3V / 0.002A
LDO 4.5V / 0.00007A

Time :
ESP Sending UDP (wake+connect+send+sleep ) = 0.3 S
ESP Deep Sleep : 2M
ESP work 12 Hours in day , sleep 12 Hours at night
Sensor work 24 Hours
Ldo work 24 Hours


Calculations :

ESP:
Total seconds in day is : 86400
Esp total wake time in day: (60/2) * 12 * 0.3 = 108 Seconds
Esp total sleep time in day: 86400-108 = 86292 Seconds
Duty Cycle = 108/86400 = 0.00125
AVG current draw esp : (0.00125 * 0.075 ) + (1-0.00125 )*0.000000035 = 9.3785^-5
Total hours : (14*4.5)/(3.3*9.3785^-5) = 203560.4627H = 23 Years

Sensor :
(14*4.5)/(3.3*0.002) = 9545H = 1.089 Years

LDO :
14/0.00007 = 22 Years

Questions :

1. Is it possible for batteries to hold so much time (23 years ) what have i missed and how to include it in
calculations ?

2. As you can see the life time of the sensor due to fact he works 24/7 is very low compared to the esp
My idea is to use maybe some external timer+supply + relay or transistor to turn on and off all the system
each x time will this work ?
Another thing i thought is maybe i can power on the sensor only when the esp
wakes ups using relay or transistor. please advice in this issue ?


Thanks you very much for support and help !
User avatar
By schufti
#53341 Hi,
you can try to power your us-sensor via gpio, @2mA that shouldn't be a problem unless it won't work with somewhat less than 3.3V. Don't use gpio0 or gpio2 as these need to be "high" at startup (so contrary to what you need). This should minimize the deepsleep current draw to below 50µA.

The 0.3s for wakeup, connect, measure and transmit from deep-sleep look very unrealistic to me, I experience sth about 3-4s.

Not to forget self discharge of the battery, depending on type this is not to be neglected.
User avatar
By stavbodik
#53359
schufti wrote:Hi,
you can try to power your us-sensor via gpio, @2mA that shouldn't be a problem unless it won't work with somewhat less than 3.3V. Don't use gpio0 or gpio2 as these need to be "high" at startup (so contrary to what you need). This should minimize the deepsleep current draw to below 50µA.

The 0.3s for wakeup, connect, measure and transmit from deep-sleep look very unrealistic to me, I experience sth about 3-4s.

Not to forget self discharge of the battery, depending on type this is not to be neglected.


Hi when ur using static connections eg :

Code: Select allWiFi.config(ip_esp, ip_gateway, ip_subnet, ip_dns1, ip_dns2); WiFi.begin(ssid, password);


It takes "zero" time to find and connect to the WiFi + sending UDP is no need 3 hand shake as in TCP this is how this done so fast , try it .

Thanks for the advice , already trying it.

Any way please help waiting for more answers .
Last edited by stavbodik on Sat Aug 20, 2016 9:07 am, edited 3 times in total.
User avatar
By schufti
#53364 this is exactly what I'm doing
Code: Select all  WiFi.mode(WIFI_STA);
  WiFi.config(ip, gw, nm, gw, gw);
  WiFi.persistent(false);
  WiFi.begin(ssid, password);
but still it takes about 2-4s for reconnect to WPA2 secured AP after even 30s deep-sleep.
I remember some post here on the board that measured 200ms for startup only (until in "setup")
after deep-sleep there is no "key" known to the esp, so it has to go through authentication ...