chaeplin / esp8266_and_arduino

esp8266 mqtt node / esp8266
292 stars 89 forks source link

Self-wake-up / a timed DeepSleep requires a tweak? #42

Closed Marmachine closed 3 years ago

Marmachine commented 7 years ago

reed_contact_wemosd1_wakeup_schema

Hi, As i wrote earlier, i am very very happy with your project as it is exactly what i need, so again thanks for sharing! I want to use it with a WeMos D1 board and finaly all my parts have arrived so i've setup a test. Since that wasn't very succesfull, i've tried it with a NodeMCU board, again no luck.

I am pretty sure that it all comes down to the fact that the ESP8266 won't wake up from DeepSleep(60) without "some" connection between GPIO16 and RST, instead it just stops.

WeMos D1 To have the WeMos D1 board wake up and reset by itself after some time, connection is required between GPIO16 and RST. I've tried a 1K but that seemed to be too much, a 470ohm resistor worked for me. Actually i was adviced that the best would be a schottky diode with cathode to GPIO16, also a wire will also work, but that will result in problems when flashing!

NodeMCU Since i couldn't find any solution to my issue with the WeMos board, i figured to test this with a NodeMCU board. Without the connection, i get the same issue, so basically there's a similar problem here. (however a 2K2 resistor did work here i believe).

This leaves the solution unworkable with a timed DeepSleep() on these boards i think? Maybe because the power on the RST pin stays too high to get this to work properly, but then again... i'm certainly no expert on electronics.

Anyway, i am curious how to get this to work? What board will work?

So, questions:

  1. Do you think that using this capacitor should work? I am aware of using a 50V instead of a 16V. Which would you advice?

  2. Maybe the R4 should be recalculated in this setup? (note that, without R5, both the WeMos and NodeMCU boards hang after a timed wake up)

  3. Just to be sure: The reed contact, is it closed when your door is closed? So with it all in rest - door closed - it connects to ground, right?

I've been reading the result of #40 Midgie75 using a NodeMCU who claims to be successfull, though using a 2K resistor as R5. I can't say that i get a better result with that board either.

Any help is appreciated, i'm kinda lost with this project. Marco

Fettkeewl commented 6 years ago

Hi Marmachine, I have the same needs as you, to get chaeplins circuitry working with the ability to self-wake. Have you made any progress?

Marmachine commented 6 years ago

Hi,

Unfortunately not. Actually i haven't been working on this project for some months since i ran into another issue.

It seems that the WiFi signal disturbs the PIR sensor which makes it go into a loop and call false alarms:

Motion detect > WiFi call > No Motion > Wifi call > PIR detects false motion > Wifi call > No Motion > Wifi call... etc.

I need to look into this, my first idea is to shield the sensor somehow, also i will test with a different (stronger) power adapter to make sure it's not a power related issue.

However, if you have any ideas, i will be glad to hear and ofcourse i'm willing to share my development as well.

Best regards,

Marco


Van: Fettkeewl notifications@github.com Verzonden: woensdag 8 november 2017 16:20 Aan: chaeplin/esp8266_and_arduino CC: Marmachine; Author Onderwerp: Re: [chaeplin/esp8266_and_arduino] Self-wake-up / a timed DeepSleep requires a tweak? (#42)

Hi Marmachine, I have the same needs as you, to get chaeplins circuitry working with the ability to self-wake. Have you made any progress?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/chaeplin/esp8266_and_arduino/issues/42#issuecomment-342849789, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AYU33TxiXAmggr90nWjPhZjmvLbwaurZks5s0caxgaJpZM4N4V-e.

Fettkeewl commented 6 years ago

If its any help I vaguely remember reading that PIR's do get disturbed by wifi. Positioning them corretly.. If you have no need to constantly be connected then I suggest turning off your wifi and have it off untill motion trigger turns it on.

In regards to chaeplins circuit I might have cracked the nut that was bothering us. It would seem that the resistor R1 and R4 have to high values for a proper negative pulse.

EDIT:

Removed previous "solution", it was faulty, there was still the possibility to externally reset the device while it was running. 6ca8afdbc019020a149d6df5fb2b9ad9d0f9f255

This is my new solution, colored, i switch the first transistor in the reset line to a PNP transistor, because I could not use GPIO16 as Chaeplin did, I had to select another GPIO. All GPIOS on the ESP are at 0V when in deep-sleep except GPIO16.

For this circuit to work, the pin connected to the base of the PNP transistor needs to be held high while in operating mode. When ESP goes to sleep the pin will get pulled low, caution though, do NOT write said pin low yourself, that just fired a reset for me. Do not forget the DIODE between GPIO16 and RST, else GPIO16 will hold rst high when opening reed.