Using AA Batteries to power D1 Mini WEMOS Board

I've built an outdoor temperature sensor device using a D1 Mini WEMOS Board, a DHT22 Temp Sensor, and a battery holder with three Alkaline AA batteries. Everything works fine and I have the D1 Mini take a temp measurement and sent the value to my Hubitat Hub via an http POST call. Then, it goes to deep sleep for 15 mins and starts the cycle again.

I connected the battery pack to the +5V and GND pins on the D1 Mini, where the built-in voltage regulator steps the voltage down to 3.3V for the board. A fresh set of 3 AA batteries start at 4.7V, and once they get down to about 3V the D1 Mini stops working. So, I'm trying to squeeze out as much battery life as possible from these Alkaline batteries.

I thought of two possible enhancements:

  1. Add a 5V boost converter which will boost the battery voltage from 0.9-5V to 5V. I'm hoping I can pull more voltage out of the batteries and extend their life.

  2. Add a 3V boost converter to boost the battery voltage of two AA batteries from 0.8-3.3V to 3.3V and connect the battery pack to the +3.3V and GND pins.

Is either option viable, or is one better than the other? Will this help me extend the battery life of the AAs and run the D1 Mini Board longer, or will these boost converters end up using more voltage and defeat the purpose of this effort?

I've never used boost converters so I don't know what their current draw is while the D1 Mini is in deep sleep mode. Any comments and/or suggestions are appreciated.

Thanks.

No, because you lose a significant amount of battery power due to the converter inefficiency. Batteries are the way to go if you can.

their current draw is while the D1 Mini is in deep sleep mode.

Look up the quiescent current of the converter, and add that to current draw of the rest of the circuit, in sleep mode.

If you buy the converter from a reputable manufacturer like Pololu, the quiescent current is stated.

look for Li-Ion batteries. Perhaps a 18650. The 18650 partially charged is approx 3.7 volts. The ESP8266EX can run up to 3.6 volts, however I am sure you can go to 3.7 with no negative effects. Especially at a limited temperature range.

Thanks for the feedback. So, I should forget about the boost converters and focus on a better battery solution to get longer battery time?

I'd be careful with a lipo and maybe even use a buck converter with one. A fully charged lipo would very likely damage something that wants a max of 3.6v, and partially charging to just the right voltage would be annoying.

Have you measured the sleep current of the entire circuit, including what the sensor is drawing? If you're sleeping well in excess of 95% of the time, the most important determinant of battery life is the sleep current. My understanding is that the ESP8266 does not sleep very deeply. But you should measure the current and report back.

The problem with a switching regulator like a boost converter is that while it is more efficient than linear under significant load, it may well be less efficient under light load, such as sleep current. So using a buck or boost converter might end up being counterproductive.

Do you know what regulator is used on your D1 Mini, or what markings it has?

1 Like

You forgot to tell us a very important fact there!

Of course, any battery powered device will eventually run down and stop functioning. Of course, you would like this to take as long as possible. But how long are your batteries lasting? Is that actually a reasonable time for them to last? Are they lasting 12 hours or 12 weeks? How long would you reasonably want/expect them to last?

I have made quite a few sensors using wemos D1 mini. At the start, I used 10440 (=AAA size), 3.7V li-ion batteries. These lasted around 3 weeks between recharges. They have a capacity around 320~350mAh when new. After a few years I became annoyed at how often I was having to recharge them. Over time and recharge cycles, the capacity of these batteries dropped somewhat and had to be recharged more often than every 3 weeks. So earlier this year I replaced the 10440 size li-ion batteries with 1,800mAh Li-po batteries. I can't tell you how long these will last between recharges because they have been running for 10 weeks now and are still going strong. My estimate was 12 weeks but I suspect they will do better.



Question: is it the D1 mini that stops working or is it the dht22 that stops working and causes the wemos to get stuck when it tries to read the sensor? I suspect it may be the dht22. I use SHT21 sensors and the circuit keeps running down to ~2.8V.

Your AA alkaline batteries should have a capacity of around 2,500mAh, so should be lasting at least 12 weeks I would estimate.

Your statement here made me curious. I am using a boost converter to power my Wemos D1 project from an 18650 battery and when I measured the current drawn by the boost itself, the amp-meter showed 0mA. to be honest, I used the milli-amp setting on the multimeter but it didn't cross my mind to try the micro-amp :frowning:
The boost I am using is this one: https://www.aliexpress.com/item/4001054709058.html (someone measured the current draw in the comments and it says 100uA, which is very reasonable).
So, why do you say that boost/buck converters are not efficient under light load? Consumptions like 100uA aren't reasonable?
Anyway, depending on the project, the circuit itself will have a current draw which will likely be higher than that. In my case, the PCB itself draws 0.6mA, Wemos 0.2mA in deep-slee and I also have a DS1307 that draws 0.1mA in sleep. This means 0.9mA in deep-seep which is more than enough for the circuit to be alive for 4.5 months with a single 18650 rated at 3400mAh.
You can easily see that the biggest consumer is the circuit itself. I can try replacing some resistors with a higher ones for a lower consumption but I still need my circuit to be functional.

It depends. For circuits like this that spend almost all their time in deep sleep, the quiescent current of the regulator can be more important than its efficiency when the sensor is awake.

For comparison with your buck converter, an mcp1700 regulator has a quiescent current of only ~2uA.

A wemos D1 mini in deep sleep consumes around 150~200uA. Much of this is the usb-serial chip, I suspect. The esp8266 itself uses only a few tens of uA in deep sleep. If your buck converter adds another 100uA to that, it's going to have a significant effect on battery life.

On my (genuine) wemos D1 minis, the regulator is RT9013. The data sheet says the quiescent current is 25~50uA.

@PaulRB : you're right. It all depends on the project, I guess. On my case, I need peaks of about 1.5-1.8A (since I am using a servo when in duty), so this is why I chose that boost.
But, on small projects, involving small sensors, the current can be much lower.
Now, regarding your example with the MCP1700, I guess that in this case the wemos will be powered on the 3.3V pin, in order to avoid using the internal regulator (ME6211) which itself draws 60uA. But, this will complicate the circuit, if there are consumers that need 5V (so an additional 5V LDO will be needed).

With my current setup the 3 AA Alkaline batteries will last about 6 weeks. I'd like them to last 4-6 months. My sketch takes a new temp reading every 15 mins and then puts the D1 Mini into deep sleep, so I could take a reading every 30 mins to reduce on-time power consumption.

My sketch will send an http POST command to my Hubitat Hub to store the most current temp reading, and I can see the date and time of the last message. So I believe the D1 Mini is dead when it stops sending the http POST commands to my WiFi router. So, it might be that the voltage becomes too low for the WiFi on the D1 Mini board to turn on.

I'd like to avoid using LiPo batteries and stick with the Alkalines because they are cheap and disposable. I just got a new multimeter in the mail yesterday, so I'm planning to take some current measurements with my D1 Mini in full-on mode, deep sleep, etc. I'll report back when I get those values.

Thanks for the comments and suggestions. I'm definitely learning a lot about working with microcontrollers!

robert_c, what I'm saying is that the big problem with linear regulators is that the voltage drop across them times the current is lost as heat, but a buck converter avoids most of that loss through the switching process. But at very low currents, the linear losses become very small as long as the regulator itself isn't consuming much current. But the buck converter still has to oscillate and do its magic even at very low currents, so their quiescent current is typically greater than an LDO's. So if a project is going to be spending most of its time sleeping, at very low current, you shouldn't assume that using a buck converter will improve battery life versus an LDO. Of course if you're boosting, you have to use a switching converter.

One thing about your DS1307. The datasheet says it runs on the coin cell at 500nA. I think you will find that it will run for years that way. So consider powering the RTC module's Vcc pin from a GPIO port, so you can turn it on only when you need to communicate with it, and let it keep time on the coin cell at all other times. That would save you about 99uA in sleep current.

1 Like

I'm new to using a multimeter, so this is what I did:

  1. Connected the leads on my multimeter to the "COM" and "A/mA" ports. Broke the battery circuit and connected one multimeter lead on the + terminal of the battery pack and the other multimeter lead to the 5V pin on the D1 Mini port.

  2. Switched on my multimeter to the "A/mA" setting.

  3. Ran a sketch on the D1 Mini that powers it up with the WiFi turned on and temp sensor active, used a delay(10000) call to pause the sketch while I took current readings, then issued an ESP.deepSleep(0,WAKE_RF_DISABLED) call to put the D1 Mini into deep sleep mode.

  4. Took a current reading while in deep sleep mode.

My results are as follows:

72 mA - Full power on with WiFi activated
2.9 mA - Deep sleep mode

Without the delay() calls for debugging and current measurements, the sketch runs for about 4 seconds total before it goes into deep sleep mode.

I'm guessing 2.9 mA is the best I can do after looking at some similar testing posted online.

May sound too crude but have you considered 3 "D" cells?

Interesting thoughts. Thanks for the suggestion. For my current project, it is too late, since the PCB is already done and my components are already running on that PCB. But I'll keep this in mind for my future projects designed to run on batteries.

2.9mA is a lot for a WemosD1 in deep-sleep mode. Wemos, itself, should consume around 0.15-0.2mA in deep-sleep. Can you post your electronic circuit here? Probably that you have some consumers (in general, resistors) on the circuit that are drawing that current. Or, just to make sure that your Wemos board is good, you can measure the current on the Wemos outside any other connected electronics.

1 Like

What I am telling you is that my D1 minis run down to around 2.8V, some even a little lower, so what could be happening in your case is that maybe the wemos wakes up 15 mins after the last recorded reading, tries to read the dht, but there is not enough voltage for the dht to respond, so the code hangs and does not send another reading. It's not an easy thing to prove, you would need to change your code to include a timeout if the dht does not respond, and record a temperature of -999 or something.

In my mind that's a reason to avoid using alkaline batteries.

4 months should be possible from what I have learned. 6 months... maybe...

By all means try that, it won't double battery life but it will help a lot. The power used in deep sleep is more than a third of the total:

15 mins at 0.2mA = 0.05mAh
4 secs at 80mA = 0.09mAh

Yes, that's very similar to what I have measured.

Way higher than what I have measured. My D1 minis consume 150~200uA in deep sleep. This is why your battery life is so short.

Have you tried measuring the current drawn by the dht22 when the wemos is in deep sleep?

Ok, I've reconsidered using the D1 Mini for this project and instead I'm going to try an ESP-01 microcontroller. I've hooked up the circuit and checked the current and here are my results:

70 mA - ESP-01 full on with WiFi activated
24 uA - Deep Sleep mode

The 24 micro amps for deep sleep seems much more promising. I'm actually using an ESP-01S which does not have red LED that is lit when the board is powered up. I'm going to give this a try and see how long two AA batteries will last.

Thanks again for all the feedback and comments.