0
\$\begingroup\$

I have a simple setup where an Arduino Mega + Raspberry Pi 4 are connected via regular USB cable.

They are also using a shared 5V@5A power supply which provides more than enough power for the 2 devices.

Both of them getting the 5V directly from their VIN pins skipping any kind of voltage regulators on board.

The problem comes when I disconnect the Raspberry Pi now from the 5V line while the Arduino is still running and try to plug it back in. It never boots with only the RED led lighting and the green HDD led never lights up UNTIL removing the USB connection between the 2.

After that it happily boots up and I can plug back the USB.

What is causing it and how to solve it the simplest way with the current setup?

Would adding a diode on the Raspberry Pi VINs help anything? I assume there is some back current loop going on here.

\$\endgroup\$
1
  • \$\begingroup\$ Just to make sure, do you have a solid ground connection between the Pi, the Arduino, and the 5V supply without the USB cable? \$\endgroup\$ Mar 21, 2021 at 17:28

2 Answers 2

1
\$\begingroup\$

According to this thread on the Raspberry Pi forums, it is a known issue that the Pi 4 will not boot if power is present on its USB port.

There is some evidence that switching to one of the USB 2.0 ports (rather than the 3.0 ports) solves the problem. EDIT: OP tested this and it doesn't solve the problem.

You can also get into the USB cable between your Pi and Arduino and clip the red power wire (if you don't need to provide power to the Arduino through this USB connection).

Older versions of the Raspberry Pi are not affected by this.

\$\endgroup\$
2
  • \$\begingroup\$ Nah usb2.0 ports do the same that would be too easy. I will cut the power cable inside thanks great idea. \$\endgroup\$
    – user106458
    Jun 2, 2020 at 17:47
  • \$\begingroup\$ Thanks for testing it. I will update my answer. \$\endgroup\$ Jun 2, 2020 at 18:30
0
\$\begingroup\$

Its partly a design problem due to the lack of power blocking diodes not installed in series with the USB ports. But there is ways around this issue. When the Pi is connected to a usb device that applies power back to the pi and the pi's power cord is disconnected, the 5Vsys and Sys2 pins receive a logic hi, but the 3.3V is not present because the power cord is not connected to the pi. This condition is an "operating state" called "power on standby" which normally is reached when someone selects "shutdown" in the pi/Linux desktop. The 3.3V rail is powered down, the 5V is still powered, sys and Sys2 pins are 5V. So the correct way would be to send a logic low (0 to -3V) to the Global_En pin via a momentary switch to ground or triggered with cmos level negative voltage logic. That will turn on the 3.3V rail and boot the machine after you plugged in the power cord to the pi. This is for Raspberry pi4B rev2, the Global_en pin next to the processor. You shouldn't have to unplug the raspberry pi once you install the cpu on/reset switch unless you are using the 5V to power a fan. I run a fan less setup on my 4B, but I notice others found that one can use gpio pins to run a pwm fan which could be programmed to turn itself on/off by the OS.

\$\endgroup\$

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.