Water pump messed up at set up

Good day everyone! I´m controlling a bomb through a 5V relay with a digital input. However I notice that at booting the board those pins that are to start LOW are set to HIGH for about 2 seconds and THEN go to LOW. This turns on the bomb and messes everything else in the code. I´ve read that I should put a pulldown resistor to fix that, but so far that hasn´t worked. Any idea what can I do to fix it? Thanks y´all! :slight_smile:

void setup(){
pinMode(sensorDeFlujo, INPUT);
  attachInterrupt(0, flujo, RISING);
  interrupts(); // Habilitar interrupciones
  tiempoAnterior = millis();
  pinMode(pin, OUTPUT);
  digitalWrite(pin, estado);
  /*while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  Serial.println("Ethernet WebServer Example");

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);

  // Check for Ethernet hardware present
  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true) {
      delay(1); // do nothing, no point running without Ethernet hardware
  if (Ethernet.linkStatus() == LinkOFF) {
    Serial.println("Ethernet cable is not connected.");

  // start the server
  Serial.print("server is at ");


Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Please post the FULL code.

Some Arduinos ‘test’ outputs as part of boot sequence, some don’t, it is documented elsewhere and cannot be changed. So changing output may be an option, or Arduino model. Alternatively an inline resistor and capacitor to ground absorbs the power, but does have disadvantage thereafter of slowing the output response, this may or may not be an issue.
GPIO Pins goes "HIGH" a short pulse on boot · Issue #421 · nodemcu/nodemcu-firmware · GitHub Discusses the RC circuit to counter the pulse.