Daily Archives: December 31, 2018

ESP32 Hardware Serial2 Example

There are three serial ports on the ESP32 known as U0UXD, U1UXD and U2UXD all work at 3.3V TTL Level. There are three hardware supported serial interfaces on the ESP32 known as UART0, UART1 and UART2. Like all peripherals, the pins for the UARTs can be logically mapped to any of the available pins on the ESP32. However, the UARTs can also have direct access which marginally improves performance. The pin mapping table for this hardware assistance is as follows.

UART RX IO TX IO CTS RTS
UART0 GPIO3 GPIO1 N/A N/A
UART1 GPIO9 GPIO10 GPIO6 GPIO11
UART2 GPIO16 GPIO17 GPIO8 GPIO7

Having said that, the UART drivers that I recommend to use don’t have this level of optimization built into them and as a result, you are pretty much free to use any pins you choose. Continue reading ESP32 Hardware Serial2 Example

ESP32 Capacitive Touch Pad Example

Introduction

A touch-sensor system is built on a substrate which carries electrodes and relevant connections under a protective flat surface. When a user touches the surface, the capacitance variation is triggered and a binary signal is generated to indicate whether the touch is valid.

ESP32 can provide up to 10 capacitive touch pads / GPIOs. The sensing pads can be arranged in different combinations (e.g. matrix, slider), so that a larger area or more points can be detected. The touch pad sensing process is under the control of a hardware-implemented finite-state machine (FSM) which is initiated by software or a dedicated hardware timer.

Continue reading ESP32 Capacitive Touch Pad Example

ESP32 PWM Example

This ESP32 PWM example explains how to use the Pulse Width Modulation (PWM) with the ESP32-WROOM32 DevKit.

ledcWrite(pinChannel, dutyCycle);
ESP32 can generate PWM on all IO pins. In the ESP32 analogWrite will not work, is different than the Arduino Uno. ESP32 uses 8, 10, 12, 15-bit resolution for PWM generation PWM value. Arduino Uses 8-Bit Resolution i.e.PWM range is 0-254.

Continue reading ESP32 PWM Example

ESP32 DevKit ESP32-WROOM GPIO Pinout

Introduction

ESP32-WROOM-32 is a powerful, generic Wi-Fi+BT+BLE MCU module that targets a wide variety of applications, ranging from low-power sensor networks to the most demanding tasks, such as voice encoding, music streaming and MP3 decoding.

ESP32 LED Blink Example
At the core of this module is the ESP32-D0WDQ6 chip*. The chip embedded is designed to be scalable and adaptive. There are two CPU cores that can be individually controlled, and the CPU clock frequency is adjustable from 80 MHz to 240 MHz. The user may also power off the CPU and make use of the low-power co-processor to constantly monitor the peripherals for changes or crossing of thresholds. ESP32 integrates a rich set of peripherals, ranging from capacitive touch sensors, Hall sensors, SD card interface, Ethernet, high-speed SPI, UART, I2S and I2C.

For more details Read ESP32-WROOM32 Data sheet

Continue reading ESP32 DevKit ESP32-WROOM GPIO Pinout