Deep sleep ESP

Edit: This design has issues. Do not built it until some things are corrected.

I am playing a bit with a deep sleep, battery powered ESP8266 (based on the Wemos D1 Mini, because I don’t want to deal with USB-to-Serial, mainly). After some tests, I get about 180µA in deep sleep with a HT7333, which is totally fine for me. I plan to run this on a 18650, which gives my about a year life.

Attached is a 5x5cm² board which integrates (all under the Wemos D1 Mini) the circuit for the LDO plus

  1. a TC4056A LiPo charging board
  2. a header to send a reset pulse for waking up the ESP when shorted - I am going to use this with a reed switch
  3. a capacitor as a 1bit storage (for simple state storage in combination with the switch in 2.)
  4. a high resistance voltage divider for reading the battery voltage
  5. prototyping holes around to fill up the 5x5cm²

I would be happy for improvements and suggestions before I send this to manufacturing. Especially, I haven’t tested the reset pulse yet, but since this is the way Arduino Uno & Co.work, it should be ok.

EDIT: Old versions of project deleted here and in the following. Refer to later postings for KiCAD project.

libraries.zip (14.2 KB)

Im using different ESP8266 boards (a node mcu and some witty clone), so the pinouts may vary a bit. With that in mind;

  1. The ADC has a range of 0-1v, your potential divider into the ADC is only halving the input range. Might be worth switching to a 5:1 (eg 820k/180k).
  2. I presume your GPIO16 is mapped to D0? (for the automatic reset)
  3. 18650's have a high rate of self discharge, you can forget a year, it'll be more like months.
  4. the HT7333 seems to be limited to 250mA. The specs for the ESP call for a lot more (Im using 500mA via a buck/boost converter), and its common to see AMS1117 being used (although I think you could find better)

Maybe you have those covered some other way? :)

scrumfled: 1. The ADC has a range of 0-1v, your potential divider into the ADC is only halving the input range. Might be worth switching to a 5:1 (eg 820k/180k).

The Wemos D1 Mini also has a voltage divider to map the 1V to 3.3V (or 3.0V?, doesn't matter in my case). Combined, it should be ok.

  1. I presume your GPIO16 is mapped to D0? (for the automatic reset)

Yep.

  1. 18650's have a high rate of self discharge, you can forget a year, it'll be more like months.

Are you sure sure about that? I don't see why that should be true for a form factor in general. I also do not have any of those problems with my flashlights. Anyway, the design could also be used with any other LiPo.

  1. the HT7333 seems to be limited to 250mA. The specs for the ESP call for a lot more (Im using 500mA via a buck/boost converter), and its common to see AMS1117 being used (although I think you could find better)

According to the official numbers, it should be fine: http://bbs.espressif.com/viewtopic.php?t=133 This is also in agreement with my tests. Perhaps there are some very short spikes. I think I'll risk that for the very low dropout and quiescent current of the HT7333. The AMS1117, on the other hand, seems to be a terrible choice, because the 1V dropout would put the final voltage far below of what the the ESP needs for most of the battery lifetime.

Maybe you have those covered some other way? :)

I think I have those covered :)

I did forget the header for the battery, and Bat- doesn't seem to be directly connected to OUT-, so I fixed that. If anybody is interested in the new version, tell me and I'll upload the KiCAD project again.

Sounds good, its like every implementation of the ESP's is different :) I must admit I prefer using a TPS63030, for step up/down, that way I can plug in conventional batteries too.

Even if you're comfortable with your PSU rating, it might be worth designing in a couple of solder pads/holes to let you retrofit a big FO capacitor, in case there turns out to be an issue. It'd give you a get out of jail card should things not go to plan.... (and of course Im not going back and re-reading where i read the 500mA)

As for the 18650's..... I've got about 20 of the things I use for bike lights. They vary in quality a lot...

Ps. would be interested to see your final boards

I'll let you know about the 18650 performance :) This is going to be a door switch, so I will read values at least twice a day. I alos like the TI buck/boost thingies, but I have neither equipment nor skill for the package. Buying a module would more than double the price of the whole board. Since this board is designed for a the LiPo charger module (including protection), I don't think it is worth making it more general.

Regarding the cap: That will not fit into my 3-layer sandwich of circuitry, LiPo charger and D1 mini, so it would go on the perfboard area anyway. If I need it, I can place it there.

Attached is the recent version (including Gerber).

ElCaron: Especially, I haven't tested the reset pulse yet, but since this is the way Arduino Uno & Co.work, it should be ok.

I dont know how much its costing you to have boards made, but does it not make sense to first test on a breadboard what you are hoping will work, to make sure it will ?

It costs me about 15 bucks, but no, of course not. I will conduct some tests today before I send it off to manufacturing. I made a prototype before I designed the board, but wired the cap to give a high instead of a low pulse. So I decided to design a board first of how it should look, get feedback here and in the meantime test if it really works.

Here is another nice project that basically uses the same technique. Note that R6 is built into the Wemos in my case, as R9 in the schematic. The project also adds protection such that the ESP does not reset when not sleeping, but as far as I can see in a way that prevents wakeup via timer (since GPIO16 cannot be connected to RST anymore, it has to be pulled low during wake). I guess it would also work by using another pull-up high pin like GPIO0 or 2, which are then set to output low in the setup, but I don't think this is too important for me. I am a little surprised about R6. Shouldn't that be between RST and the collector of Q2?

Well, figured “Why not” and added the transistor. It is easy to bridge and could come in handy for other stuff. Not that my pullup (R6 in the link) is placed on the reset pin site of the NPN. I think that is more right, though … anyone?

Your comments made me go back and check why I’d chosen the buck/boost…

Assuming its a single 18650 you’re using for power, the nominal voltage is 3v7 and your reg will need about 1v of overhead to deliver its 3v3 output, meaning you’d need 4.3v.

Having said that, I’ve read quite a few people commenting that they’ve run their projects directly off the 18650… although i wonder if thats just a question of time until you kill the ESP.

If you decided to go 2x18650, you’ll find theres a chunk of cost in battery holders & batteries, which will offset any saving you made by not using a buck/boost circuit (maybe different in your country, here they’re expensive)…oh and your linear reg is then wasting most of the power as heat (very inefficient).

scrumfled: Assuming its a single 18650 you're using for power, the nominal voltage is 3v7 and your reg will need about 1v of overhead to deliver its 3v3 output, meaning you'd need 4.3v.

Nope :) The HT7333 has a dropout voltage of 90mV, and the ESP is specified down to 3.0V. So a brownout will not happen until the cell is at 3.09V, which is only when the cell is empty anyway.

Having said that, I've read quite a few people commenting that they've run their projects directly off the 18650.... although i wonder if thats just a question of time until you kill the ESP.

Yeah, that is waaaayyy out of spec, especially since I integrated the loading curcuit which will keep the circuit at 4.2V for the loading time (continued by the full cell, for some time).

If you decided to go 2x18650, you'll find theres a chunk of cost in battery holders & batteries, which will offset any saving you made by not using a buck/boost circuit (maybe different in your country, here they're expensive)......oh and your linear reg is then wasting most of the power as heat (very inefficient).

That is why I am going neither for 2x18650 nor for anything like the 1117 :)

ElCaron:
The HT7333 has a dropout voltage of 90mV, and the ESP is specified down to 3.0V.

it does?.. … it does, wow! Glad I engaged in this conversation, I’ll be adding that to my parts list :slight_smile:

Also notice the 4µA quiescent current. BTW, might the 10mA of your 1117 be somehow related to your “self-discharge” issue? :slight_smile:
There is a pretty recent thread in General Electronics that mentions a few LDOs with similar specs. If you don’t find it in the forum, try googling my nick with HT7333, I suggested it there.

Also, I replaced the trace from GPIO16 to RST with a resistor. This allows flashing the module regardless of the state of GPIO16.

I did some tests on a breadboard, and it works when I replace the 100nF cap with 10µF. This is also updated in the new project attached here.

Seems I am approaching the point for sending this off to Elecrow. :slight_smile:

EDIT: Made a new revision with cleaned up schematic and better use of pins (freed SPI, saved one pull-up by connecting an already pulled-up pin)

DeepSleepESP.zip (55.3 KB)

Nope, self discharge is inherent to the battery. Try it yourself, charge on up then leave it on the shelf for a month.

The ones I have here in the drawer seem quite fine, and it has been several month since I recharged them.

Anyway. Attached is a hopefully last version. I saved another pin by using D0 as both sensing pin and wakeup pin. The wakeup from the timer still works well when send over the cap.

If nobody finds any more problems or improvements, I’ll send this off for manufacturing tomorrow morning.
Oh, also extended to 5x10cm, since it is juzst 3$ more for 10 pieces. Just extended the perfboard.

DeepSleepESP.zip (89.9 KB)

scrumfled: Nope, self discharge is inherent to the battery. Try it yourself, charge on up then leave it on the shelf for a month.

Did that immediately after your post. Yesterday, charger stopped after charging 22mAh, less than 1% . Can totally live with that. It was a protected cell, BTW.