So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By sjap84
#78086
btidey wrote:I would put a multimeter (current mode) in the Vdd feed to the circuit to help diagnose the issue.

With mag switch closed (reset low) the current should be lowish but it maybe the internal pull up on the reset line is a low value. Typically this would be about 10K which would amount to 300uA current in addition to the standby current of the ESP8266. Although high for a battery application 300uA should still last 6000 hours with that battery pack

With it open the current should go up to about 80mA for a few seconds until deep sleep kicks in and it drops back down to the same sort of quiescent current as with switch closed. If that doesn't happen then there is some flaw in the program logic preventing the deep sleep kicking in. It sounds like that might be happening in your case.

To avoid the higher quiescent current caused by the reset pull up. I use the CH_PD as the trigger input for the switch. This behaves similarly to the RST but you can put your own high value pull up on that. For example, I leave the RST alone, put a 1M pull up from CH_PD to Vdd and connect the switch to that. Quiescent current is then around 10uA.

Rudy's logic to force hold the CH_PD via another GPIO (via a medium value resistor) is what I do as well using a ESP-12F on my security sensors. Otherwise a short 'open' may not give enough time to report. After reporting the event the code releases the hold GPIO and goes into deep sleep waiting for the next event.

Ok thanks I will try that.
If it is possible do you have some info about your sensors with the esp12?
This could be a good back-up option :D
Thanks in advance
User avatar
By btidey
#78093 This is circuit I use for my sensors.

Module is actually an ESP-12F

Normally reed switch is closed and CH_PD held low so module is off with very low currrent consumption.

When reed switch opens module starts up and as first activity sets GPIO to output high. This keeps CH_PD up even if reed switch closes. 10K resistor is there to allow this.

After reporting (to security panel and phone notification) the code sets GPIO13 to input (hi-Z) and goes into deep sleep even if reed is still open.

I use a small 500maH LIPO to allow recharging. It is important to use an LDO low quiescent current regulator.

Battery, module and reed switch are built into a small enclosure which is stuck directly in position. This allows very short wiring from reed switch into module which is important with a high resistance pull up for CH_PD. One could lower the 1M to say 220K without compromising standby current too much.
You do not have the required permissions to view the files attached to this post.
User avatar
By btidey
#78095 I agree plain modules like the ESP-12F are best for reducing quiescent current to the minimum.

Choice of regulation is a bit more complicated. Most of my mains powered projects either use 3.3V supplies or a buck converter where higher voltages need to be converted. This is for reasons of efficiency and lower power dissipation. However, for battery operated deep sleep equipment where the source is a LIPO starting at 4.2V the LDO linear can be a decent choice. The power efficiency is pretty good anyway as the differential across the regulator (starting at 0.9V) is small. The LDO will operate well down to say 3.4V covering most of the battery's operating range. They also offer low quiescent current which is maybe more important than efficiency in a device which is sleeping much of the time. They also will normally give a smaller size which can be important in keeping overall sizes small.

I know it is possible to get some buck converters with these good characteristics but I think any improvement in battery life will be marginal at best.