0
\$\begingroup\$

I am trying to use an ESP-12E module to detect a voltage & drive a MOSFET and LED.

My schematic is attached.

I am having trouble getting this on and after checking it several times, I can't understand what am I doing that is wrong. The schematic is here. This is my Arduino code:

(Added Later) :One thing I learnt is that I have not pulled down GPIO15 to ground, is that what is preventing my ESP from booting normally?

#include <ESP8266WiFi.h>


#define MOSFET 2
#define SWITCH 0
#define LED 5
#define DEBUG True



void setup() {

  pinMode(SWITCH, INPUT);     
  pinMode(MOSFET, OUTPUT);     
  
  pinMode(LED, OUTPUT);
  
  
  digitalWrite(MOSFET, LOW);   
  digitalWrite(LED, HIGH);
 

#ifdef DEBUG
  Serial.begin(115200);
#endif

  
  }

void loop() {

  digitalWrite(LED, HIGH);
  digitalWrite(MOSFET, HIGH);
  delay(1000);                       
  digitalWrite(LED, LOW);
  digitalWrite(MOSFET, LOW);
  delay(1000);        
  
}

enter image description here

\$\endgroup\$
8
  • \$\begingroup\$ What is it doing that is wrong? What does it do that it shouldn't? What does it not do that it should? \$\endgroup\$
    – JRE
    Commented Oct 12, 2021 at 14:12
  • \$\begingroup\$ It is not booting. \$\endgroup\$
    – Amorphous
    Commented Oct 12, 2021 at 14:13
  • \$\begingroup\$ That's a start. That belongs in your question. How do you know it isn't booting? \$\endgroup\$
    – JRE
    Commented Oct 12, 2021 at 14:13
  • \$\begingroup\$ I just learnt that GPIO15 needs to be pulled down for normal operation, I have missed that in my circuit & pcb. May be that is the only problem. \$\endgroup\$
    – Amorphous
    Commented Oct 12, 2021 at 14:13
  • \$\begingroup\$ I checked the PCB and the voltages are right where they should be, the supply is also solid. Code is also working in nodeMCU. But my ESP12 is not booting. \$\endgroup\$
    – Amorphous
    Commented Oct 12, 2021 at 14:14

2 Answers 2

1
\$\begingroup\$

ESP8266 (ESP-12) pins and io overview:


UART

io3 RX0

io1 TX0


boot config pins with pullup or pulldown on board

io0 PULLUP (LOW for boot to flashing mode)

io2 TX1 PULLUP (UART1 TX. no RX for UART1)

io15 PULLDOWN (SS pin if esp8266 is SPI slave); TX if UART is swapped


untroubled GPIOs with optional function for I2C or SPI bus:

io5 default pin for I2C SCL in Arduino Wire library

io4 default pin for I2C SCA in Arduino Wire library

io14 SPI CLK

io12 SPI MISO

io13 SPI MOSI; RX if UART is swaped


RTC pin for timed deep sleep wake-up (if connected to reset pin)

io16 - optional internal pulldown, internal pullup not available


not useable: pins io 6 to io 11 connect QIO SPI flash memory (in a very special setup the SPI bus can be used with other SPI device) (in other very special setup the QIO pins can be used as gpio)

note: most digital IO start with internal pull-up on

\$\endgroup\$
0
\$\begingroup\$

Grounded GPIO15 and now it works.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.