ESP32 Tutorial: What do you have to know about the ESP32 microcontroller?

There is a follow-up model of the ESP8266, a very powerful microcontroller with a low purchasing price:

The ESP32 also produced by Espressif Systems. 

In this tutorial you learn :

  • Technical specifications of the ESP32
  • Pinout of the ESP32
  • Power supply of the ESP32, also including powering with a battery
  • Power modes and power consumption of the ESP32
  • Configure the ESP32 board in the Arduino IDE

Table of Contents

What is the ESP32?

The ESP32 is a powerful 32 bit microcontroller with integrated Wi-Fi, full TCP/IP stack for internet connection and Bluetooth 4.2. Due to the low cost combined with great power and the opportunity to connect the ESP32 to many other electronic devices, the microcontroller is well suited for IoT projects.

Technical specifications of the ESP32

  • TTensilica Xtensa 32-bit LX6 microprocessor with 2 cores
  • Power supply: 2.3V – 3.6V
  • Current consumption: 20µA – 240mA. In DeepSleep-Mode only 5µA
  • Operating temperature range: -40°C – 125°C
  • External flash memory: up to 16 MB is supported
  • Interfaces
    • UART/SDIO/SPI/I2C/I2S/IR Remote Control
    • 36 programmable I/O pins max 20mA
    • 2 analog input 0V to 1V with 12 bit resolution
    • all inputs tolerate maximum 3.6V
  • Network
    • WiFi
      • WiFi 802.11 b/g/n 2.4 GHz with WPA/WPA2 PSK
      • ipv4 and ipv6 from Arduino Core 2.5.0
      • UDP and TCP with 5 simultaneous connections as maximum
      • Bandwidth: 150 to 300 kByte/s
      • Latency: < 10ms
    • Bluetooth: v4.2 BR/EDR and Bluetooth Low Energy (BLE)

If you want a full comparison of the technical specifications of the ESP32 against the ESP8266 boards and different Arduino boards, you will find this comparison in this article.

Pinout of the ESP32 NodeMCU

ESP32 pinout
NodeMCU labelTouchPWMNameDescription
3.3VPower supply 3.3V, 400mA
ENENABLELow = Power Down, High = Enabled, has 12kΩ pull-up
SVPxDigital Input pin with PWM
P32TOUCH9xDigital I/O pin with touch sensor and PWM
P25xDigital-to-Analog Converter (DAC_1)
P26xDigital-to-Analog Converter (DAC_2)
P27TOUCH7xDigital I/O pin with touch and PWM
P13TOUCH4xDigital I/O pin with touch and PWM
SD2xDigital I/O pin with PWM
5VxPower supply 5V-9V, 400mA
CLKxDigital I/O pin with PWM
P15TOUCH3xDigital I/O pin with touch and PWM
P16xDigital I/O pin with PWM
P5xSSDigital I/O pin with SS (Slave Select) for SPI communication
P18xSCKDigital I/O pin and SCK (Serial Clock) for SPI communication
P19xMISODigital I/O pin and MISO (Master In Slave Out) for SPI communication
P21xDigital I/O pin with PWM
RXxSerial input of the ESP connected to the USB-UART
TXxSerial output of the ESP connected to the USB-UART
P22xDigital I/O pin with PWM
P23xMOSIDigital I/O pin and MOSI (Master Out Slave In) for SPI communication

Power supply of the ESP32 NodeMCU

When we want to know what possibilities we have to supply power to the ESP32, we have to understand what are the different voltage levels on the PCB, starting from the supply pins and ending at the microprocessor itself.

The following picture shows a schematic picture of the voltage levels on the ESP32 NodeMCU. The additional tables show the voltage related specifications of the microprocessor and the voltage regulator.

ESP32 voltage overview
MicrocontrollerMinimum VoltageTypical VoltageMaximum Voltage
Voltage RegulatorOutput VoltageMaximum Input VoltageMaximum Output Current

The first and also the easiest possibility for a power supply is the 5V USB cable. But because the ESP32 runs on 3.3V, there is a built-in voltage regulator to transform the 5V of the USB connection to the desired 3.3V. The 3.3V pin of the NodeMCU PCB is also powered from this connection.

The second possibility is to use the VIN pin of the NodeMCU as input for the power supply. The AMS1117 voltage regulator has a maximum input voltage of 15V but in this case the regulator produces a lot of heat because the regulator has no heat sink or cooling fan for heat dissipation. Therefore a voltage between 7V and 12V is recommended when the ESP32 is powered by the VIN pin.

There are also multiple options to power the ESP32 with different kinds off batteries. This is particular interesting when you want to build a project that independent of a normal power supply like an outdoor weather station.

If the maximum voltage of the battery is higher than the maximum voltage of the ESP32 (3.6V), you have to use a voltage regulator to reduce the voltage to 3.3V. The output of the voltage regulator is then connected to the 3.3V pin of the ESP32 board.

My recommendation for a battery power supply is the LiFePO4 battery, because you do not need any extra voltage regulator between the ESP32 and the battery and they are rechargeable. Also LiFePO4 batteries have a capacity up to 6,000mAh, similar to LiPo and Li-ion batteries that gives your project a long lifetime in combination with a power mode that reduces the power consumption to a minimum.

Power modes and power consumption of the ESP32

When Wi-Fi is enabled, the chip switches between Active and Modem-sleep modes. Therefore, power consumption changes accordingly.

Power ModeDescription  Power consumption
Active (RF working)WiFi Tx packet180mA ~ 240mA
WiFi/BT Tx packet130 mA
WiFi/BT Rx and listening95mA ~ 100mA
Modem-sleepThe CPU is powered on240 MHzDual-core chip(s)30mA ~ 68mA
Single-core chip(s)N/A
160 MHzDual-core chip(s)27mA ~ 44mA
Single-core chip(s)27mA ~ 34mA
80 MHzDual-core chip(s)20mA ~ 31mA
Single-core chip(s)20mA ~ 25mA
Deep-sleepThe ULP co-processor is powered on150µA
ULP sensor-monitored pattern100µA @1% duty
RTC timer + RTC memory10µA
HibernationRTC timer only5µA
Power offCHIP_PU is set to low level, the chip is powered off.0.1µA

RTC = Real Time Clock
ULP co-processor = Ultra-Low-Power Co-processor

Active mode
The chip radio is powered on. The chip can receive, transmit, or listen.

Modem-sleep mode
The CPU is operational and the clock is configurable. The Wi-Fi/Bluetooth base-band and radio are disabled. In Modem-sleep mode, the CPU frequency changes automatically. The frequency depends on the CPU load and the peripherals used.

Light-sleep mode
The CPU is paused. The RTC memory and RTC peripherals, as well as the ULP co-processor are running. Any wake-up events (MAC, host, RTC timer, or external interrupts) will wake up the chip.

Deep-sleep mode
Only the RTC memory and RTC peripherals are powered on. Wi-Fi and Bluetooth connection data are stored in the RTC memory. The ULP co-processor is functional.

Hibernation mode
The internal 8 MHz oscillator and ULP co-processor are disabled. The RTC recovery memory is powered down. Only one RTC timer on the slow clock and certain RTC GPIOs are active. The RTC timer or the RTC GPIOs can wake up the chip from the Hibernation mode.

Select the ESP32 board in the Arduino IDE

  1. Make sure you have the latest version of the Arduino IDE installed. You can download the last version of the official website.
  2. The Arduino IDE supports a whole range of different Arduino boards after installation. Since we do not want to program an Arduino board but the NodeMCU board we have to introduce the NodeMCU board to the IDE. This is quite easy. Just klick on File → Preferences. Insert the following URL for the Additional Board Manager URLs.

Arduino IDE Preferences
ESP32 Board Manager URL

If you already have the ESP8266 boards URL, you can separate the URLs with a comma as follows:,

  1. Now we have to install the ESP32 drivers. Open the boards manager and go to Tools > Board > Boards Manager. Search for ESP32 and press install button for the “ESP32 by Espressif Systems“
Arduino IDE Board Manager
Arduino IDE Board Manager ESP32


In my opinion the ESP32 is a powerful microcontroller compared with an intuitive handling if you are familiar with the ESP8266. The only downside in my opinion is the width of the board because like the NodeMCU V3 it does not fit on the standard breadboard. Do you tried the ESP32 and what do you think about it? Leave a comment below.

7 thoughts on “ESP32 tutorial: What do you have to know about the ESP32 microcontroller?”

  1. This was very helpful, I was looking for the power requirements of the ESP32 and you made it very clear. Assuming your right about the 9V on the 5V pin, my ESP32 won’t start generating magic smoke. I have also ordered some ESP32 modules to integrate into my own circuits, these are 3.3 volts only, but again if your figures are right I might be able to power it with 2 x AAA rechargeable batteries at 2.4V, will be interesting to see how low the batteries can go before the module becomes unstable.

    • Hi, based on your comment I did a more in depth analysis of battery power supply options of the ESP32 and also added all the information to this article. Based on my analysis the best battery power supply for your case is the LiFePO4 battery (nominal voltage of 3.2V), because you do not need any extra voltage regulator between the ESP32 and the battery, they are rechargeable and you only need to wire the battery to the 3.3V pin of the ESP32 NodeMCU.

  2. Nice info. Currently I working with this board. This board has a brother which looks like same, there is ESP-32S. The difference is this board has 38 pins and his brother 30 pins

    • Hi thanks for the response and you are right there is the ESP-32S on the market. I already have the NodeMCU with this chip and currently I am writing on an article how to reduce the current consumption of the ESP32 boards. One point is if it is better to use the ESP-32 or ESP-32S chip. After I published the article, I will also add the information to the ESP32 tutorial.

  3. I try to use this board to switch a PC on. It is powered with a 12 V power supply (maybe later I’ll try the LiPo). I have an App which works fine with the corresponding Arduino script for the board. So power is on, WIFI is on, but it seems that after a while the board switches off or goes into one of the sleep modes and it is no longer available in the WIFI network. When I restart it (power off/power on) everything works fine again. Any idea what’s going on here?

    • Hi Martin,
      I understand your use case but from the information, it is hard to detect an error. If you like, you can send me your script to the following E-Mail address, and maybe I can find an error:

  4. Thanks for a great page with very useful information. Somewhere, I got the idea that if you supplied power to Vin you cause a problem if you connected a USB cable for communication. I plan using the ESP32 on a project to interface to a 1984 Heathkit H-89 Z80 based system. The ESP32 would be powered from the 5v power in the H-89. I would need to connect the USB cable to upload code while I’m debugging the design.

    Thanks for any insight.



Leave a Comment

Get your free Microcontroller Datasheet eBook

Get your free Microcontroller Datasheet eBook now, by joining the DIYI0T newsletter

- Ranking of 14 Arduino, ESP8266 and ESP32 boards

- Comparison of the Power Consumption of all Boards

- Detailed Datasheet Information and Pinouts