0
\$\begingroup\$

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);
SamGibson
18.5k5 gold badges42 silver badges65 bronze badges
asked Nov 2, 2018 at 8:58
\$\endgroup\$

2 Answers 2

6
\$\begingroup\$

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

answered Nov 2, 2018 at 9:58
\$\endgroup\$
2
  • \$\begingroup\$ thank you. Dual relay link added to Q, and piece of the code. \$\endgroup\$ Commented Nov 2, 2018 at 10:01
  • \$\begingroup\$ seems no document tell the internal pull-up resistor value. some blog says it about 40~60 KΩ: rayshobby.net/wordpress/tips-and-tricks-for-using-esp8266/…. \$\endgroup\$ Commented Mar 24, 2023 at 20:26
2
\$\begingroup\$

The NodeMcu has no pull-up on pins 12 and 14. The esp8266 has internal pull-up and you activate it with pin mode INPUT_PULLUP. Without activated internall pull-up, there is no pull-up for this pns.

answered Nov 3, 2018 at 15:43
\$\endgroup\$
8
  • \$\begingroup\$ As you can see in my code, it IS initiated with INPUT_PULLUP but the behaviour, scarcely, seems it does not have any. \$\endgroup\$ Commented Nov 3, 2018 at 18:07
  • \$\begingroup\$ you say that the internall pullup doesn't help? \$\endgroup\$ Commented Nov 3, 2018 at 18:12
  • \$\begingroup\$ I say that, I had some occurrences that erratic triggering happened ... \$\endgroup\$ Commented Nov 3, 2018 at 18:14
  • \$\begingroup\$ ...while already using internal pull-up. I was not sure how to understand the question. So voltage drops while WiFi consumes too much power? \$\endgroup\$ Commented Nov 3, 2018 at 18:17
  • \$\begingroup\$ you know I have my language limitations :) - Yes, it happened when PULLUP was already defined in code. I'm using a 2A DC adaptor, I doubt if the esp8266 consumes power in that scale. \$\endgroup\$ Commented Nov 3, 2018 at 18:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.