Digital pins turns HIGH on my NodeMcu V3

I put this code, but no changes :frowning:
I noticed that as long as the sketch is loading, the relay goes LOW, when starting - turns again HIGH and I can’t change it from Blynk app.
Then I commented out line 66 (// pinMode(RELAY1, OUTPUT):wink: in setup sector.
And after restart relay stays LOW. Of course I still cant control it.

I’d start by getting to the bottom of the relay control, and working-out if it’s active HIGH or LOW.

Remove all the code relating to the sensors and disconnect them, just keep the relay connected and the relay code in the sketch.

Also, keep an eye on the serial monitor to check that the NodeMCU isn’t restarting without you realising it.

The relay can take quite a bit of current to power it, so it’s not a good idea to connect it to the NodeMCU as you could end-up frying the onboard voltage regulator or starving the NodeMCU of power causing it to restart, or starving the relay of power so that it can’t operate even if it’s being activated correctly.

Pete.

1 Like

Also, once you figure out the relay, when hooking the sensors back up don’t use D4. I would go with D5 (14) or D7 (13), and change the code to reflect your choice.

1 Like

You must connect the Vcc from relay to second RSV below of A0. There you will have 5V if you power the nodemcu trough Micro-usb.

one year later … :joy:

:sweat_smile:
Just now i read this post…

1 Like