In my robot, I plan to have a GPIO pin on my Raspberry Pi connected to the insertion detection pin (pin 3) of a barrel jack (schematic here) so that my code can tell when the robot is externally powered. The plan is to have the GPIO internally pulled up when the robot is on battery power and grounded otherwise.

The problem is that for power, the Pi is "grounded" to the negative output of a buck converter (link here) that's connected to the same barrel jack on the input end, meaning that the Pi's power and the GPIO are grounded to different things.

Is there a substantial voltage difference across the input and output terminals of the buck converter? If so, then I think this would mean that the voltage drop from the GPIO to the barrel jack ground could be greater than the 3.3 V the GPIO is rated for. This is because the Pi and its GPIO would be grounded to different reference voltages.

The buck converter will step 19.6 V down to 5 V in order to power the Pi, and the GPIO pin is internally pulled high.

  • \$\begingroup\$ Why do you think that your buck converter's input and output grounds are not the same? \$\endgroup\$
    – brhans
    Mar 19, 2019 at 15:07
  • 1
    \$\begingroup\$ If your buck converter output is not the same ground as its input (most are!) then it's an isolated converter, which means there is no fixed voltage between its input and output, it can be anything up to the isolation rating. That includes zero; it's perfectly acceptable to tie together two isolated grounds when you don't need isolation. \$\endgroup\$
    – Hearth
    Mar 19, 2019 at 15:43

1 Answer 1


Looking at the underside of what may be the same board from a different supplier, it looks like the negative side of the input connects directly to the ground pin on the USB, but you'll need to check that on the board you have, since there seems to be no datasheet.

enter image description here


Your Answer

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.