NodeMCU ESP32S Kit ENG
NodeMCU ESP32S Kit ENG
Thank you for purchasing our AZ-Delivery NodeMCU ESP32S Kit. On the
following pages, we will introduce you to how to use and set-up this handy
device.
Have fun!
Table of Contents
Introduction....................................................................................................3
Specifications................................................................................................4
ESP32S Kit....................................................................................................5
Pinout............................................................................................................6
Input / Ouput pins description........................................................................7
Capacitive Touch sensor pins....................................................................8
Analog to Digial converter pins..................................................................9
Digital to Analog converter pins.................................................................9
Real Time Clock GPIO pins.....................................................................10
PWM (Pulse Width Modulation) pins........................................................11
The I2C interface pins..............................................................................11
SPI interface pins.....................................................................................12
Strapping Pins.........................................................................................12
Pins HIGH at Boot...................................................................................13
Enable (EN).............................................................................................13
USB to Serial communication......................................................................14
WiFi Communication...................................................................................15
Bluetooth Communication...........................................................................16
Antenna connection.....................................................................................17
Other features..............................................................................................18
How to set-up Arduino IDE..........................................................................19
Additional setup.......................................................................................23
NodeMCU ESP32S Kit wiring example.......................................................27
Sketch examples.....................................................................................28
-2-
Introduction
-3-
Specifications
-4-
ESP32S Kit
The NodeMCU ESP32S Kit series is affordable Wi-Fi module suited for DIY
projects in the Internet of Things (IoT) field. This module comes with many
GPIOs and support for a variety of protocols like SPI, I2C, I2S, UART, and
more. The best part is that it comes with wireless networking included,
which makes it different to other well known micro controllers. This means
that it can easily control and monitor devices remotely via Wi-Fi and
Bluetooth® at an affordable price.
The processor core, called LX6, is based on Xtensa® dual-core 32-bit LX6
processor controller and runs at frequency range between 80-240MHz. It
has a 448kB boot ROM, 520kB of on-chip SRAM, and up to 16MB of
external flash memory which can be accessed through SPI interface.
Vendors have consequently created many compact PCB modules based
around the ESP32S chip. Some of these modules have specific identifiers.
-5-
Pinout
The NodeMCU ESP32S Kit has 38 pins. The pinout is shown on the
following image:
For detailed pinout description and I/O capabilities, please refer to the
datasheet which can be found on the following link.
NOTE: The absolute maximum current drawn per one GPIO is 40mA
according to the “Recommended Operating Conditions” section in the
ESP32 datasheet.
-6-
Input / Output pins description
Just like a normal ATMega board, the NodeMCU ESP32S Kit has digital
input/output pins (GPIO pins - General Purpose Input/Output pins). These
digital input/outputs operate at 3.3V.
The pins are not 5V tolerant, applying more than 3.3V on any pin will
destroy the chip.
The GPIO pins 34 to 39 are GPIs – input only pins and these pins do not
have internal pull-ups or pull-down resistors. They cannot be used as
outputs, so use these pins only as inputs: GPIO 34, GPIO 35, GPIO 36,
GPIO 39
There is an integrated SPI flash on the ESP32S chip. The pins GPIO6 to
GPIO 11 are exposed in certain ESP32 development boards. These pins
are connected to the integrated SPI flash on the chip and are not
recommended for other uses.
In essence, if not used for specific interfaces, following GPIOs are available
for your project, even with both, pull-up or pull-down resistors: GPIOs 0, 2,
4, 5, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33.
-7-
Capacitive Touch sensor pins
The ESP32 has 10 internal capacitive touch sensors. The capacitive touch
pins can also be used to wake up the ESP32 from deep sleep. These
internal touch sensors are connected to these GPIOs: T0 (GPIO 4), T1
(GPIO 0), T2 (GPIO 2), T3 (GPIO 15), T4 (GPIO 13), T5(GPIO 12), T6
(GPIO 14), T7 (GPIO 27), T8 (GPIO 33), T9 (GPIO 32).
-8-
Analog to Digial converter pins
The ESP32 has 18x12 bits ADC (Analog to Digital converter) input channels
(while the ESP8266 only has 1x10 bits ADC). These are the GPIOs that can
be used as ADC and respective channels:
ADC1_CH0 (GPIO 36), ADC1_CH1 (GPIO 37), ADC1_CH2 (GPIO 38),
ADC1_CH3 (GPIO 39), ADC1_CH4 (GPIO 32), ADC1_CH5 (GPIO 33),
ADC1_CH6 (GPIO 34), ADC1_CH7 (GPIO 35), ADC2_CH0 (GPIO 4),
ADC2_CH1 (GPIO 0), ADC2_CH2 (GPIO 2), ADC2_CH3 (GPIO 15),
ADC2_CH4 (GPIO 13), ADC2_CH5 (GPIO 12), ADC2_CH6 (GPIO 14),
ADC2_CH7 (GPIO 27), ADC2_CH8 (GPIO 25), ADC2_CH9 (GPIO 26).
There are 2x8 bits DAC (Digital to Analog converter) channels on the
ESP32 to convert digital signals into analog voltage signal outputs.
These are the DAC channels: DAC1 (GPIO25), DAC2 (GPIO26).
-9-
Real Time Clock GPIO pins
There is RTC (Real time clock) GPIO support on the ESP32. The GPIOs
routed to the RTC low-power subsystem can be used when the ESP32 is in
deep sleep. These RTC GPIOs can be used to wake up the ESP32 from
deep sleep when the Ultra Low Power (ULP) co-processor is running. The
following GPIOs can be used as an external wake up source: RTC_GPIO0
(GPIO36), RTC_GPIO3 (GPIO39), RTC_GPIO4 (GPIO34), RTC_GPIO5
(GPIO35), RTC_GPIO6 (GPIO25), RTC_GPIO7 (GPIO26), RTC_GPIO8
(GPIO33), RTC_GPIO9 (GPIO32), RTC_GPIO10 (GPIO4), RTC_GPIO11
(GPIO0), RTC_GPIO12 (GPIO2), RTC_GPIO13 (GPIO15), RTC_GPIO14
(GPIO13), RTC_GPIO15 (GPIO12), RTC_GPIO16 (GPIO14), RTC_GPIO17
(GPIO27).
- 10 -
PWM (Pulse Width Modulation) pins
The ESP32 has two I2C channels and any GPIO pin can be set as SDA or
SCL. When using the ESP32 with the Arduino IDE, the default I2C pins are:
GPIO 21 (SDA), GPIO 22 (SCL).
- 11 -
SPI interface pins
Strapping Pins
Following pins are used to put the ESP32 into bootloader or flashing mode:
GPIO 0, GPIO 2, GPIO 4, GPIO 5 (must be HIGH during boot), GPIO 12
(must be LOW during boot), GPIO 15 (must be HIGH during boot).
Most development boards put the pins in the right state for flashing or boot
mode. If some peripherals are connected to the strapping pins and the IDE
is unable to upload the code or flash the ESP32, it may be because those
peripherals are preventing the ESP32 to enter the right mode. After
resetting, flashing, or booting, those pins work as expected. There is Boot
Mode Selection documentation guide on the following link. Further and
more extensive explanations are not in the scope of this eBook so please,
refer to the datasheet or the Esptool documentation on the following link.
- 12 -
Pins HIGH at Boot
Some GPIOs change their state to HIGH or output PWM signals at boot or
reset. This means that if outputs are connected to these GPIOs this may get
unexpected results when the ESP32 resets or boots.
GPIO 1, GPIO 3, GPIO 5, GPIO 6 to GPIO 11 (connected to the ESP32
integrated SPI flash memory - not recommended for use), GPIO 14, GPIO
15.
Enable (EN)
Enable (EN) is the 3.3V regulator’s enable pin. It has a pulled up state and it
needs to be connected to ground to disable the 3.3V regulator. This means
that this pin can be connected to a push button to restart your ESP32, for
example.
- 13 -
USB to Serial communication
The NodeMCU ESP32S Kit has a microUSB connector. It is built around the
CH340 chip, which enables USB to UART serial communication.
The chip has the function of a virtual COM port (VCP), which appears as a
COM port in PC applications. In order to be able to use the ESP32, the
respective driver must be installed.
- 14 -
WiFi Communication
- 15 -
Bluetooth Communication
The NodeMCU ESP32S Kit has an integrated Bluetooth Radio and supports
following features:
• Class-1, class-2 and class-3 transmit output powers and over 30 dB
dynamic control range
• π/4 DQPSK and 8 DPSK modulation
• High performance in NZIF receiver sensitivity with over 98 dB dynamic
range
• Class-1 operation without external PA
• Internal SRAM allows full speed data transfer, mixed voice and data, and
full piconet operation
• Logic for forward error correction, header error control, access code
correlation, CRC, demodulation, encryption bit stream generation, whitening
and transmit pulse shaping
• ACL, SCO, eSCO and AFH
• A-law, µ-law and CVSD digital audio CODEC in PCM interface
• SBC audio CODEC
• Power management for low power applications
• SMP with 128-bit AES
- 16 -
Also, the Bluetooth Radio has support for the following communication
interface protocols:
• UART HCI interface, up to 4Mbps
• SDIO / SPI HCI interface
• I2C interface
• PCM / I2S audio interface.
Antenna connection
In addition to the PCB antenna, the NodeMCU ESP32S Kit has a P.FL
antenna socket.
The jack is too known by the names IPEX, IPAX, IPX, AMC, MHF or UMCC.
To activate this socket, the small resistor (0Ohm/SMD1005) must be
resoldered next to the socket.
The antenna must be a 2.4 GHz PCB antenna with a maximum antenna
gain of 2 dBm.
- 17 -
Other features
ESP32S chip has an integrated Hall Effect Sensor that detects changes in
the magnetic field in its surroundings.
The Hall sensor is based on an N-carrier resistor. When the chip is in the
magnetic field, the Hall sensor develops a small voltage on the resistor,
which can be directly measured by the analog-digital converter (ADC), or
amplified by the ultra low noise analog pre-amplifier and then measured by
the ADC.
- 18 -
How to set-up Arduino IDE
If the Arduino IDE is not installed, follow the link and download the
installation file for the operating system of choice. The Arduino IDE version
used for this eBook is 1.8.19.
For Windows users, double click on the downloaded .exe file and follow
the instructions in the installation window.
- 19 -
For Linux users, download a file with the extension .tar.xz, which has to
be extracted. When it is extracted, go to the extracted directory and open
the terminal in that directory. Two .sh scripts have to be executed, the first
called arduino-linux-setup.sh and the second called install.sh.
To run the first script in the terminal, open the terminal in the extracted
directory and run the following command:
sh arduino-linux-setup.sh user_name
user_name - is the name of a superuser in the Linux operating system. A
password for the superuser has to be entered when the command is
started. Wait for a few minutes for the script to complete everything.
The second script, called install.sh, has to be used after the installation
of the first script. Run the following command in the terminal (extracted
directory): sh install.sh
After the installation of these scripts, go to the All Apps, where the Arduino
IDE is installed.
- 20 -
Almost all operating systems come with a text editor preinstalled (for
example, Windows comes with Notepad, Linux Ubuntu comes with
Gedit, Linux Raspbian comes with Leafpad, etc.). All of these text
editors are perfectly fine for the purpose of the eBook.
Next thing is to check, if your PC can detect an micro controller board. Open
freshly installed Arduino IDE, and go to:
Tools > Board > {your board name here}
{your board name here} should be the Arduino/Genuino Uno, as it can
be seen on the following image:
- 21 -
If the Arduino IDE is used on Windows, port names are as follows:
- 22 -
Additional setup
In order to use NodeMCU ESP32S Kit with Arduino IDE, follow few easy
steps. Before setting the Arduino IDE, the driver for the USB to Serial
communication has to be installed. If the driver is not installed automatically,
there is a support page that contains the drivers for Windows/Mac or Linux
and can be chosen depending on which one is used. Drivers can be
downloaded from the following link.
- 23 -
Next, to install support for the ESP32 platform, open Arduino IDE and go to:
File > Preferences, and find Additional URLs field.
- 24 -
Paste this link in the Additional URLs field. If one or more links are inside
this field, just add one comma after the last link, paste new link after comma
and click the OK button.
- 25 -
To select ESP32 board, go to:
Tools > Board > ESP32 Arduino > ESP32 Dev Module
To upload the sketch code to the ESP32 board, first select port on which
you connected the board. Go to: Tools > Port > {port name}0
- 26 -
NodeMCU ESP32S Kit wiring example
Connect the NodeMCU ESP32S Kit with an LED and resistor as shown on
the following connection diagram:
- 27 -
Sketch examples
Blinking LED
int ledPin = 2;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
- 28 -
PWM - Pulse Width Modulation
#define LEDC_CHANNEL_0 0
#define LEDC_TIMER_13_BIT 13
#define LEDC_BASE_FREQ 5000
#define LED_PIN 2
int brightness = 0;
int fadeAmount = 5;
void setup() {
ledcSetup(LEDC_CHANNEL_0, LEDC_BASE_FREQ, LEDC_TIMER_13_BIT);
ledcAttachPin(LED_PIN, LEDC_CHANNEL_0);
}
void loop() {
ledcAnalogWrite(LEDC_CHANNEL_0, brightness);
brightness = brightness + fadeAmount;
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
}
- 29 -
Now it is the time to learn and make your own projects. You can do that with
the help of many example scripts and other tutorials, which can be found on
the Internet.
https://az-delivery.de
Have Fun!
Impressum
https://az-delivery.de/pages/about-us
- 30 -