ESP 12E and NodMCU Pinout

Introduction

In today’s article, we will be discussing the ESP 12E board which is one of the most used Espressif systems boards. After the introduction of this board, it revolutionized the IoT segment.

The ESP 12E board by AI thinker is a Wi-Fi module which is based on the ESP8266EX SoC which is the Wi-Fi chip that supports TCP IP protocol and is based on Tensilica L106 diamond 32-bit processor and an integrated Wi-Fi MAC. It is the baseboard for NodeMCU.

In today’s articles, we will be discussing the pin out of ESP 12E, its pinout description, and the programming of the board.

Board Components

ESP 12E on board components
  1. Microprocessor – As mentioned earlier the ESP-12E is based on the Tensilica L106 diamond 32-bit processor.
  2. ESP8266EX SoC – ESP8266EX SoC is a wifi chip that is available on the board and can go up to 80 – 240 MHz of frequency.
  3. Antenna – ESP 12E has an in-built antenna that is used for connecting the board to wifi connectivity. The presence of an inbuilt antenna helps in simplifying the design by eliminating the need for an external antenna.
  4. Memory – The ESP 12E board comes with 4 MB of embedded SPI flash memory which is needed for storing the program and firmware.
  5. Power LED – There is an inbuilt power led present in the ESP 12E module which is red in color and it will start blinking when the board is connected to a power supply.
  6. Interfaces – The ESP 12E has several communication and data transfer interfaces available which are UART, SPI, I2C, I2S etc.

Board Features

BoardArduino ESP 12E
MicrocontrollerNodeMCU ESP8266
Antenna1
Flash memory4MB
Board Dimension16mm x 24mm x 3mm
Weight of the board1.72 gm
I/O port17
ADC channels1
InterfacesSDIO 2.0, SPI and UART
PWM Pins4

Power Consumption OF ESP 12E

Power Supply2.2-3.6v
Current Consumption70.5 mA
I/O Voltage0-3.3v
I/O Source Current12 mA
Modem Sleep15uA
Light Sleep0.9uA
Deep Sleep<10uA
Now let us have a look at the pinout of the ESP 12E board.

Pinout OF ESP 12E

ESP 12E  Pinout
PinFunction OF The Pin
RSTReset the Module
ENActive High Chip Enable Pin
VCC3.3V Power Supply (max 3.6V)
GPIO16Waking board from deep sleep mode
GPIO14GPIO14 pin (CLK)
GPIO12GPIO12 pin (MISO)
GPIO13GPIO13 pin (MOSI)
GPIO15GPIO15 pin (HSPI_CS)
SDCMDSDIO CMD (GPIO11)
SDD0SDIO Data 0 (GPIO7)
SDD2SDIO Data 2 (GPIO9)
SDD3SDIO Data 3 (GPIO10)
SDD1SDIO Data 1 (GPIO8)
SCCLKSDIO CLK (GPIO6)
GNDGround Pin
ADC0ADC Pin with 10-bit resolution
GPIO2GPIO2 pin (TXD1)
FlashFlash Pin (GPIO0)
GPIO4GPIO4 pin (SDA – I2C)
GPIO5GPIO5 pin (SCL – I2C)
RXD0UART0 RXD pin (GPIO3)
TXD0UART0 TXD (GPIO1)

NodeMCU

The ESP8266 SoC is a cheap Wi-Fi Microcontroller with full TCP/IP Stack developed by Espressif Systems. NodeMCU is a firmware for ESP8266 which is developed using C Programming Language, Espressif NON-OS SDK and Lua scripting language.

Normally, we write code for Microcontrollers either in C or C++ programming languages and compile it to generate a binary file. The binary file is then uploaded into the flash memory of the microcontroller and it gets executed but NodeMCU firmware works as an interpreter for Lua Scripts so it will interpret the bytecode and executes the commands. There is no need of compilation, no binary file etc. We only have to write a script and run it.

Board Components OF NodeMCU

  1. 3.3 Voltage Regulator – There is an inbuilt voltage regulator available on the board which regulates the input voltage which is being supplied to the board.
  2. Boot/Flash Button – Boot/Flash button is required for entering the boot or flash mode.
  3. Micro USB connector – It is required for connecting the board to the 5v power supply.
  4. RESET Button – A RESET button is available on the board which is used to reset the board.
  5. USB to TTL Converter IC – The USB to TTL Converter IC is a cost-effective way to convert TTL signal a USB interface so that the board can be connected to the computer.
NodMCU on board components

Pinout OF NodeMCU

PinDescriptionAlternate functionDefault
ADC0Analog InputADC0
Reserved
Reserved
SDD3SDIO Data 3GPIO10SDD3
SDD2SDIO Data 2GPIO 9SDD2
SDD1SDIO Data 1GPIO 8SDD1
SDDCMDSDIO CMDGPIO 11SDDCMD
SDD0SDIO Data 0GPIO 7SDD0
SDCLKSDIO CLKGPIO 6SDCLK
GNDGround
3.3V3.3V output
ENChip Enable (Active HIGH)
RSTReset (Active LOW)
GNDGround
VIN5V Input to 3.3V Regulator
3.3V3.3V Output
GNDGround
TXD0UART0 TXDGPIO 1TXD0
RXD0UART0 RXDGPIO 3RXD0
GPIO15GPIO15HSPI_CS / RTS0GPIO15
GPIO13GPIO13HSPI_MOSI / CTS0GPIO13
GPIO12GPIO12HSPI_MISOGPIO12
GPIO14GPIO14HSPI_SCKGPIO14
GNDGround
3.3V3.3V output
GPIO2GPIO2UART1 TXDGPIO2
FlashFlashGPIO0Flash
GPIO4GPIO 4Software SDA (I2C)GPIO4
GPIO5GPIO 5Software SCL (I2C)GPIO5
GPIO16GPIO 16Wake (deep sleep)GPIO16
NodMCU pinout

Power Pins

There are two ways available which are used for powering up the board. At first, there is the micro USB port and the Vin pin. There are three 3V3 pins available. The board gets enabled when a supply of 5v is transmitted to the Vin.

The ESP8266EX SoC is only compatible with 3.3v so there is a 3.3v regulator which is available in NodeMCU.

Enable Pin

The EN pin is the enabled pin for the board. When this pin is pulled high the EN chip is enabled and when this pin is pulled low the chip is disabled.

GPIO Pins

There are a total of 17 pins available on the board however all of them are not available for the users. Some of them are connected to SPI Flash and UART.

SPI Pins

In ESP8266EX SoC there are 2 SPI interfaces available which are SPI and HSPI. Both of the SPI interfaces perform the slave and master operations. The clock speed of slave operation is limited to 20MHz while the speed of the clock in master operation is about 80MHz.

The following table shows the pin mapping of SPI interfaces

For SPI

SCLKGPIO 6
MISOGPIO 7
MOSIGPIO 8
CSGPIO 11

For HSPI

HSPI_CLKGPIO 14
HSPI_MISOGPIO 12
HSPI_MOSIGPIO 13
HSPI_CSGPIO 15

UART Interface

There are two UART hardware available on the ESP8266EX SoC which supports the baud rates up to 115200. The two UART hardware are UART0 and UART1. The UART0 can be used for communication and it also provides data flow control.

The UART1 has only a TX pin as its RX pin is being used by SDD1. The UART1 is used for data logging. The following table shows information about the UART pin mapping

UART0 TXGPIO3
UART0 RXGPIO1
UART0 RTSGPIO15
UART0 CTSGPIO13
UART1 TXGPIO2
UART1 RXGPIO8(Not available)

Boot Mode Selection Pins

Boot mode selection pins are listed below

GPIO 0GPIO 2GPIO 15Boot Mode
LowHighLowUART Bootloader
HighHighLowBoot from SPI Flash
××HighBoot from SDIO

Analog Input Pin

ESP8266EX SoC supports analog input in one GPIO only which is ADC0. The ADC pin is required for converting the analog signal to a digital signal. The maximum input voltage of ADC0 is 0 – 3.3v if we are using an ESP8266 12-E NodeMCU kit.

RST Pin

The function of the RST pin is the same as the onboard RESET button. If the RST pin is pulled low the ESP8266 will get reset.

GPIO0 Pin

The GPIO0 pin is used for entering bootloader mode. If the GPIO0 pin is pulled low then it will set the ESP8266 in bootloader mode. Its function is the same as the onboard Flash/Boot button.

GPIO16 Pin

GPIO16 is used for waking up the ESP8266 from deep sleep. For this purpose, GPIO16 should be connected to the RST pin.

PWM Pins

ESP8266 allows software PWM in all I/O pins: GPIO0 to GPIO15. The PWM signals on ESP8266 have a 10-bit resolution.

Interrupt Pins

The ESP8266 supports interrupts in any GPIO, except GPIO16.

How To Program NodeMCU

For programming NodeMCU click on the link given – How to program NodeMCU.

Uploading The Blinky Sketch

The code is as follows

#define ledPin1 2 /* LED connected to GPIO 2 */
#define ledPin2 16 /* LED connected to GPIO 16 */

void setup()
{
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
}

void loop()
{
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, HIGH);
  delay(1000);
  digitalWrite(ledPin1, HIGH);
  digitalWrite(ledPin2, LOW);
  delay(1000);
}

Now, click on upload and your code will be uploaded.

Frequently Asked Questions

Q1-Is NodeMCU the same as Arduino?

Ans-NodeMCU is different from Arduino as NodeMCU functions as a development board while Arduino functions as a microcontroller board.

Q2-Does NODEMCU work with wifi?

Ans-Yes, NodeMCU can work with wifi.

Q3-Can we use AT commands in NodeMCU?

Ans-NodeMCU was developed for replacing the AT commands with Lua scripting so we can not use AT commands in NodeMCU.

Q4-Can we multiplex 2 analog inputs in NodeMCU?

Ans-Yes, we can multiplex 2 analog inputs in NodeMCU using the DPDT relay.

Leave a Comment