0

I'm planning on using a pi 4B to act as a usb mass storage via a gadget module on the usb-c port.

However, I want it to keep being powered when the usbc power is down, to finalise it's internal tasks.

I wanted to use a external power bank for that, however I'm not sure what I plan will work

 +---------+                                                   
 | Host PC <---------------------------+                       
 |         |                           |                       
 +-------^-+                           |usb 5V/2A in           
         |                           +-v---------------+       
         |                           |Powerbank        |       
         |   +---------------+       |                 |       
         |   |      Pi4B     |       +-^---------------+       
         |   |               |         |usb 5V/2A out          
         +--->usbc    5V GPIO<---------+                       
             |               |                                 
             |               |                                 
             |               |                                 
             |               |                                 
             |               |                                 
             |               |                                 
             |      USB3 port|                                 
             +---------^-----+                                 
                       |                                       
                       |                                       
                       |                                       
              +--------v-+                                     
              | USB3 SSD |                                     
              |          |                                     
              |          |                                     
              |          |                                     
              |          |                                     
              |          |                                     
              |          |                                     
              +----------+                                     

As far as I understood it, it would not be a good idea to power it from both the usbc port and the gpio, so, can I just "cut" the 5v and the gnd wires in the cable between the host and the pi and call it a day ?

New contributor
Remy Grandin is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • 1
    I wouldn't cut the ground, for "signal" reasons - I'm not an electronics engineer so I won't even try to explain – Jaromanda X May 3 at 0:05
1

The signal (data) on USB cable between PC and RPi is relative to the GND on this cable. So cutting GND on this connection will result in no data transfer. However cutting 5V only on this cable is OK. From powerbank you need both: 5V and GND - again: 5V from powerbank is relative to its GND. So 2 wires between powerbank and RPi (it can be GPIO). However I tried powering RPI from GPIO and it seems it does not transfer as much power to its USB (where you want to connect your SSD) as if you power RPi from the USB port. If this is the problem (sometimes it works, sometime it does not), you can take 5V and GND from powerbank, use the interface cable (USB to USB-C) and power RPi from powerbank directly to your USB-C on RPi (instead of powering via GPIO).

1
  • I don't know if in computer environment it may be a serious problem, but you have a ground loop. Alternating Magnetic fields can cause a current going around the loop. – ArjenR May 4 at 10:01

Your Answer

Remy Grandin is a new contributor. Be nice, and check out our Code of Conduct.

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.