[SOLVED] Booting up with active low relays

I have a Wemos D1 mini with some relays connected to the GPIO Pins. Nowadays most of the relay board are active low. I know I can flip the 0 and 1 state in the app, so I can control the relay correctly.

But my problem is that when the ESP boots up, it does generate some pulses which make the relay energize for a split second. I am planning to use one of the relays for opening the garage door, and I want to make sure the door does not accidentally go up when after a power shortage and the ESP is booting up.

Has anyone of you have a safe method for this? Or are there are pins that are safe to use for this particular scenario? I have a 4 relay board, I tried D1-D4 and D5-D8 as well. In both cases I hear the relay clicking, but to be honest could not tell if all trigger, or only a few.


Take a look at this thread for a few ideas…


1 Like

Thanks PeteKnight, this is exactly what I was looking for. I was looking for a this, but did not find that topic.

If anyone bumps into this topic in the future, the my solution is use D1, and D2 (Pin 4 and 5) on the Wemos D1, as they have a high initial state and don’t send out any signal during boot. I modified setup like below for good housekeeping:

void setup()
  // Debug console
  Serial.println("Setting initial pin states");
  pinMode(5, OUTPUT);
  pinMode(4, OUTPUT);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
1 Like

thank you friend I solved the problem