ESP32 - das Multitalent - AZ-Delivery

In this post, we'll take a look at what this microcontroller can do, how it can be programmed with the Arduino IDE, and what different modules and boards are available.

Technical specifications

The ESP32 already impresses with its technical data

  • CPU Dual-Core Xtensa with 240 MHz (up to 600 mips)
  • ROM 448KB
  • SRAM 520KB
  • SRAM in the RTC 16kb
  • External flash memory up to 16MB (modules have typical 4MB)
  • WIFI 802.11 B/g/n 2.4 GHz up to 150 Mbps
  • Bluetooth V4.2 and BLE 16MW transmission power
  • Real-time clock continues in deep sleep mode
  • 34 Programmable inputs/ outputs
  • 12 bit analogous to digital converter on up to 18 channels
  • 2 8-bit digitally to analog converter
  • 10 touch sensors
  • 3 SPI interfaces
  • 2 I2C interfaces
  • 2 I2S interfaces
  • 3 serial interfaces
  • CAN bus 2.0
  • Ethernet Media Access Controller (Mac)
  • PWM possible at all digital outputs
  • Built -in Hall sensor

 

Besides the WiFi and Bluetooth functions used in most projects, the ESP32 is capable of many other practical things. The real-time clock for example masters the automatic daylight saving time changeover and can also be operated with an external clock quartz instead of the internal clock.

The two outputs of the digital to analog converters offer - in contrast to the PWM common in microcontrollers - a real DC voltage with variable level. Additionally, sine waves can be output via a built-in function.

The touch sensors allow the realization of simple capacitive input surfaces without additional electronics.

The different bus systems can be connected to any input/output via a multiplexer. The figure shows how this works. The figure is for illustration purposes only and is not complete.


The I2S bus offers another interesting possibility. This bus has been designed primarily for the transmission of media data. The ESP 32 offers the possibility to use one of the ADW inputs as an input. But also the DAW outputs can be used as I2S outputs.

Since the I2S bus implementation allows direct memory access, audio signals can be stored in RAM via ADW inputs without CPU intervention. Likewise, it is possible to output digitized sounds from RAM via the DAW outputs.

ESP32 and the Arduino IDE

The ESP32 is not available from the beginning in the Arduino IDE board management. Therefore, in order to create and upload programs for the ESP32, we need to install a software package to support the ESP32.

First we have to tell the Arduino-IDE where to find the additional needed data for the ESP32. To do this, we open the Preferences item in the File menu. In the preferences window there is the input field called "Additional board manager URLs". Clicking on the icon to the right of the input field opens a window where we enter the URL https://dl.espressif.com/dl/package_esp32_index.json


After the change is saved, we can open the board management via the menu Tools>Board and enter ESP32 as search term.




After the ESP32 package has been installed, the "ESP32 Dev Module" should appear in the board selection.



ESP32 Devkit C V4

This is the flagship of the ESP32 modules offered by AZ-Delivery. A new improved circuit board has improved the functional reliability when uploading the programs. Since the antenna now extends beyond the base board, the radiation condition has improved significantly. Compared to the pin-compatible ESP32 NodeMCU module, the received power at a distance of about 1m is -25dBm (3µW) instead of -45dBm (0.03µW). That is 100 times greater. At a greater distance, -62dBm (631pW) was measured for the DevKit C V4 and -69dbm(126pW) for the NodeMCU, i.e. five times.


22 inputs/outputs as well as 4 inputs are led out and usable for applications. 5V from the USB bus is available at the 5V connection. An external supply with a maximum of 9V can also be provided via this connection. The 3.3V connector is connected to the output of the built-in voltage regulator and must not be used as input!

A disadvantage of this module is its width. If it is used with a breadboard, only the pins on one side are available. It is better to plug two breadboards together like on the picture.


ESP32 Nodemcu

This module is pin compatible with the DevKit C V4. The older board has worse antenna radiation properties and uploading the programs sometimes causes problems.

22 inputs/outputs and 4 inputs are out and usable for applications. At the 5V connector 5V from the USB bus is available. An external supply with a maximum of 9V can also be provided via this port. The 3.3V connector is connected to the output of the built-in voltage regulator and must not be used as input!

This module is also too wide for simple breadboards.


ESP32 Lolin Lolin32

This module does not use the WROOM32 module with built-in flash memory, but has the ESP32 chip, the 4MByte flash memory and the antenna directly on the board. This made it possible to reduce the width by one grid dimension.

So this module can be used directly on a simple breadboard. Another advantage of this module is the built-in charge controller for 3.7V LiPo batteries. There is a JST 2.0 mm socket on the module for connecting a battery.

However, the module also has disadvantages. There is no 5V connector and power can only be supplied via USB or a battery. There are also fewer connectors out. There are 19 inputs/outputs and 4 inputs. One LED installed on the module can be controlled via GPIO22.


ESP32 NodeMCU with OLED display and LoRa

This module also has a 0.96 inch OLED display with 128x64 pixels and a 433 MHz LoRa transceiver. LoRa (Long Range) is a transmission method that can bridge large distances (up to 10km) with low transmission power. This is achieved by the patented "Chirp Spread Spectrum Modulation Technology". Special transmitters and receivers are required. Since the module is supported by the ESP32 WiFi, this module is particularly suitable as a gateway between LoRa and the Internet.

The module has 22 inputs/outputs, but nine of them are used for LoRa and OLED display. There are an additional six inputs. The module also has a charge controller for a 3.7 V LiPo battery. A JST 1.25 mm socket is built in for connection. With USB connected, there is 5V at the 5V connector and a connected battery will be charged. Without USB connection, the 5V connector can be used to power and charge the battery. Input voltage 4.5 to 7 V. 

Danger! Never connect an external supply voltage if there is a USB connection!


ESP32 CAM module

The special feature of this module is the connection for a camera, an additional 4MB PseudoStatic RAM and a SD card reader. Also a bright white LED for illumination is built in and can be controlled via GPIO04. The microcontroller used in this module operates at 160MHz. The included 2MPixel camera can be taped to the SD card reader using double stick tape, for example. There are only connectors out, which were not used internally. The power is supplied via the 5V connector.

This connector is the input of a voltage regulator, which regulates the internal supply voltage to 3.3V. Voltages between 4.5 and 7V can be applied to the 5V connector. Unfortunately, the module has no USB port and must therefore be programmed via a USB to serial adapter.


ESP32 Wroom32 with adapter board

This is a naked WROOM32 module that can be soldered on an adapter board with two double row pin headers and two push buttons. All available connections are routed to the pin headers. Programming must be done with a USB to serial adapter. A 3.3 V power supply is required. Because of the double row headers the module is not suitable for use with breadboards.


Compilation of the pin assignment of all modules

Controller:

A ESP32 Devkit C V4 or ESP32 Nodemcu
B ESP32 Lolin Lolin32
C ESP32 Nodemcu with OLED DISFORG and LORA
D ESP32 cam
E ESP32 Wroom module

USB to serial converter

X CP2102
Y CH340

connection

A

B

C

D

E

Gnd

2

1

3

3

2

3.3V output

1

1

2

2

-

5V supply

1

-

2

1

-

3.3V supply

-

-

-

-

1

USB

X

Y

X

-

-

Battery connection

-

1

1

-

-

Reset input

1

1

1

-

1

GPIO0, ADC2/CH1, Touch1, RTCIO11

1

1

1

1

1

U0/TX, GPIO1

1

-

1

1

1

GPIO2, ADC2/CH2, Touch2, RTCIO12, HSPI/WP, SD/D0

1

1

1

1

1

U0/RX, GPIO3

1

-

1

1

1

GPIO4, ADC2/CH0, Touch0, RTCIO10, HSPI/HD, SD/D1

1

1

*

1

1

GPIO5, VSPI/CS0

1

1

*

-

1

Flash CLK, GPIO6

*

-

-

-

*

Flash D0, GPIO7

*

-

-

-

*

Flash D1, GPIO8

*

-

-

-

*

Flash D2, GPIO9

*

-

-

-

*

Flash D3, GPIO10

*

-

-

-

*

Flash cmd, gpio11

*

-

-

-

*

GPIO12, ADC2/CH5, Touch5, RTCIO15, HSPI/Q, SD/D2

1

1

1

1

1

GPIO13, ADC2/CH4, Touch4, RTCIO14, HSPI/D, SD/D3

1

1

1

1

1

GPIO14, ADC2/CH6, TOUCH6, RTCIO16, HSPI/CLK, SD/CLK

1

1

*

1

1

GPIO15, ADC2/CH3, TOUCH3, RTCIO13, HSPI/CS0, SD/CMD

1

1

*

1

1

GPIO16, U2/RX

1

1

*

1

1

GPIO17, U2/TX

1

1

1

-

1

GPIO18, VSPI/CLK

1

1

*

-

1

GPIO19, U0/CTS, VSPI/Q

1

1

*

-

1

GPIO21, VSPI/HD,

1

-

1

-

1

GPIO22, U0/RTS, VSPI/WP

1

1

1

-

1

GPIO23, VSPI/D

1

1

1

-

1

GPIO25, ADC2/CH8, DAW1, RTCIO6

1

1

1

-

1

GPIO26, ADC2/CH9, DAW2, RTCIO7

1

1

*

-

1

GPIO27, ADC2/CH7, TOUCH7, RTCIO17

1

1

*

-

1

GPIO32, ADC1/CH4, Touch9, RTCIO9

1

1

1

-

1

GPIO33, ADC1/CH5, Touch8, RTCio8

1

1

1

-

1

GPI34, ADC1/CH6, RTCI4

1

1

1

-

1

GPI35, ADC1/CH7, RTCI5

1

1

1

-

1

VP, GPI36, ADC1/CH0 with preamplifier, RTCI0

1

1

1

-

1

C-VP, GPI37, ADC1/CH1 with preamplifier, RTCI1

-

-

1

-

-

C-VN, GPI38, ADC1/CH2 with preamplifier, RTCI2

-

-

1

-

-

VN, GPI39, ADC1/CH3 with preamplifier, RTCI3

1

1

1

-

1


*The connection is led, but is used internally
- the connection is not led

Esp-32Produktvorstellungen

18 comments

Andreas Wolter

Andreas Wolter

@Robert: ESP32 WROOM32-D ist ein SMD Modul von Espressif. Es enthält die CPU, Flash Speicher, Schnittstellen, etc.
Es wird normalerweise auf die Entwicklungsboards gelötet. Damit hat man dann auch den USB-Anschluss zur Verfügung, um den Mikcrocontroller über den PC zu programmieren.

Grüße,
Andreas Wolter
AZ-Delivery Blog

Robert

Robert

Und was bedeutet ESP32 WROOM32-D ? Da sollte ja auch ein USB drauf sein

Andreas Wolter

Andreas Wolter

@marc: einige der ESP32 Entwicklungsboards (wie das Devkit C V4) haben keine built-in LED verbaut. Die LED, die leuchtet, ist die Power-LED.

Grüße,
Andreas Wolter
AZ-Delivery Blog

marc

marc

ist es richtig, dass die led auf dem neuen wroom board mit überstehender antenne nicht mehr geschaltet werden kann und immer leuchtet?

Andreas Wolter

Andreas Wolter

@KG: ich nehme an, dass Sie den Strom meinen. Nach meinen Recherchen ist der Maximalstrom am 3.3V Pin 50 mA. An den GPIO Pins sind es 40mA. Wenn Sie die Leistung meinen, kann man das daraus nun berechnen mit P = U * I.

https://components101.com/microcontrollers/esp32-devkitc

Grüße,
Andreas Wolter
AZ-Delivery Blog

KG

KG

Wie hoch darf die Belastung am 3,3V Abschluss der Boards sein?

Rudolf Widmer-Schnidrig

Rudolf Widmer-Schnidrig

Hallo,
ich habe ein neues Heltec LoRa 32 V2 Modul und frage mich wie das Coax-Antennenkabel an das Board angeschlossen wird. Bevor ich zuviel Kraft anwende wollte ich fragen ob da noch gelötet werden muss oder ob der Stecker einfach nur einschnappen sollte? Welches ist das richtige Werkzeug dafür? Oder reicht Fingerdruck?

Gruß und Dank Rudolf
Andreas Wolter

Andreas Wolter

Wenn Sie in der Arduino IDE unter Werkzeuge → Boards den ESP32 auswählen, sollten die Beispiele für den ESP32 D1 R32 funktionieren. Sie finden sie unter Datei → Beispiele.

Ferdinando Todeschini

Ferdinando Todeschini

Hello, I need to find some program examples related to the D1 R32 Board. You can help me?
Thank you

Peer Geisendorf

Peer Geisendorf

Danke für diesen Artikel. Ich würde mich freuen hier auch noch ein Update zum ESP32 D1 Mini NodeMCU WiFi Modul zu sehen.

Bernd Albrecht

Bernd Albrecht

Hallo, danke für den Vorschlag zur Verlinkung der Bilder mit den Anschlussbelegungen.
Sollte jetzt klappen.

Justin

Justin

Interessanter Artikel! Der Newsletter enttäuscht mich nie!

Michael Klein

Michael Klein

Da ich neu bin finde ich den Blog sehr hilfreich. Gute Infos zum ESP32 , nur die Anschlussbelegung könnte grösser sein , weil man das schlecht erkennen kann. Vielleicht kann mir das einer sagen was ist der Unterschied zwischen ESP32 DevKitC V2 Modell : ESP-Wroom-32 und dem ESP32 NodeMCU Module WLAN WiFi Development Board mit CP2102 (Nachfolgemodell zum ESP8266) – 1x ESP32

Lars

Lars

Hallo Herr Lechner, danke für den hilfreichen Artikel. Allein die Bilder mit den Anschlussbelegungen könnten etwas größer sein (so mit Anklicken für hohe Auflösung).

Wolfgang

Wolfgang

Toller Artikel. Endlich ein guter Überblick. Danke

tzoumaz

tzoumaz

Sehr übersichtlicher, informativer Artikel über den ESP32

Kroon

Kroon

Klasse Artikel, endlich mal eine Übersicht die alle notwendigen Infos zu den ESP-Versionen enthält.
Danke dafür.

Rainer Oberegger

Rainer Oberegger

Ich bin letztens (unter PlatformIO) gescheitert die Partitionierung zu Ändern, das wäre doch eine feine Fortsetzung dieses sehr informativen Blogs

Leave a comment

All comments are moderated before being published

Recommended blog posts

  1. ESP32 jetzt über den Boardverwalter installieren - AZ-Delivery
  2. Internet-Radio mit dem ESP32 - UPDATE - AZ-Delivery
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1 - AZ-Delivery
  4. ESP32 - das Multitalent - AZ-Delivery