0

I'd like to implement an electronic circuit to be able to restart my raspberry Pi when it has been shutdown (without plugging in and out the USB charger, which will obviously remain plugged all the time). For this, I just need to use the P6 pins, as described here (https://raspberrypi.stackexchange.com/a/59719/11224) and here (https://raspberrypi.stackexchange.com/a/19557/11224).

However, I surely don't want to accidentally shortcut the P6 pins while my Raspberry is running, because it will trigger a RESET signal, and I know for sure it could damage the SD card.

Thus, I want to be able to determine if the Raspberry is running or not. I've just tested mine : when it's powered then shutdown'ed, every GPIO is still powered with 3.3V/5V voltage as usual.

The only way I could think of is using a GPIO output that I would programmatically set to 1 (5V) while the raspberry is running, but this solution has a major drawback : the GPIO output won't be available until the raspberry has fully completed its boot (about 1 minute), so I still have the risk that an accidental RESET is done at this moment.

Is there another way to achieve that ?

Orabîg
  • 103
  • 1
  • 5

2 Answers2

2

You've not mentioned which Pi you have but on some models the green/amber activity/status LED comes on at boot and goes off at shutdown, you could monitor that either by removing the LED and soldering wires to the pads or maybe an optoswitch of some sort.

A slightly better solution might be to monitor the TX line on the GPIO as described here. Again, you've not mentioned which model you have so you may need to enable the UART in config.txt for this to work. I've done this myself on a 3B and it seems to work as an indicator light but you do get a lot of flickering during boot that might cause false resets when connected to your circuit, you could overcome this by adding some capacitance to smooth the fast pulses out and then maybe a Schmitt Trigger to stop your reset circuit from re-arming too soon. You might be able to replace these two with a NE555 timer.

Roger Jones
  • 1,484
  • 8
  • 14
1

You can set the Pi to assert a GPIO output on poweroff.

dtoverlay=gpio-poweroff

This is intended for use with external power circuitry.

There are many pins which may or may not provide a reliable indicator, but in general GPIO pins retain their state when shutdown so do not provide a reliable indicator.

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

Milliways
  • 62,573
  • 32
  • 113
  • 225