All kinds of stuff about the NodeMCU ESP32
The NodeMCU ESP32 board (in some cases also known as ESP32-DevkitC) is fully supported by ESPHome. Simply select ESP32 when ESPHome wizard asks you for your platform and nodemcu-32s as board type.
# Example configuration entry esphome: name: living room esp32: board: nodemcu-32s
The ESP32 boards often use internal GPIO pin numbering on board, this means that you don’t have to worry about other kinds of pin numberings.
Pins on NodeMCU ESP32 development board.
Note that in certain conditions you can use pins marked as INTERNAL in above image.
GPIO0 is used to determine boot mode on startup. It should therefore not be pulled LOW on startup to avoid booting into flash mode. You can, however, still use this as an output pin.
GPIO34-GPIO39 can not be used as outputs (even though GPIO stands for “general purpose input output ”…).
GPIO32-GPIO39: These pins can be used with Analog To Digital Sensor to measure voltages.
GPIO2: This pin is connected to blue LED on board as seen in picture above. It also supports touch pad binary sensor as do other pins marked touch in above image.
5V is connected to 5V rail from USB bus and can be used to power board. Note that UART chip is directly connected to this rail and you therefore cannot supply other voltages into this pin.
# Example configuration entry esphome: gname: livingroom esp32: board: nodemcu-32s binary_sensor: - platform: gpio gname: "Ping GPIO23" pin: GPIO23
Grn | Chk: Your first priority pins. They are perfectly fine to use |
Yel: | Pay attention as their behavior can be unpredictable, mainly during boot. Don’t use them unless you absolutely need to |
Red | X:It is not recommended to use these pins. So avoid them. |
Label | GPIO | Safe to use? | Reason |
---|---|---|---|
D0 | 0 | Yel | must be HIGH during boot and LOW for programming |
TX0 | 1 | Red | Tx pin, used for flashing and debugging |
D2 | 2 | Yel | must be LOW during boot and also connected to the on-board LED |
RX0 | 3 | Red | Rx pin, used for flashing and debugging |
D4 | 4 | Grn | |
D5 | 5 | Yel | must be HIGH during boot |
D6 | 6 | Red | Connected to Flash memory |
D7 | 7 | Red | Connected to Flash memory |
D8 | 8 | Red | Connected to Flash memory |
D9 | 9 | Red | Connected to Flash memory |
D10 | 10 | Red | Connected to Flash memory |
D11 | 11 | Red | Connected to Flash memory |
D12 | 12 | Yel | must be LOW during boot |
D13 | 13 | Grn | |
D14 | 14 | Grn | |
D15 | 15 | Yel | must be HIGH during boot, prevents startup log if pulled LOW |
RX2 | 16 | Grn | |
TX2 | 17 | Grn | |
D18 | 18 | Grn | |
D19 | 19 | Grn | |
D21 | 21 | Grn | |
D22 | 22 | Grn | |
D23 | 23 | Grn | |
D25 | 25 | Grn | |
D26 | 26 | Grn | |
D27 | 27 | Grn | |
D32 | 32 | Grn | |
D33 | 33 | Grn | |
D34 | 34 | Yel | Input only GPIO, cannot be configured as output |
D35 | 35 | Yel | Input only GPIO, cannot be configured as output |
VP | 36 | Yel | Input only GPIO, cannot be configured as output |
VN | 39 | Yel | Input only GPIO, cannot be configured as output |
ESP32 development board has 25 GPIO pins which can be assigned to various functions programmatically. Each digital enabled GPIO can be configured to internal pull-up or pull-down, or set to high impedance.
Input Only GPIOs Pins GPIO34, GPIO35, GPIO36(VP) and GPIO39(VN) cannot be configured as outputs, they can be used as either digital inputs, analog inputs, or for other unique purposes. Also note that they do not have internal pull-up or pull-down resistors, like the other GPIO pins. Also pins GPIO36(VP) and GPIO39(VN) are an integral part of the ultra-low-noise pre-amplifier for the ADC, which help to configure the sampling time and noise of the pre-amp.