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

User avatar
By ezcGman
#88500
btidey wrote:EN must be kept high 3.3V all the time the ESP8266 is running. As soon as it goes low the ESP8266 will instantly stop.

So if you are pushing the switch and releasing it then that is not going to work. The ESP8266 will start up but will stop as soon as you release the switch.

EN must be kept high long enough for the ESP8266 to complete its actions and then go into deep sleep.

You can simulate this by keeping the switch pressed fo rthe several seconds needed for this, but the real solution, as I mentioned, is to use a GPIO to hold the EN high as soon as the software starts via a schottky diode until the software completes its actions.

EN_feedback.jpg


Thanks again! I haven't tried that setup yet, but what I can tell is that I even tried having the button closed, so giving the pin multiple seconds of 3V3 and it still doesn't wake up :/
Is it maybe my board? I just started off developing with ESP8266 with some boards from Banggood. The board has an ESP-12F module. I can't help myself why it is not working... So I'm really, really thankful for all the help here! I will revisit the EN pin solution with another set of board fro another vendor, maybe it is just the board...

However, I came up with a much simpler solution (I think :D), which is very similar to what I had before, where the ESP is awake all the time and just waits that GPIO4 is pulled to LOW / to GND.
I came across this after reading some guides about deep sleep on the web, where they always connect D0 and RST for timed deep sleep, because D0 goes low when the timer runs out and then resets the ESP to wake it up, like this one: https://randomnerdtutorials.com/esp8266 ... duino-ide/
Same page actually then lists what I came up with while reading: I can just use what I have right now with an NPN tranistor and the 5V door signal connecting to the base! Which will then pull the RST LOW / to GND.
However, he was doing it slightly different, also connecting a 3V3 from the ESP to the circuit, which didn't really understand yet.

While this works PERFECTLY on my breadboard, it does not on the phone / doorbell itself. It takes like 5-8 seconds for the ESP to actually wake up and I also figured out why, but need to find a solution for it:

Turns out, the 5V signal is present for a few seconds if somebody rings the doorbell, which would be great for the EN solution, if it would work, but not for this solution it seems. So the ESP wakes up when the 5V drop again... I can also simulate the same behavior on the breadboard. If I longpress, nothing happens, but when i open the switch again, the ESP wakes up.

I again admit, I have not yet fully understood why this happens. But I will try to read up a bit... I'm thinking if a diode would help here (similar to what you described in another post), like drawn in v4 diagram attached. I haven't tested it yet though.
EDIT: The diode solution doesn't work :)

Attached again my iterations of the this transistor version:
* v1: Working perfectly, but with the ESP being awake all the time. That's what I'm having/using right now.
* v2: Modified version of v1, trying to wake up the ESP out of deep sleep by (trying) to pull the RST pin low
* v3: Modified version of v2, copied from the linked tutorial, where he connects the 3v3 to it.
v2 and v3 have the issue, that the ESP wakes up when the voltage goes away, not when it rises / somebody rings the doorbell.

Thanks for listening to my noob stories :D
You do not have the required permissions to view the files attached to this post.
User avatar
By btidey
#88506 Yes. The trouble with all those variations is that the doorbell signal pulls RST low and only releases it when the doorbell signal is released and that is when the ESP8266 starts up. That is why you get a 5 second delay.

The EN is the best approach and this definitely works. I have lots of modules based on this approach.

However, if you wanted to use one based on the variations then you would need to capacitatively couple the door bell signal into the transistor so that it automatically terminated quickly even though the doorbell signal stays high for 5 seconds. Something like

resetPulse.jpg


With this when the doorbell signal goes high the capacitor passes this on to the transistor and the RST goes low. The capacitor then discharges via the 10K resistor in a few 100uSec, the transistor goes off and the RST returns high for the ESP8266 to start up. If the RST pulse needs to be longer then increase C to 100nF. This assumes the doorbell signal is reasonably low output impedance compared to the 10K. The diode is just to protect the transistor as when the doorbell signal goes low then you would otherwise get a negative spike on the transistor base.
You do not have the required permissions to view the files attached to this post.
User avatar
By ezcGman
#88509 Oh god, that's awesome! I was thinking about using a capacitor, but wasn't 100%sure how it functions. With your explanation and a few readings in a book, I think I understand what happens :)

I need a capacitor for another project anyways, so heading for a electrcity shop the next days :) Will let you know how it went :) Thx again!