I have a pi in an embedded project. When the user turns the instrument off, I want to inhibit turning back on until the pi is done shutting down. I can do this with a timer circuit, but would like to minimise the inhibit time. Is there a way to detect the status of the pi? GPIO pins appear to retain their state and the RUN and EN pins on the (not installed) header are always at 3.3v.

  • what does this mean? When the user turns the instrument off
    – jsotola
    Jun 7 '19 at 21:04

This howchoo post shows how to connect an LED to show the status of the Pi. The LED is steady on when the Pi is running, and off after shutdown.


Add this line to /boot/config.txt, and reboot


Connect the TxD pin (GPIO pin 8) to the positive lead of a 2 or 3 volt LED.

Connect a ground pin (e.g. GPIO pin 6) to a 330 ohm resistor, then to the negative lead of a 2V LED.

I have not yet tried this, it's on my to-do list.

  • The UART is used for communication between RPi and my instrument's microprocessor, so is not easily available. Jun 10 '19 at 15:19

As you have noted GPIO pins retain their state when shutdown.

There are a couple of exceptions where the state is modified by the shutdown process. gpio-poweroff (which is designed for this purpose) is the most reliable method.

See https://raspberrypi.stackexchange.com/a/94399/8697

PS RUN and EN pins are INPUTS, and NOT connected to the GPIO. RUN is actually a RESET pin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.