Rectronx Circuits
Back to Blog
Components3 min read2026-07-28

Best ESP32 Pins for DHT11, OLED, Relay, GPS and Common FYP Modules

Practical ESP32 pin choices for DHT11, OLED SSD1306, relay modules, GPS NEO-6M, MQ sensors and Blynk or Firebase IoT projects.

R

Rectronx

2026-07-28

ESP32 microcontroller development board for IoT projects

Most ESP32 student projects use the same few modules: DHT11 or DHT22, OLED display, relay, GPS, MQ gas sensor and cloud dashboard. The project becomes easier when the pin choices are predictable.

Use the Rectronx ESP32 Pinout Tool beside this guide. You can search a GPIO, click the pin and copy a direct pin link for your wiring plan.

DHT11 or DHT22 Sensor

For DHT11 or DHT22, use a normal digital GPIO. Good choices include:

  • GPIO4
  • GPIO16
  • GPIO17
  • GPIO23

Many examples use GPIO4, and it usually works. If your project has boot problems or many modules, GPIO16, GPIO17 or GPIO23 are also clean choices.

Basic wiring:

DHT pinESP32
VCC3.3V
GNDGND
DATAGPIO4 or another selected GPIO

Some bare DHT sensors need a pull-up resistor on the data line. Many DHT modules already include it.

OLED SSD1306 Display

Most 0.96 inch OLED SSD1306 modules use I2C. The common ESP32 I2C pins are:

OLED pinESP32
SDAGPIO21
SCLGPIO22
VCC3.3V
GNDGND

ESP32 can route I2C to other pins, but GPIO21 and GPIO22 match many examples, so debugging is easier.

Relay Module

For a relay input signal, use a stable output-capable GPIO such as:

  • GPIO18
  • GPIO19
  • GPIO23
  • GPIO25
  • GPIO26
  • GPIO27

Do not use GPIO34 to GPIO39 because they are input-only. Do not drive a relay coil directly from a GPIO pin. Use a relay module with proper transistor/driver circuitry and power the load safely.

GPS NEO-6M

GPS modules use UART. A practical ESP32 choice is UART2:

GPS pinESP32
GPS TXGPIO16 RX2
GPS RXGPIO17 TX2
VCCCheck module requirement
GNDGND

This keeps GPS away from GPIO1 and GPIO3, which are used by USB serial programming and logs.

MQ Gas Sensor Analog Output

If your MQ sensor module gives analog output and the ESP32 also uses WiFi, choose ADC1:

  • GPIO32
  • GPIO33
  • GPIO34
  • GPIO35
  • GPIO36
  • GPIO39

GPIO32 and GPIO33 are easier because they are not input-only. Avoid ADC2 analog readings when WiFi is active.

Blynk, Firebase, MQTT or HTTP Projects

Any online ESP32 project uses WiFi. That means analog sensor pins need extra care. Use ADC1 for analog readings and keep boot pins clear where possible.

For fast checking, use the ESP32 Pinout Tool and copy the safe pin list before you wire the prototype.

Need Help With Your FYP?

We've helped hundreds of students complete their projects on time. Get a free quote today.

Chat with Rectronx