2
\$\begingroup\$

I have been doing a project as my first project to learn ESP8266 applications. My project is a temperature and humidity values data logger and upload the data to Thingspeak.

The sensor used is DHT11.

I am using a NodeMCU ESP12 v0.9 board as in this image:

enter image description here

Connection diagram is:Connection diagram of temperature and humidity data logger

The code you can see is this.

The problem that I faced is:

When it is running and the battery dies the whole system doesn't restart from the start. It remains in sleep condition, I have waited like 30 minutes thinking the nodemcu would wake up from sleep but no it doesn't.

I want to know if there is reset code that can be used or a push button or switch should be used to reset.

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

Connect a button to RST pin on NodeMCU (3rd pin from bottom left) and then to ground. When you press the button RST is pulled low and NodeMCU should reset and wake up fro deep sleep.

\$\endgroup\$
4
  • \$\begingroup\$ But, RST pin is in use for deep sleep mode. \$\endgroup\$ Commented May 19, 2019 at 17:07
  • \$\begingroup\$ Going to deep sleep does not require the RST pin. It is only required for waking up. \$\endgroup\$
    – Ameer
    Commented May 20, 2019 at 16:21
  • \$\begingroup\$ I think I haven't understood your solution here, I am thinking of demonstrating this project. So, if anything happens in the demo period I have to disconnect the RST pin with D0 pin and connect it with RST pin? If that so is this switch useful? \$\endgroup\$ Commented May 22, 2019 at 2:11
  • \$\begingroup\$ Even though you have connected D0 to RST, your code is not using D0. I don't understand why you are connecting the two pins. As for a button, a simple push button would be better. \$\endgroup\$
    – Ameer
    Commented May 23, 2019 at 6:30
0
\$\begingroup\$

You need the RST to D0 connection if you are using DeepSleep

enter image description here

As the RST pin is being used for deepsleep it is not possible to connect it to GND. You will need a Normally Closed push button or a flip switch. It is no possible to use RST for deepsleep and as a reset.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Can you please add some words about why this is the solution? \$\endgroup\$
    – Jens
    Commented Jul 8, 2022 at 22:20
  • \$\begingroup\$ Add a comment on why you cannot use RST pin and need a different button/switch \$\endgroup\$
    – yknot
    Commented Jul 9, 2022 at 23:09
0
\$\begingroup\$

This is an old post but people may find it when looking for a solution. What I found:

Some ESP8266 modules have a large capacitor from RST to ground. Charging this without current limit from GPIO16 is a problem. Connect GPIO16 to RST using a resistor. The value is not critical, a few hundred ohm to 1k is fine. That way the capacitor charges slowly and the reset works.

Some modules in addition need a pullup resistor on D3, otherwse the reset by GPIO16 will put them in Flash mode. I used 1k, that works reliably.

The ESP12Fs that I work with need both to reset reliably after timer expiration in deep sleep, without it only works sometimes.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.