WROOM ESP32 dev doard is a powerful Arduino compatible board with Wi-Fi, Bluetooth. Adafruit HUZZAH32 ESP32 Feather boards are not hugely different from core hardware point except the automatic bootloader reset and Lithium Ion/Polymer charger and Pin outs will not match. This is a general purpose guide for pin identification, required changes in Blink like examples of official Arduino. In earlier guides, we have described how to setup the software part to use ESP32 with Arduino IDE. That part probably most “difficult”. We faced no problem to re-write some codes to connect with IBM Watson IoT platform. But, not always we will be using ESP32 for IoT purposes. WROOM ESP32 dev doards are really good alternative to official Arduino boards. ESP32 gives entry to wider tools, apart from Arduino IDE. As example, to blink the onboard LED, we need to change the default blink sketch to :
1 2 3 4 5 6 7 8 9 10 11 12 13 | #define LED 2 void setup() { // Set pin mode pinMode(LED,OUTPUT); } void loop() { delay(500); digitalWrite(LED,HIGH); delay(500); digitalWrite(LED,LOW); } |
We are used with onboard LED on Pin 13 in case of Arduino IDE.
ESP32 as Arduino : Hardware Part
ESP32 is more sensitive than Arduino UNO. Slight maturity than newbie Arduino UNO user required in circuit designing. ESP32 is small in size (also cheap and powerful) and that makes it suitable to include directly in to real projects. WROOM ESP32 dev doard definitely looks complex to a newbie when compared to Arduino UNO. Keep in mind – this board supports only 3.3v modules, not the 5v modules of Arduino IDE. Also the board draws huge current. So it is practical to use some steady regulated voltage to power the external components using solutions such power supply to breadboard or DIY benchtop powersupply using PC power supply. In such setup, you need to common the ground of external power supply, ESP32 and the device which you are powering. It is practical to add 10K Ohm resistors at each end of the ground before connecting to ESP32’s ground.
---
WROOM ESP32 dev doard has internal temperature sensor, hall sensor, DAC, few capacitive touch sensor pins, SPI, I2C, I2S Audio. WROOM ESP32 dev doard has untested features. Coming to the Pin outs, which probably confusing to many of the users used with Arduino UNO.
The micro USB jack is used to connect the ESP32 to our computer through a USB cable. The EN button is the reset button of the ESP module to reset the code running on the ESP module. Boot button is used to upload the Program from Arduino to the ESP module (ESP enters into firmware uploading mode). The Red LED on the board is used to indicate the power supply. The Blue LED on the board is connected to the GPIO pin. The I/O pin of the module are capable of Digital Read/Write, Analog Read/Write, PWM, IIC, SPI, DAC etc. ESP32 has only 5 input pins.
If your ESP32 looks like the below illustration and Pin numbers on board matches then it is probably DO IT v1 clone. You can easily work with this illustration :
Input Only Pins
- GPIO 34
- GPIO 35
- GPIO 36
- GPIO 39
Pins with internal pull up
- GPIO14
- GPIO16
- GPIO17
- GPIO18
- GPIO19
- GPIO21
- GPIO22
- GPIO23
Pins without internal pull up
- GPIO13
- GPIO25
- GPIO26
- GPIO27
- GPIO32
- GPIO33
Analog Input Pins
- ADC1_CH0
- ADC1_CH3
- ADC1_CH4
- ADC1_CH5
- ADC1_CH6
- ADC1_CH7
Capacitive touch sensor connected Pins
- 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)
DAC Pins
- DAC1 (GPIO25)
- DAC2 (GPIO26)
RTC Pins
- 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)
PWM Pins
All pins which can act as outputs (34 to 39 can not generate PWM)
Serial Pins
- GPIO3 (U0RXD)
- GPIO1(U0TXD)
- GPIO16 (U2RXD)
- GIIO17 (U2TXD)
I2C Pins
- GPIO 21 (SDA)
- GPIO 22 (SCL)