ESP32 wiring: GPIO, 3.3 V and pull-ups
Wire an ESP32-C6 safely: 3.3 V logic, pins to avoid, pull-ups, LED resistor, common ground and a quick test.
Getting started
Home Assistant
Buying
Wire an ESP32-C6 safely: 3.3 V logic, pins to avoid, pull-ups, LED resistor, common ground and a quick test.

Wiring an ESP32, a small electronic board with Wi-Fi, means following a few simple rules, but ignoring just one is enough to burn out a pin or get unstable readings. This tutorial gathers the basics used by the site’s ESP32 projects, with the ESP32-C6-DevKitC-1 as the reference board. You will learn what GPIOs are, the metal pins lined up along the edge of the board, how to pick the right one, and how to connect a button and an LED safely.
Expected result: knowing how to pick a pin, wire a button and an LED safely, and test the build with ESPHome. Time: 30 minutes. Difficulty: beginner.

The pin labels along both edges of this ESP32-C6-DevKitC-1 are the GPIOs this tutorial assigns. Those pins work at 3.3 V.
The ESP32-C6’s GPIO pins work at 3.3 V and do not tolerate 5 V. Wiring a sensor’s 5 V output straight to an input can damage it. Two fixes: power the sensor at 3.3 V if it accepts that, or bring its signal down with a level shifter or a voltage divider (two resistors, for example 10 kΩ and 20 kΩ to go from 5 V to about 3.3 V).
Each pin supplies only limited current: aim for about ten milliamps at most and never exceed the Espressif datasheet values. For a heavier load (relay, LED strip, motor), use a module designed for it, powered separately, with a common ground to the microcontroller.
| Pins | Note | Suggested use |
|---|---|---|
| GPIO0 to GPIO3, GPIO6, GPIO7, GPIO10, GPIO11, GPIO18 to GPIO23 | Free at boot | Inputs, outputs, I²C, UART |
| GPIO0 to GPIO6 | Can read an analog voltage (ADC) | Analog probes |
| GPIO4, GPIO5, GPIO8, GPIO9, GPIO15 | Boot configuration pins; GPIO8 drives the board’s RGB LED, GPIO9 is the BOOT button | Avoid, or use with care |
| GPIO12, GPIO13 | Native USB link | Leave free |
| GPIO16, GPIO17 | Serial console (UART0) | Leave free |
This list follows Espressif’s board documentation; check it for another board (XIAO ESP32C6, for instance), whose pins carry other numbers.
An input connected to nothing “floats” and reads random values. A pull-up resistor holds it at a known level. The ESP32 has internal resistors you can enable in ESPHome:
binary_sensor:
- platform: gpio
name: "Test button"
pin:
number: GPIO10
mode: INPUT_PULLUP # high level at rest
inverted: true # press = ON
filters:
- delayed_on: 50ms # debounce
- delayed_off: 50ms
The button sits between GPIO10 and GND: at rest the pin reads 3.3 V, pressed it reads 0 V. The internal resistors are fairly weak; for a cable longer than a few metres, add an external 10 kΩ resistor to 3V3.
An LED without a resistor draws too much current. The maths is simple: R = (3.3 V − LED voltage) ÷ wanted current. For a red LED of about 2 V at 5 mA: (3.3 − 2) ÷ 0.005 = 260 Ω, so a 330 Ω resistor fits. Wire GPIO18 → resistor → anode (long leg) → cathode → GND.
output:
- platform: gpio
pin: GPIO18
id: led_out
light:
- platform: binary
name: "Test LED"
output: led_out
These two snippets were not run on a board for this article; they follow the standard syntax from the ESPHome documentation.
scan: true option lists them.Check: in Home Assistant, “Test button” turns “on” when you press, and “Test LED” lights the LED.
| Symptom | Likely cause | Fix |
|---|---|---|
| The board no longer boots after a wiring change | A component pulls a boot-configuration pin | Unplug GPIO4, 5, 8, 9 or 15, or change pin |
| Input changes by itself | Floating pin or long cable | Internal or external pull-up, shorter cable |
| LED very dim or off | Reversed polarity or resistor too large | Flip the LED, try 220 to 330 Ω |
| Unstable analog values | Noisy supply or non-ADC pin | Use GPIO0 to GPIO6, add a median filter |
| A component is hot | Short circuit or wrong polarity | Unplug immediately and recheck |
To go further: flash a board and update without a cable. Official documentation: ESP32-C6-DevKitC-1, Espressif.
Updated on 30 October 2026. Check your board’s pin numbers before any wiring.
Was this page helpful?
Thank you!
What should we improve?
Torn between two models or stuck on a build? Drop us a line and we will get back to you by email.
Cookies and analytics
We use Google Analytics 4 to understand how the site is used (page views, navigation). It is only switched on if you accept. Declining does not stop you using the site. More: cookie settings and privacy policy (in French).