Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Marmachine
#67204 Hi folks,

I'm working on a WeMos D1 board, it sends an update every 5 minutes (over Wifi) and then goes into DeepSleep for 5 mins.
In order to have it restarting after a deep-sleep i have to put a (470 Ohm) resistor between GPIO16 (D0) and RST pins, otherwise it won't restart.

Now, what i want to do is to initiate a wake-up/restart when a door opens, but only when it's in deep-sleep. In this state, GPIO16 (D0) is high (around 3.1V measured). To forse a restart, this should be pulled low shortly by grounding it.
I've found a solution to do this, some guy already had a similar issue and shared his schematic for that.

I'm using a reed-contact (magnetic, closed when the door is closed), so i started setting up the scheme as a test, but i'm not getting this to work somehow. First of all, since i couldn't get my hands on a 1uF/16V, i've used a 1uF/50V capacitor. My guess now is that this won't work because it doesn't load at this low voltage? Anyway, since my (required!) R5 resistor is there between GPIO16 and RST, the other R4 resistor might need some change?

I've tested: shorting the capacitor, removing R5 resistor, when i break the contact, the board restarts as soon as i close the contact again. But, it won't wake up after 5 minutes without the R5 resistor in place.

I'm kinda lost since i'm not that kind of an electrician to determine what is wrong here. Perhaps someone here is?

Here's my schematic:
Image
User avatar
By rudy
#67205 The voltage rating on the capacitor is fine. That is not your problem. If you are using an electrolytic capacitor, then the negative side should be on the left in the schematic.

It looks to me that the input is wrong. I think the Q1 should normally be off and only turn on when the switch closes. I'm out of time now but I will try and look at this later.
Last edited by rudy on Thu Jun 15, 2017 7:52 am, edited 1 time in total.
User avatar
By rudy
#67207 That capacitor is the right type.

Now that I had my first sip of coffee, the input circuit is ok. As long as the normal state of the switch is closed. When it opens it then turns on Q1. The new low on Q1 will momentarily pull down the emitter of Q2 by the current through the capacitor. If there is a high on GPIO16 then this will forward bias Q2 (since the emitter is low for that time) and this will cause the collector to go low.

My concern is that the 470 ohm resistor is to low a value and it is preventing this circuit from providing a low enough signal for a reset. I also would have to see what the reset circuit for the board looks like. I'm not that familiar with that board's component values.

OK I have had a look at the Wemos schematic. It has a 10K pull up and a 0.1uF cap to ground. It looks like the circuit should work, but I still am concerned that the 470 Ohms might be what is causing the problem.