Using the Wemos D1 mini + WS2812B RGB shield + Battery shield and a 750 mAh single cell LiPo from my Walkera Dragonfly V120D02S , I wondered how long it’ll last to run. It’s not super-low power (use Bluetooth for that, not Wifi), but anything from 1h to 24h was possible according to my estimates and absolute power rating limits. So it’s time to measure!
- Lua program runs listening on a TCP socket. Nothing else runs actively.
- When a command comes in via the TCP socket, analyze the command and execute it. Estimated run time: less than 10ms.
- To confirm all keeps on working, I changed the LED color about 4 times per hour.
- The LED was set to run at 20% R, G and B (brightness 55 out of 256).
- The set of battery shield, D1 mini and LED shield and the battery had no other connections to the outside world.
- Run time: 14h (750mAh LiPo from fully charged via battery shield, to 3.45V)
- Average power draw for the LiPo: 700mAh/14h=50mA (assuming 700mAh used)
- Assuming 90% efficiency of the DC-DC circuit (see TP5410 datasheet), that’s about 30mA@5V coming out of the battery shield (it only feeds +5V)
- Average power consumption by LED: 55/256*3*20mA=13mA@5V (plus whatever the LED controller chip uses)
- Leaving 17mA for the D1 mini. The LDO RT9013 drops that to 3.3V (still 17mA)
- No sleep mode was used here since the device is listening to a TCP port.
The efficiencly is obviously improvable (going from >3.3V to 5V and then to 3.3V again for the ESP8266).
Side note: Charging is taking about 1h until the call has 4.195V. Very nice. I’ll see what the cell voltage is when the TP5410 shuts down. According to the data sheet, it’s likely 2.7V (undervoltage protection).
Update a day later:
With the WS2812 LED being on with low intensity, here the result:
- Run time: 20h
- Voltage of LiPo: 2.7V at the end
- The TP5410 of the battery shield turned off 5V, but the 5V rail still had voltage to make the red and green LEDs of the WS2812 glow (blue turned off)
- The ESP8266 was still rsponsive via WiFi. Its blue WiFi LED got significantly fainter compared to before when the LiPo was full.
- Using the same assumptions as above:
- 21mA@5V out of the TP5410
- LED board: <1mA @ 5V, for the LEDs
- About 20mA for the D1 mini module
This is consistent with the first measurement and good enough for me. For a day of being online, you need 1Ah single cell LiPo for the CPU/battery module.
This list shows 15mA for Modem Sleep State and 50mA and more for active WiFi connections. The conclusion would be that NodeMCU uses Modem Sleep when listening to incoming TCP packets.