0

I have connected an Arduino MEGA2560 with the Raspberry Pi B+ V1.2 via USB

The idea is to use the Raspberry Pi as gateway to remote flash the Arduino.

So I switch on the Arduino and the Arduino switches on a relay, which switches on the Raspberry Pi power (USB micro) if I need the Raspberry Pi to flash the Arduino

It works. But when I switch off the relay, the Raspberry Pi keeps on working, because of back powering from the USB-A port connected with Arduino USB-B port.

Question 1: How can I prevent this?

Question 2: What happens, if I use an different raspberry? https://forums.raspberrypi.com/viewtopic.php?t=14059

and

https://forums.raspberrypi.com/viewtopic.php?t=203729

and others

the (poly)fuses can be blown up.

I don't like my Raspberry Pi to be damaged regardless which version I use. And I need the possibility to power off the Raspberry Pi via relay (not only via ssh: shutdown -P).

What do you think about these?

MatsK
2,8833 gold badges18 silver badges22 bronze badges
asked Oct 27, 2022 at 5:19
2
  • Ask one question ! Commented Oct 28, 2022 at 4:52
  • Keep it to one question, if you have several, start a new question ! Commented Oct 28, 2022 at 4:53

1 Answer 1

1

Put a Shottky diode in series with the 5V lead of the USB cable. I made an adapter with a USB plug & socket to do this.

Back feeding was a problem with early Pi model. You can't power a modern Pi from USB (dodgy Zero models excepted) but once booted it permits back feeding.

If you aren't planning to power the Arduino from the Pi you could just cut the 5V lead.

It is possible to safely shut down a Pi with a GPIO pin. All of my Pi can be shutdown by shorting pin 39,40.

answered Oct 27, 2022 at 5:38
1
  • Yes, I thought about, what you mentioned. For me it works with this Pi model without modifying the USB cable. shutdown via ssh and switch off the relay - the pi keeps being off - until I switch on the relay. But what will happen, if I use another model. Is there a chance to destroy something? Commented Oct 27, 2022 at 11:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.