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.


2 Answers 2


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.

  • \$\begingroup\$ But, RST pin is in use for deep sleep mode. \$\endgroup\$ 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
    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\$ 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
    May 23, 2019 at 6:30

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.

  • 1
    \$\begingroup\$ Can you please add some words about why this is the solution? \$\endgroup\$
    – Jens
    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
    Jul 9, 2022 at 23:09

Your Answer

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

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