Get 2 BONUS GPIO Pins on the ESP-01!

Get 2 BONUS GPIO Pins on the ESP-01!

ESP-01 WiFi board
ESP-01 WiFi board

The ESP-01 is a super cheap but quite powerful WiFi module which is perfect for adding internet control to an existing project or for small home automation projects. But a major disadvantage of this nifty little board is that it has only 2 GPIO pins. However, with this little trick, you can use the RX and TX pins as GPIOs, thus giving you two extra GPIO pins and 4 GPIOs in total.

ESP-01 Pinout

Add one or both of the below lines to the void setup() of your Arduino sketch, followed by a pinMode() declaration for input/output. And voila, you have 4 GPIOs now!

//To use TX as GPIO:
pinMode(1, FUNCTION_3);
//To use RX as GPIO:
pinMode(3, FUNCTION_3);

A lot can be done with 4 pins, and I2C can be used if more are needed. More about that here.


Leave a Reply

Your email address will not be published.