Electrical – ESP8266 – PULLUP resistor using Arduino code

arduinoesp8266

I'm having some trouble with this ESP8266, to switch UP, DOWN, OFF dual relay, using Arduino code and a physical 3 states switch.

The code defines input GPIOs 12,14 as INPUT_PULLUP to avoid cases that from time to time ( say once a day ), I get a phenomena that is typically for not using a pull-up resistor.

What can cause such a thing?
Can it be that GPIO12, GPIO14 does not HAVE a pull-up resistor on-board?

Relevant code (that defines inputs and outputs):

void setup() {

        Serial.begin(9600);

        pinMode(switchUpPin, INPUT_PULLUP);
        pinMode(switchDownPin, INPUT_PULLUP);
        pinMode(relayUpPin, OUTPUT);
        pinMode(relayDownPin, OUTPUT);

        digitalWrite(relayUpPin,HIGH);
        digitalWrite(relayDownPin,HIGH);

Best Answer

No, GPIO12 and GPIO14 have internal pull-up resistors (see table below). If they are properly setup in software I would suggest looking at the output (relay control circuit). Since you provided no information about the relay or how you control it I can't give a better answer.

ESP8266 pull-up table

Table from here