4 ms·
There are three big things to look out for on the software side. Are you using deep sleep? Are you putting your sensors into shutdown mode between measurements?
by GeorgeHahn 10y ago
There are three big things to look out for on the software side. Are you using deep sleep? Are you putting your sensors into shutdown mode between measurements? How long does it take to take a measurement, connect, and report?
On the hardware side, consider using a switching power supply. Many cheap/small ESP8266 breakouts use inefficient linear regulators. You may also consider adding a big capacitor across the battery +/- lines. This will help smooth out the large current pulses consumed by the device, which can be quite important as the battery voltage starts to drop.
The ESP8266 is pretty power hungry, but you should be able to get much more than two weeks on those batteries. Even in the worst case scenario, I'd expect about three months.
I'd be happy to take a look at your schematics and code. (email in profile)
- Isamu 10y agoRight, there is sleep and then there is deep sleep. AT+SLEEP has 2 modes, light sleep and modem sleep. AT+GSLP is deep sleep (low-power sleep.) Spec sheet says: " A minor adjustment has to be made before the module enter this deep sleep mode, i.e., connect XPD_DCDC with EXT_RSTB via 0 ohm resistor." If you have a scope, check the current draw when you sleep. Surprises can happen depending on the rest of your circuit.
- sprobertson 10y agoHere's the schematic: https://i.imgur.com/vZzGGZL.png https://i.imgur.com/vZzGGZL.png I have a ATTiny85 on a timer to do the actual readings from the DHT sensor, then turn on the CH_PD pin for the ESP8266, then send the reading over serial. The ESP then turns that into a POST request. (This design is partially because I could never get the ESP to read directly from the DHT.) Could that 3.3v regulator be a problem? Could CH_PD not actually be making it use less power? There are also a bunch of small capacitors to get things working more reliably, but I don't have a good understanding of which ones are useful or how much energy they eat.
- GeorgeHahn 10y agoHave you verified that CH_PD stays low when the ATTiny is asleep? I'd consider putting a 10k pulldown on the CH_PD line so it defaults into powerdown mode. Do you have a multimeter? Insert it between VCC and U1 and between VCC and US1 to verify your sleep currents [1]. The 3.3v regulator could certainly be improved. Once you've verified that your sleep currents are within the expected range (<1mA), consider swapping it for something more efficient. A board like [2] should work reasonably well if you set UVLO to the minimum value of 0.3V [3]. This should get you to a few months of battery life. A large capacitor (500+uF) on VBATT will stretch this a bit further. You want something with low ESR (the batteries should be around 400 milliOhms total; try to stay under 100 milliOhms). Anything here [4] would be pretty reasonable (supercaps are also a good option). If you want to go even further, switch to an ATtiny85V and run it directly from the batteries. (This will work with your ATTiny85 as well, but you'll drop below its operating voltage while there's still a fair bit of usable charge left in the batteries.) Instead of wiring to CH_PD, you can wire it to the enable pin on your regulator (unfortunately not exposed on [2]; it's pin 6 on the TPS61200). You'll need to level shift the ATTiny<->ESP8266+sensor signals. The advantage here is that the ATTiny power doesn't take an efficiency hit from a converter and the ESP8266 and sensors can be 100% powered down when not in use. This is what I'd do if creating this as an original design on a single board. [1]: https://openhomeautomation.net/esp8266-battery/ https://openhomeautomation.net/esp8266-battery/ [2]: https://www.sparkfun.com/products/10255 https://www.sparkfun.com/products/10255 [3]: https://www.circuitsathome.com/dc-dc/tps61200-board-modifications-part-1-changing-undervoltage-lockout/ https://www.circuitsathome.com/dc-dc/tps61200-board-modifica... [4]: http://www.mouser.com/Passive-Components/Capacitors/Aluminum-Electrolytic-Capacitors/_/N-75hqtZscv7?P=1z0z819Z1z0z7l5Z1z0z80l&Rl=75hqtZer3vZ1z0wkcyZ1yftwwfSGT75hqtZergjZ1yx4avtZ1yx4arcSGT75hqtZ173vdZ1ybcj9yZ1z0s5pqSGT&Ns=Pricing|0 http://www.mouser.com/Passive-Components/Capacitors/Aluminum...