Esp8266 on 4 AA batteries. Needing a low battery level notificaiton

Title describes it all. If anyone can help me achieve this, it would be appreciated. Thank you.

I’d recommend ESP8266’s VCC sensor: https://esphome.io/components/sensor/adc.html?highlight=adc#esp8266-measuring-vcc.

You can also add some filters or template sensors on top of it to convert voltage to percentage (battery voltage drops as it drains its capacity).

Sorry for the newbie question but I recently started with this, connecting a wemos d1 mini to my electricity meter… which has no electricity to tap from (not allowed). For the first days I have a long elec cable for the usb-plug but this is not sustainable.
My question: how long would a such a board run on 4 AA batteries? Is there even an answer possible as it may very well depend on what you ask from the board?

@lukasz-tuz
what if i am using nickel batteries (rechargeable) that don’t diminish voltage? They push the same voltage until they die.

@vingerha

I have 2 sensors on the esp8266. Temp/Hum with a DHT11 and a photoresistor for light. I set it to report back every second and lasted 1.5 days. I was just testing it for a formula. Now if i set it to report back every 300 seconds (5 min) the batteries should last over a year. Just my thinking.

That is a nice outlook indeed, I too will have to look how often I get the feed from the electricity meter. Details seem nice but in many cases one does not do a thing with it. I use the ‘current’ figures to find out which appliances use most but in the end…I will still use them when I need them, regardless of the cost :slight_smile:

You should not expect such a long time on batteries. The consumption of the ESP8266 is pretty high and I expect the reading of the sensors was the minor part of your energy consumption.

What kind of meter do you have? A lot of the smart meters deliver 5V through the P1 port, I’m using that to power the esp.

It is a french Linky, I measured 4.7V AC and I believe this is too weak and also to need DC

Ok, I don’t have any knowledge about the French situation.

well…if it were DC then I would try … now I need a converter too which will probably provide even less than 4.7 in the end.

You could also look into esp826 boards with build in 18650 cell holders.
Those should last longer than AA cells.
e.g.

The A0 Pin ist available, which should allow you to guess the battery state.
Furthermore you could simply swapp the 1860 cell or attach a powerbank for recharging.
Just as an idea.

The text speaks of 17 hrs of battery time…not a lot too.

  1. You can also add 18650 cells with more capacity (3600mA + 20% Runtime = 20,4h)
  2. You could also add a second Cell in paralell (Doubles the runtime → 40,8h)
  3. You could also not let the esp run 24h/day and send the esp to deepsleep → e.g. wake it up every 5min (Runtime 12 times a hour for 10sek = 2min runtime each hour should increase the runtime by 30times or more)

As another ides: Just use a big powerbank directly. The only disadvantage is that you may not be able to monitor the powerbank within HA.

Yep… thanks for the options but for me (not the op) this would not work as the interest is to get usage data regularly, now it is per 30s which is too frequent but 5 mins would be the minimum. I just ordered a zigbee dev.board with Ali which should consume less…qed :slight_smile:

what if i am using nickel batteries (rechargeable) that don’t diminish voltage? They push the same voltage until they die.

@rehrnsberger Haven’t used them myself, but quick internet search show that NiMH (assuming these are the ones you’re using?) have a distinct discharge profile; see NiMH C/10 discharge

how long would a such a board run on 4 AA batteries? Is there even an answer possible as it may very well depend on what you ask from the board?

@vingerha yeah, it depends on what you do with the board. I have a ESP8266-based outside temperature/humidity/pressure sensor, and it lasts ~3 weeks on a single Li-Pol 1950 mAh cell. Sensor is configured for 20 minute deep sleep and 60 seconds run duration, with 10s sampling period for BME280 sensor. WiFi is also configured to power save mode.

If it’s outside and running on an 18650 why not stick a solar panel on it and it’ll run all year if it can see the sun.

Tried that, but made a mistake of attaching the solar panel directly to the input of charger. Within a few months it completely drained capacity of the cell, to the point where it could no longer be charged, even via USB.

I use these battery holders. They cut off the power when drops below 2.7V. Replaced the D1 mini with an ESP12F and replaced the polycrystalline solar with monocrystalline. Put it out in the dead of winter and Voltage went up and up 98% charged. Use voltage divider across battery to ADC pin to tell me the Voltage for reassurance.

1 Like

Huh, never occurred to me to rework those holders, and I have bunch of them lying around. Thanks, going to have to try that :smiley: