Resetting the Pi Pico usually requires unplugging the USB cable either from the Pi Pico or your computer. It’s a lot easier to add a reset button to your circuit which you can press instead of unplugging cables. It’s easy to do and I tend to add a reset button before starting any Pi Pico or Pi Pico W project.
While developing with the Pi Pico it is often required to reset the board. This is usually due to a number of reasons:
- Restart you code so it can start it from the beginning
- Restart due to a communications issue with your computer via USB
- Swap into mass-storage mode so you can drag-n-drop a new UF2 file
Adding a Reset Button to the Pi Pico & Pi Pico W
The reset button just needs to connect the RUN pin to ground.
The RUN pin is Pin #30. It is 11 pins from the USB end of the board. It has an internal (on-chip) pull-up resistor to 3.3V of about ~50kΩ (from Raspberry Pi Pico Datasheet).
You can use any momentary switch but on a breadboard a small 6mm x 6mm tactile switch will be perfect.
6mm Tactile Switch Pinout
The common type of small tactile switches have 4 pins. They are connected in pairs so it is important to connect to the correct pins to ensure the switch works as expected. In the photo below Pins 1 & 2 are permanently connected. As are Pins 3 & 4. So the pins that are bridged when you press the button are those that can be seen on the same edge.
Reset Button on Breadboard
On the breadboard the Reset switch can be connected between the RUN pin and any of the Pi Pico’s ground pins.
In this example I have used the ground pin #18. Any of the ground pins can be used and they are Pins #3, #8, #13, #18, #23, #28, #33 or #38. If you look carefully you’ll notice the ground pads on the Pico PCB have a square edge.
Once connected you can use the Pi Pico as before but now whenever you press the button it will reset. Your default programme will run.
Using the Reset Button with BOOTSEL Button
In order to put the Pico into mass-storage mode you would hold down the BOOTSEL button while connecting the USB cable and then releasing the BOOTSEL button. With a reset button added to your circuit you can follow this process instead:
- Press and hold the reset button
- Press and hold the BOOTSEL button
- Release the reset button
- Release the BOOTSEL button
The Pi Pico will be recognised as a mass storage device and you can add your UF2 file as required.
Other Pi Pico Resources
The latest version of the MicroPython firmware can be downloaded from:
Pi Pico: https://micropython.org/download/rp2-pico
Pi Pico W: https://micropython.org/download/rp2-pico-w
Free PDF download: Get Started with MicroPython on Raspberry Pi Pico