Waking Up Raspberry Pi Using Reset Pin


This post shows steps to wake up Raspberry Pi 3 from other Raspberry Pi by using RUN (reset) pin.

Background: I was looking for a way to wake up my Raspberry Pi 3 from other device and found the information below,

  • Resetting the board while in halt state wakes Raspberry Pi up [1]
  • Raspberry Pi 3 has reset pin, which is labeled as ‘RUN’ [2]

As described in [1] and [2], momentarily shorting ‘RUN’ pin with GND causes a reset and it also wakes up Raspberry Pi if it’s in halt state. I found many people have implemented a reset button by using “Normally Open” (NO) / “Momentary-ON” button switch [3] [4] , but my intention was to control the reset pin from the other device. So, I decided to connect ‘RUN’ pin to the other device’s GPIO to control it. I chose another Raspberry Pi as the ‘other device’ for quick test purpose so that I don’t need to worry about the difference of logic level, etc.

 

Here is the list of contents of this post.

Contents
– Assumptions
– Steps
1. Wiring boards
2. GPIO control
3. Put Raspberry Pi 3 into Halt state
4. Test
– Summary
– Troubleshoot
– Reference

 

Assumptions

 

Steps
1. Wiring boards
1-1. Since the headers for the reset pins are not installed by default, solder it first.

\

1-2. Connect RUN pin and a GPIO pin between the two boards. I connected RUN with pin#7 on Pi Zero, but any available GPIO should work.

1-3. Connect GND pins between the two boards to match the ground voltages. I used pin#6 on Pi Zero, but any other GND pin should work.

 

2. GPIO control
2-1. Boot up Raspberry Pi Zero W and login.

2-2. Launch python interactive shell by typing ‘python’.

$ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

2-3. Import GPIO library and set GPIO mode.

import RPi.GPIO as gpio
gpio.setmode(gpio.BOARD)

2-4. Set pin#7 as output and initialize the state as HIGH.

gpio.setup(7, gpio.OUT, initial=gpio.HIGH)

2-5. Type three lines below to define a function to momentarily output LOW.

def reset():
    gpio.output(7, gpio.LOW)
    gpio.output(7, gpio.HIGH)

Note that the line 2 and 3 need an indentation at the beginning.

2-6. After entering line 3 above, press enter again to finish the function definition. The output should be like:

>>> def reset():
...     gpio.output(7, gpio.LOW)
...     gpio.output(7, gpio.HIGH)
... 
>>>

 

3. Put Raspberry Pi 3 into Halt state
3-1. Boot up Raspberry Pi 3 and login.

3-2. Type below so that it goes to halt state.

sudo shutdown -h now

 

4. Test
4-1. Go back to python interactive shell on Raspberry Pi Zero and call ‘reset()’ function.

>>> reset()

If everything is fine, Raspberry Pi 3 should boot up from halt state.

 

Summary
I used Raspberry Pi Zero for quick test purpose. If you intend to connect other board, please check the electrical specs such as logic levels, to avoid any damage to the boards.

 

References
1. Embedded Linux Wiki / RPI safe mode / Wake from Halt

2. Embedded Linux Wiki / RPi Low-level peripherals / P6 header

3. Making a Reset Switch for your Rev 2 Raspberry Pi

4. Reset button switch off my Raspberry Pi3