
The ESP32 has more GPIO than an Arduino, but a third of them come with fine print. Strapping pins set boot modes, ADC2 disappears when WiFi runs, and GPIO34-39 are input-only. Wiring blind guarantees a board that boots into the wrong mode.
At a glance: 7 minute guide · part 2 of 10 in the complete IoT and ESP32 guide track · includes a worked example and a quick-reference table.
Strapping pins set boot behaviour
GPIO 0, 2, 5, 12 and 15 configure flash/boot modes at reset. Held in the wrong state by your external circuit a pull-down on GPIO0, say the board enters bootloader or boot-loops. Use them for outputs only after boot, never for switches that ground at reset.
| P | i | n | ( | s | ) | ||
|---|---|---|---|---|---|---|---|
| S | t | a | t | u | s | ||
| S | a | f | e | u | s | e | |
| GPIO 0, 2, 5, 12, 15 | Strapping boot modes | Outputs only, careful with pulls | |||||
| GPIO 34-39 | Input only | Sensors, buttons, ADC1 | |||||
| ADC2 group | Blocked by WiFi | Avoid for analog while wireless | |||||
| GPIO 21/22 | I2C default | Bus pins | |||||
| GPIO 18/19/23 | SPI default | Bus pins |
Input-only and WiFi-shared pins
What this means at the bench. GPIO 34, 35, 36, 39 read but cannot drive perfect for sensors and potentiometers, useless for LEDs. ADC2 pins (GPIO 0, 2, 4, 12-15, 25-27) cannot be read while WiFi is active the number one "analogRead returns garbage with WiFi on" cause.
A safe-pin shortlist
GPIO 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33 behave conventionally. Reserve 21/22 for I²C and 18/19/23 for SPI duties. Everything else is fair game for general I/O in most builds.
How to apply this in your build
Work through the sequence below each step assumes the previous one passed. For numbers that need calculating, the linked tools at the end of this guide do the arithmetic instantly.
- Mark strapping pins on your pinout printout first
- Assign sensors to ADC1 pins (32-39) if WiFi is used
- Keep I²C/SPI default pins for their buses
- Check each external circuit does not pull strapping pins at reset
Worked example
A project with a button wired from GPIO0 to ground "randomly" entered flash mode pressing it at reset looked like a bootloader request. Moving the button to GPIO 17 ended the mystery. Run the numbers yourself with the related calculator and the result should agree to within rounding.
Practical note from the bench. Pinout discipline saves hours: highlight strapping pins in one colour and input-only in another on the datasheet printout before wiring anything.
Field mistakes we see again and again
- Buttons or LEDs on strapping pins without checking boot state
- Expecting analogRead on ADC2 while WiFi is connected
- Driving loads from input-only pins
Key takeaways
- Strapping pins set boot behaviour the foundation of this guide; revisit it if any measurement here surprises you.
- Input-only and WiFi-shared pins the foundation of this guide. Revisit it if any measurement here surprises you.
- A safe-pin shortlist the foundation of this guide; revisit it if any measurement here surprises you.
Prerequisites and preparation
Before starting: mark strapping pins on your pinout printout first and assign sensors to adc1 pins (32-39) if wifi is used. Keep a calculator to hand every number in the worked example is reproducible. Total time including the bench steps: about 6-7 minutes.
Who benefits most
Hobbyists meeting this topic for the first time, students who want the version with real numbers instead of abstract symbols. Returning engineers refreshing a corner of the craft. The mistake list alone justifies the visit every entry in it was learned the expensive way.
Quick reference card
| Aspect | Where to find it in this guide |
|---|---|
| Core theory | Strapping pins set boot behaviour |
| Application steps | How to apply this in your build |
| Worked numbers | Worked example |
| Failure modes | Field mistakes we see again and again |
How this fits the complete IoT and ESP32 guide track
This guide is one stop in the structured learning path. Start from the complete IoT and ESP32 guide complete guide for the full map, or continue with ESP32 first setup and deep sleep power saving.
Frequently asked questions
Which pins should a beginner just avoid? 0, 2, 12, 15 and the ADC2 group during WiFi start with 16, 17, 25-27, 32, 33.
What are GPIO 36/39 good for? Input-only with ADC1 excellent for analog sensors that must keep working during WiFi.
Where do I go next? Back to the complete IoT and ESP32 guide complete guide it indexes every guide in this track and updates as new ones are published.
Continue this track
- Building a foundation? The iot, sensors & esp32 complete guide maps every step in order.
- Next: How to Measure Room Temperature Accurately at Home
- Next: DHT22 with ESP32: Accurate Temperature and Humidity
- Next: ESP32 WiFi That Never Dies: Reconnection Strategies
- Work the numbers: battery life estimator · LM317 designer · wire gauge checker
Practical working notes
The fastest way to internalise this topic is to change one variable deliberately and predict the result before measuring. Wrong predictions are the curriculum, they show exactly which mental model needs revisiting, and the bench grades honestly.
Component substitution is a legitimate experiment as long as it is deliberate. Swap one part, predict the effect, measure, and record. That single habit converts a parts bin into a teaching lab and makes every future guide in this track faster to absorb.
Formulas and checks from this guide
Verification checklist for this track: watch RSSI before blaming code, measure supply current during radio bursts. Confirm MQTT topics against the broker log. Wireless bugs are usually power or signal problems wearing a software disguise.
Bookmark this page against your next build in the track. The checklist above is the same one used across 23 guides in this series.
Experience notes
Location, then device, then measurement. Document the tree before flashing the first device.
Measure current during transmit bursts. Sags under load are power problems, no firmware fixes those.
One last piece of advice
A note on radio current, which defines this track: transmit bursts draw in spikes, not averages. Scope the supply or log RSSI before concluding the protocol is at fault.
Working through Strapping pins set boot behaviourand Input-only and WiFi-shared pins with that habit in mind takes minutes, and it is the difference between reading about this topic and owning it.
Extended Application Notes
This section expands the practical application of esp32 gpio and strapping pins: what not to use beyond the worked example, into the situations builders actually meet. Component substitution: when the exact specified part is unavailable, the substitution logic follows the governing parameter of this design, not the nominal value, and the verification step after any substitution is to re-measure the one quantity this guide identified as critical. Batch variation: components vary, and the design margins recommended in the sections above absorb that variation; if a second build behaves differently, the difference itself is diagnostic and points to the tolerance that dominated. Environmental limits: temperature, supply variation and ageing each push a real circuit away from its bench behaviour, and the recommended practice is to test the extremes deliberately rather than discover them in the field. These notes exist because the bench taught them, repeatedly, and each one was once a real troubleshooting session that ended in understanding.
Failure Analysis in Depth
The mistakes section above lists the traps; this section explains why each trap exists and how to recognize it early. Buttons or LEDs on strapping pins without checking boot state Expecting analogRead on ADC2 while WiFi is connected Driving loads from input-only pins. Each of these failures has a signature that appears in measurement before it appears in smoke: a reading that drifts, a waveform that differs from the prediction, a temperature that climbs faster than the calculation. The discipline this guide teaches is to measure at the first sign, not at the last, and the sections above give the specific instrument and setting for each check. Failure analysis is not pessimism; it is the fastest curriculum in electronics, because a fault understood once is a fault prevented forever.
Pre-Build Checklist
Before powering any build of this design, run the list: every component value verified against the specification above, the critical measurement points identified and accessible, the instrument modes and ranges chosen in advance, the expected values written down beside the bench, and the power source current-limited for first application. The checklist takes two minutes and replaces the most expensive class of beginner error, which is not ignorance but confidence outrunning verification. Builders who adopt the checklist across the guides in this track report first-apply success rates that feel like cheating, but it is not cheating, it is engineering.
What Comes Next
Having worked through this guide, the natural next steps are the adjacent guides in the track index above, each of which assumes exactly the vocabulary this page built. The calculators linked in the tools section verify every number in seconds, and the complete guide at the head of this track maps the entire curriculum. Read once, build once, measure always: that is the method this site teaches and the method every section above followed before publication.
Theory in Practice, Extended
The theory section of esp32 gpio and strapping pins: what not to use deserves one more pass with the bench in mind, because knowing a relationship and applying it under constraint are different skills. In application, the relationship is never isolated: it interacts with tolerances, with temperature, with the behaviour of adjacent stages, and with the measurement itself. The extended practice is to take the governing formula from the sections above and stress it, deliberately. Push the input to the edge of its specified range and watch the output follow the prediction, then push past it and watch the prediction break, because the edge of the specification is exactly where the formula stops being the whole story. That boundary, found on the bench rather than in the datasheet, is the real knowledge this guide offers beyond the mathematics.
Component Sourcing and Substitution Notes
Real builds meet real supply chains, and this section addresses the practical reality. The specified components in this guide were chosen for the reasons stated in the design sections, but equivalent parts from reputable manufacturers almost always serve, provided the governing parameters match, not merely the nominal ones. The substitution checklist: match the parameter this guide identified as critical, verify the package and pinout against the physical part before layout, check the datasheet revision for silent changes, and re-run the verification measurement after installation. Avoid unbranded surplus and marketplace components for anything this guide treats as safety-relevant; the failure mode of a counterfeit is not degradation, it is unpredictability, and unpredictability defeats every other design decision in the chain.
Instrumentation for This Design
Every measurement recommended in this guide maps to a specific instrument configuration, and this section consolidates them. Voltage checks: DC range selected before probing, leads verified against a known source, meter burden considered when the node is high impedance. Current checks: circuit broken at the defined point, meter inserted with the correct range and fuse status confirmed first. Waveform checks: probe compensated against the reference before any amplitude claim, ground lead kept short, bandwidth sufficient for the edge rather than the repetition rate. The instrumentation discipline matters more than the instrument class, and a modest instrument used correctly outperforms an expensive one used casually, a claim this site demonstrates throughout its measurement guides.
Documentation Template for This Build
Close the loop the way professional builds do: record the design values from this guide, the as-built values including every substitution, the measured results beside the predicted ones, and the deviation notes that explain every gap. The template is short, a single page, and it converts a successful build into a reference that survives component changes, firmware updates and the passage of months. Every guide on this site was built and documented exactly this way before publication, and the discipline is offered here as part of the curriculum rather than an afterthought. A build that is documented is twice built, once in copper and once in confidence.
Last updated 23 August 2026
