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 ?

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 May 3, 2021 at 0:05

1 Answer 1

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, 2021 at 10:01

Your Answer

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

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