Free cookie consent management tool by TermsFeed Generator
ESP32-CAM: Unlock Up To 11 GPIOs

ESP32-CAM: Unlock Up To 11 GPIOs

ESP32-CAM board with camera module – overview image

ESP32-CAM: Low-Cost Board, Great Projects

The ESP32-CAM is a powerful IoT board with Wi-Fi, Bluetooth, MicroSD, and camera support but one major drawback is the limited number of ESP32-CAM GPIOs available for projects.

In this guide, you’ll learn proven ways to unlock up to 11 GPIOs on the ESP32-CAM for your Arduino and IoT projects.
To make navigation easier, here are the main topics we’ll cover:


What is GPIO and why are they limited?


GPIO stands for General-Purpose Input/Output. On the ESP32-CAM, these pins are normally used to connect sensors, actuators, and other peripherals. However, many of them are already assigned to essential onboard components, including the camera module, flash LED, PSRAM, MicroSD card, and status LED.

This built-in usage is the main reason for the GPIO limitation on the ESP32-CAM.

By default, the only freely available pin is GPIO16 – shown in this image.

But, this is too limited for most real-world applications…

0
Do you agree? Please leave a feedback!x

ESP32-CAM showing GPIO16 pin location on the header
ESP32-CAM GPIO16 pin location

Fortunately, there are several methods to free additional GPIOs without losing critical functionality. Let’s dive in!

⚠️ Disclaimer:

Remember that modifying GPIO assignments can affect stability.
Always test carefully and consider your project’s reliability requirements before using these ESP32-CAM GPIO hacks.
We at Murat-Tech Hub/ Channel are not liable for any resulting issues or losses.


Freeing GPIOs via Software (1-Bit MicroSD Mode)

Did you know you can unlock 3 extra GPIOs on ESP32-CAM simply by running the MicroSD card in 1-bit mode instead of 4-bit? This frees GPIO4, GPIO12, and GPIO13, in addition to GPIO16.

⚠️ Important:
The trade-off is reduced SD card speed, so this option works best in projects where high-speed storage isn’t critical.

ESP32-CAM MicroSD in 1-bit mode unlocking GPIO4 GPIO12 GPIO13
ESP32-CAM GPIOs: MicroSD in 1-Bit Mode

This is quite simple to achieve. In the Arduino IDE, select the correct board under Tools → Board → “AI Thinker ESP32-CAM” and add the following MicroSD initialization snippet to your code:

This content has been restricted to logged-in users only. Please log in to view this content.

This free content is available only for logged-in users.

Please Register or Log In to access it.

To use the newly freed GPIOs, simply define them as an Input or Output in the setup() function, just as you would in any standard Arduino project.

Below is an example of how to set up GPIO12. This method applies to any other available GPIO as well.

Depending on your project, you might still see the onboard flash LED blink weakly and randomly.
To prevent this when using GPIO4 as an output, you can force it to a low logic level, as shown below:

⚠️ Important:
GPIO4 is tied to the onboard Flash LED. In addition to the unwanted brightness when reusing it, you may encounter issues like parasitic current draw or false logic states.

To safely use GPIO4 on ESP32-CAM, you can physically disconnect the Flash LED with a small hardware mod. Advanced users may also take this opportunity to free up an additional GPIO.


Using External GPIO Expanders

An interesting option is to add I²C GPIO expanders, such as the PCF8575 or MCP23017. If you need faster communication, you can use the MCP23S17which is very similar to MCP23017, but runs over SPI instead of I²C.

This is the simplest way to add GPIOs to ESP32-CAM without risks, making it ideal for projects with multiple sensors, so you can control multiple inputs and outputs using just 2–4 pins.

💡 Good to know:
I²C communication is especially suitable for the ESP32-CAM since it requires only two wires.

Either way (I²C or SPI), if you followed the procedure for 1-bit SD mode, you already have four available GPIOs, so you’re ready to go.
For more details and instructions you can check this post.

I²C and SPI GPIO expander modules for ESP32-CAM extra pins
I²C and SPI GPIO expander modules for ESP32-CAM
74HC4051 multiplexer for expanding ESP32-CAM GPIOs

Another budget-friendly option is the 74HC4051 multiplexer, which doesn’t rely on I²C or SPI. Instead, it uses three digital selection pins to switch between eight analog channels, plus one additional pin for the signal line — requiring a total of four wires.

For more details and instructions, please check this post.

But keep in mind that external modules also have potential downsides that could be critical for your project:

  • Power consumption increase (important in battery-powered projects)
  • The need of extra physical space & wiring
  • Additional libraries and code that reduce available memory and may impact performance
  • Additional cost.

Fortunately, there are ways to avoid these issues by not using GPIO expanders. Keep reading to find out.


Hardware Hacks for More GPIOs

If you’re comfortable with soldering, you can free up pins by removing a couple of components. You can always solder them back on later if needed.
This hardware mod also gives you the opportunity to reclaim GPIO33.

Not much soldering practice?
Don’t worry — you can still completely free GPIO4 from the flash LED, making it safer to use this pin. Instead of desoldering, you can carefully cut a specific component using a small knife.

ESP32-CAM hardware mod to free GPIO33
ESP32-CAM GPIO33 unlocked

Not sure how to perform these modifications? Check out the step-by-step guide here!


Going Further: Adding Extra GPIOs (without UART/MicroSD)

GPIO1 and GPIO3 are typically used for programming the board, debug and/ or USART communication with other devices.
Not needed? You can configure them to function as regular GPIOs, freeing up two additional pins.

Not using the MicroSD card slot at all? You can reclaim all six of its associated GPIOs!

ESP32-CAM GPIOs available with no MicroSD and no UART pins
ESP32-CAM GPIOs without MicroSD/ UART

To use the GPIOs, simply set them up according to your needs, as shown in the GPIOs Definition code snippet above.


Anything Else? (GPIO0)

Yes. What if your project, such as data logging application, requires only the MicroSD card slot?

In this case, If you don’t need the camera, you can free up one more GPIO that’s already accessible on the header pins.

I’m talking about GPIO0.

⚠️ Important:

Since GPIO0 is typically reserved for boot mode, be sure to keep it HIGH during boot.
Afterward, you can safely reuse GPIO0 on the ESP32-CAM for additional functionality.
However, misuse may prevent the board from booting, deadlocking the device. Handle with caution.


Summary: How Many Extra GPIOs Can You Get?

Astonishingly, quite a lot!
Depending on your configuration, you can unlock between 4 and 11 GPIOs on the ESP32-CAM. The exact number varies depending on whether you disable the MicroSD card, camera, UART or onboard LEDs.

If you take it a step further and use external I²C or SPI GPIO expanders—especially by connecting them in cascade—you can dramatically increase the number of available GPIOs, limited only by the ESP32-CAM’s addressing capabilities.

The complete ESP32-CAM pinout diagram and GPIO reference table below show all possible combinations:

This free content is available only for logged-in users.

Please Register or Log In to access it.

ESP32-CAM diagram showing all 11 possible GPIOs

Does it make sense to use an ESP32-CAM without the camera and MicroSD module? Absolutely!

0
Do you agree? Please leave a feedback!x

The table below covers this extreme situation, where you can still use the powerful ESP32 core, Bluetooth, and Wi-Fi for your project:

This free content is available only for logged-in users.

Please Register or Log In to access it.


Final Thoughts

Although the ESP32-CAM looks limited at first, with the right software tricks and hardware hacks you can unlock up to 11 GPIOs for your projects — without needing external modules. This makes the ESP32-CAM one of the most flexible and cost-effective options for Arduino and IoT applications that require multiple sensors, actuators, or peripherals.

💬 Have you tried unlocking extra GPIOs on your ESP32-CAM?
Share your experiences or tips in the comments below — your insight might help other makers in the community!

Sharing what we learn and make is our passion. If you feel this effort is worth supporting, a small contribution helps sustain the creation of new tutorials and projects.

Support Us Here:

PayPal

We appreciate your readership. See you in the next post!

ESP32-CAM: How to Unlock Up to 11 GPIOs © 2025 by Murat-Tech Hub is licensed under CC BY-SA 4.0

5 1 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

2
0
Would love your thoughts, please comment.x
()
x