0

I want to use one of the Raspberry Pi's GPIO pins as a shutdown signal to an Arduino. The idea is, that when the Raspberry starts up, it holds this pin high and when it completely shuts down, it leaves it floating (as is my understanding). I want to use this as a signal to detect the shutdown.

The circuit required should be fairly simple - I was thinking about only one diode to protect the Raspberry Pi from 5V accidentaly appearing on its pin and one resistor in series to limit the current and therefore lower the diode's voltage drop to keep the signal at a high enough level for the Arduino to be still reliably recognized as high.

3.3V signal ---l>|---////--- 3.1V signal still recognizable by Arduino.

The diode is BAT60A and the resistor is 2K Ohm.

But when I tried this circuit and applied 5V on the Arduino side, 5V appeared on the other side as well... I have a suspition, that this voltage will be 3.3V when I plug it into the Raspberry Pi, but I don't want to damage it, so I wanted to ask first.

Will the Raspberry Pi take any damage with this setup, if I accidentaly set the Arduino pin to high? And will the Arduino be able to detect the Raspberry Pi shutdown?

Thanks in advance for your answers!

5
  • Just make sure you also connect the ground of the Pi to the ground of the Arduino. GPIO pins, indeed become floating once the Pi is shut down. However if becomes floating around 3 second before the Pi has shut down completely (red led on Pi is still blinking for around 3 sec.). Not sure how you were able to read 5V (partly because I have no idea how your test setup was).
    – Gerben
    Aug 11, 2013 at 15:23
  • The ground is indeed connected. Thanks for the info about the delay, that is quite important! The setup was connecting the Arduino side to 5V from a PC power supply and connecting my multimeter to the Raspberry Pi side and Ground of the power supply. The circuit was as described in the post. Anyway thanks for the comment! Aug 11, 2013 at 15:46
  • Did you have the arduino pin set to output and high when you read the 5V? Are you sure you have the polarity correct for the diode? :-)
    – Gerben
    Aug 11, 2013 at 17:16
  • As I said, I tried it with an PC power supply not an Arduino... Not that it would matter as I see it. And I tried to reverse the polarity as well. I think that this effect is somewhat similar to pullup resistors as diodes to my knowledge have some tiny little reverse-current, that leaks even in the closing direction of the diode, which could be causing the 5V on the wrong side. The question is, however, can this cause damage to my RPi? Aug 11, 2013 at 18:14
  • If that is the case, you could try adding a high value resistor between the GPIO pin and ground. Something like a 1MOhms resistor. But I personally thing you should be fine. Knowing that it only occurs if you do something wrong on the arduino, and you'll find out, so it won't happen for a very long time.
    – Gerben
    Aug 11, 2013 at 19:35

1 Answer 1

2

If the only device to receive current from the diode is the voltmeter it is quite likely you get the output voltage on the input side - the diode leakage current is minimal but the voltmeter resistance may be even higher.

Try this setup for testing:

 GND o---[ 100Kohm ]-----o---->|---[ 2KOhm ]-----o +5V 
                         |                       |
                         +---(multimeter)--------+

Use any high-resistance resistor between your test setup and the ground in the 100K place. If you are still getting any significant voltage readout when measuring your protection circuit, your diode is burnt (or placed in wrong direction). Otherwise - you can expect arbitrarily high voltages on the protected side if they are left hanging, the minuscule value of the leakage current though will make them harmless.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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