When the nodemcu units starts all the 4 relay on their self,

I am doing same but when the nodemcu units starts all the 4 relay on their self,
can any one solve it.

Probably a coding issue, wiring issue or both. Without more information it is impossible to tell. Please share more information (code, wiring diagram, project description, etc.), and we may be able to better assist.

try using different pins, some pins go high when booting up, so you have to pick pins that do not do that.

Pull the pins to the state you want with a digitalWrite immediately after the pinMode statement.

Pete.

surely that is too late? The pins switch about on booting before any codes runs. So a relay connected might chatter switching stuff about with nasty side effects.

Pin usage map for esp8266

use pins 4,5,15 if you need the output to be low on startup.

12,13,14 will pulse high then go low.

0,1,2,3 will pulse low and then go high.

2 Likes

No, that usually works very well in practice.
It also depends if digital or virtual pins are being used in the app. Use of virtual pins seems to fix this type of issue, so I think some of it may be caused by the Blynk library pulling undefined pins to a particular state (the OP doesn’t say if the pins are going HIGH or LOW, simply that the relays turn on).

Pete.

1 Like

The code is a builtin example blynk libray, it following, connection is attached here in pic.

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266_SSL.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

void setup()
{
// Debug console
Serial.begin(9600);

Blynk.begin(auth, ssid, pass);
}

void loop()
{
Blynk.run();
}

Sorry for poor dwg, :smiley:Uploading: IMG_20190425_104152.jpg…

You didn’t format your code correctly when you posted it, so I’ve edited your post to to add three backticks at the beginning and end of your code.
Three backticks look like this:
```
Please add them yourself in future.

Your drawing doesn’t seem to have uploaded correctly, but it probably won’t tell us anything we don’t already know.

My advice would be:

  1. Don’t try using the SSL version of the library until everything else is working correctly.
  2. Use virtual pins, which will require additional coding, rather than digital pins.
  3. When you’re looking for help with relays, make it clear if your relays are active HIGH or active LOW.

Pete.