Strange way to reset program on nodemcu

Hi,

I am trying to use a DHT11 temp and humidity sensor on a NodeMCU 12F. The program is quite simple, with the sensor Vcc pin connected to Vin, ground pin to ground and signal pin to D8.

The first time I upload the sketch it worked ok, but when I want to upload again the sketch from arduino IDE, I see:

Serial port COM5
Connecting..............

UNLESS I disconnect the sensor Vcc pin from the nodemcu!

ALSO, the onboard reset button only works if I similarly disconnect the sensor, otherwise the uploaded program seems to stall.

I do not understand that behaviour, I do not have found any explaination on the web.

Any idea?

Thanks

Olivier

The problem is probably that Vin has 5V on it (USB V+), but the ESP12 is a 3.3V microcontroller. By connecting the sensor this way, you violate the maximum ratings of the microcontroller. Best case scenario this leads to erratic behavior - worst case you fry the microcontroller.

Just connect the Vcc pin of the sensor to a 3.3V pin on the NodeMCU.

Also a schematic helps in troubleshooting. Hand-drawn is fine.

Thanks Koraks,

Actually it is connected to 3V, not Vin. This is a picture of the board:

So I do not understand the problem

Looks like your 3V (red) is on the center sensor pin.
Interfacing DHT22/DHT11 with Arduino uno - Arduino Project Hub

Looks like there are modules where the center pin is signal and others on which it is Vcc. The correct pinout is usually printed on the pcb.

Try a different pin on the NodeMCU. D8 apparently is GPIO15 on the esp12, and pulling it up to 3V prevents the module from booting. Try d5, d6 or d7 and see how that goes.

Yes, that was it! I changed to D7 and it now works. Thanks for the answer and for the link, koraks!

Nice! Congrats and enjoy.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.