ESP32-DevKitC V4, 38 pin pinout
ESP32 board. Pick ESP32 Dev Module in the Arduino IDE. 13 of its header GPIOs are free of boot, flash and USB duties.
ESP32
3V3
GND
EN
23
VP
22
VN
TX
34
RX
35
21
32
GND
33
19
25
18
26
5
27
17
14
16
12
4
GND
0
13
2
D2
15
D3
D1
CMD
D0
5V
CLK
Pins tested on hardware
| Use | Pins |
|---|---|
| I2C | SDA 21 / SCL 22 |
| One-wire or DHT data | GPIO 4 |
| BOOT button | GPIO 0 |
Field notes
- GPIO 34, 35, VP (36) and VN (39) are input only and have no pull-ups.
- GPIO 0, 2, 12 and 15 are strapping pins. Keep loads off them at boot.
- D0 to D3, CMD and CLK are wired to the flash chip. Leave them unconnected.
- The DevKitC V4 has no user LED. Many 30-pin clones put one on GPIO 2.
Analog and Wi-Fi
Wi-Fi uses ADC2. While Wi-Fi is on, analogRead() on ADC2 pins fails, so use ADC1 pins (GPIO 32 to 39) for anything you read with Wi-Fi running.
Every pin
Pads in order from the top, with the USB connector at the bottom. Numbers are GPIO numbers, which is what sketches use.
| Pad | Label | GPIO | Can do | Use it? |
|---|---|---|---|---|
| Left 1 | 3V3 | — | — | Power The 3.3 V supply. |
| Left 2 | EN | — | — | Reset The reset pin. |
| Left 3 | VP | 36 | ADC1_CH0, Deep-sleep wake, Input only | Input only GPIO 36 can only read. It has no output driver and no pull-ups. |
| Left 4 | VN | 39 | ADC1_CH3, Deep-sleep wake, Input only | Input only GPIO 39 can only read. It has no output driver and no pull-ups. |
| Left 5 | 34 | 34 | ADC1_CH6, Deep-sleep wake, Input only | Input only GPIO 34 can only read. It has no output driver and no pull-ups. |
| Left 6 | 35 | 35 | ADC1_CH7, Deep-sleep wake, Input only | Input only GPIO 35 can only read. It has no output driver and no pull-ups. |
| Left 7 | 32 | 32 | ADC1_CH4, Touch T9, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Left 8 | 33 | 33 | ADC1_CH5, Touch T8, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Left 9 | 25 | 25 | ADC2_CH8, DAC1, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Left 10 | 26 | 26 | ADC2_CH9, DAC2, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Left 11 | 27 | 27 | ADC2_CH7, Touch T7, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Left 12 | 14 | 14 | ADC2_CH6, Touch T6, JTAG MTMS, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Left 13 | 12 | 12 | ADC2_CH5, Touch T5, JTAG MTDI, Deep-sleep wake | Boot pin A strapping pin that sets the flash voltage. Pulled high at reset, the board may not boot. |
| Left 14 | GND | — | — | Power Ground. |
| Left 15 | 13 | 13 | ADC2_CH4, Touch T4, JTAG MTCK, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Left 16 | D2 | 9 | — | Avoid Wired to the flash chip. |
| Left 17 | D3 | 10 | — | Avoid Wired to the flash chip. |
| Left 18 | CMD | 11 | — | Avoid Wired to the flash chip. |
| Left 19 | 5V | — | — | Power The 5 V supply from USB. |
| Right 1 | GND | — | — | Power Ground. |
| Right 2 | 23 | 23 | — | Safe A general-purpose pin with no boot, flash or USB duty. |
| Right 3 | 22 | 22 | — | Safe A general-purpose pin with no boot, flash or USB duty. |
| Right 4 | TX | 1 | UART0 TX | Serial Carries the serial console. Anything wired here fights with flashing and the bench. |
| Right 5 | RX | 3 | UART0 RX | Serial Carries the serial console. Anything wired here fights with flashing and the bench. |
| Right 6 | 21 | 21 | — | Safe A general-purpose pin with no boot, flash or USB duty. |
| Right 7 | GND | — | — | Power Ground. |
| Right 8 | 19 | 19 | — | Safe A general-purpose pin with no boot, flash or USB duty. |
| Right 9 | 18 | 18 | — | Safe A general-purpose pin with no boot, flash or USB duty. |
| Right 10 | 5 | 5 | — | Boot pin SDIO slave timing; harmless for most projects. |
| Right 11 | 17 | 17 | — | Care Used for PSRAM on WROVER modules. Free otherwise. |
| Right 12 | 16 | 16 | — | Care Used for PSRAM on WROVER modules. Free otherwise. |
| Right 13 | 4 | 4 | ADC2_CH0, Touch T0, Deep-sleep wake | Safe A general-purpose pin with no boot, flash or USB duty. |
| Right 14 | 0 | 0 | ADC2_CH1, Touch T1, Deep-sleep wake | Boot pin A strapping pin and the BOOT button. Held low at reset, the chip enters download mode. |
| Right 15 | 2 | 2 | ADC2_CH2, Touch T2, Deep-sleep wake | Boot pin A strapping pin. It must be low or floating at reset for flashing to work. |
| Right 16 | 15 | 15 | ADC2_CH3, Touch T3, JTAG MTDO, Deep-sleep wake | Boot pin A strapping pin. It changes boot messages when low at reset. |
| Right 17 | D1 | 8 | — | Avoid Wired to the flash chip. |
| Right 18 | D0 | 7 | — | Avoid Wired to the flash chip. |
| Right 19 | CLK | 6 | — | Avoid Wired to the flash chip. |
The ESP32 chip
| Feature | Value |
|---|---|
| CPU | Dual-core Xtensa LX6, up to 240 MHz |
| Radio | Wi-Fi 4 (2.4 GHz), Bluetooth Classic and Bluetooth LE 4.2 |
| GPIOs | 34 (GPIO 34 to 39 are input only) |
| Analog in | 18 channels on two 12-bit ADCs |
| Touch | 10 channels |
| Analog out | 2 channels, 8-bit (GPIO 25 and 26) |
| USB | None. Boards use a USB-to-UART bridge chip |
| SRAM | 520 KB |
Projects for this board
- ProbeHarbor probe Prebuilt sensor firmware from the ProbeHarbor project. Flash it from this page, then it finds a temperature sensor by itself and posts a reading every minute.
- Blink and heartbeat Toggle the LED on GPIO 2 and print a tick every second. The first thing to flash on any new board.
- Wi-Fi scanner List nearby networks with signal strength and channel every ten seconds. A quick radio health check.
- I2C bus scanner Probe every address on the I2C bus and report what answers. Run it before trusting any sensor wiring.
- DHT22 climate logger Read temperature and humidity every two seconds and print them as a log line.
- SSD1306 OLED status Drive a 128 by 64 I2C OLED and show an uptime counter. The base for any small status display.
- HC-SR04 distance Measure distance with an ultrasonic sensor. The echo pin is 5 V, so it goes through a divider.
- Deep sleep, button wake Sleep at microamp current and wake on a button press. A boot counter survives in RTC memory.
- Web page LED switch Join your Wi-Fi, serve a one-button page and switch GPIO 2 from any phone on the network.
- Touch piano Turn four bare wires into touch keys. Each touch prints a note, and an optional buzzer plays it.
- ESP-NOW pair Two boards talk directly over the Wi-Fi radio, with no router. Each sends a counter and prints what the other sends.
- NeoPixel effects Drive a strip or stick of WS2812 LEDs through a color wipe, a rainbow and a theater chase.
- Home Assistant temperature Publish a DS18B20 reading over MQTT every 30 seconds. Home Assistant finds the sensor by itself through MQTT discovery.
- Bluetooth LE scanner List nearby Bluetooth LE devices with their signal strength every ten seconds: phones, watches, beacons and sensors.
- Over-the-air updates Upload new firmware over Wi-Fi with ArduinoOTA, so a board in a box on the shelf never needs a USB cable again.
- Battery deep-sleep sensor Wake every five minutes, read a DS18B20 and the battery voltage, then go back to deep sleep. A boot counter survives in RTC memory.
- Relay and servo control Move a hobby servo to any angle and switch a relay module on and off by typing commands on the bench.
- E-paper temperature card Show a DS18B20 reading on a 2.9 inch e-paper panel that keeps its image with the power off, refreshing only when the value changes.
- BME280 web dashboard The board serves its own web page with live temperature, humidity and pressure and a chart that grows every two seconds.
- Wi-Fi setup portal No passwords in the sketch: the board opens its own setup network with a page to pick your Wi-Fi, saves it, and joins it from then on.
- DS18B20 to ProbeHarbor Read a waterproof DS18B20 probe and post the temperature to ProbeHarbor once a minute.
- DS18B20 with Wi-Fi portal The same DS18B20 probe, but Wi-Fi is set from a phone through a captive portal instead of being compiled in.
- Door contact to ProbeHarbor A reed switch on a door. Posts open or shut once a minute and right away when it changes.
- Leak pads to ProbeHarbor Two bare contacts on the floor. Water between them posts a leak, which ProbeHarbor turns into an alert.
- Power sense to ProbeHarbor Report whether a circuit has power. ProbeHarbor raises a power-off alert when it drops and a recovery notice when it returns.
- MAX31855 thermocouple to ProbeHarbor A K-type thermocouple through a MAX31855 amplifier, for temperatures a DS18B20 cannot survive.
- MAX6675 thermocouple to ProbeHarbor The lower-cost MAX6675 thermocouple module, posting a temperature once a minute.
Amazon buy links may include an Associates tag, and this site may earn a commission from qualifying Amazon purchases at no extra cost to you. Adafruit links are direct.