I have a RPi3 driving a robot and I've built a dual H-bridge circuit to run it. I have seperate fuses for the RPi and the driving circuit and I'm glad I do!

Trouble is, when the RPi is off, the H-bridges enter into a shorted state from +V to GND. At the moment, I'm pulling the fuse, turning on the pi, and awkwardly putting the fuse back in once powered up and I can ensure a safe state.

As it's a P-channel and an N-channel half h-bridge, if all outputs are equal then it's actually fine (this was my logic in designing it) but I've found that GPIOs on INPUT still trip the fuse.

Question: Is there a way to specify the "powered down" state of the GPIO pins?

Alternatively, if I supplied a 10k pulldown resistor to ground on each GPIO channel will that allow the BJTs to be in a known state when the RPi is powered down?

One of the H-bridges, the MOSFETs are actually different, but I haven't bothered changing them in the schematic yet

  • The GPIO pins retain state when shutdown, but obviously once power is removed this is lost. On boot the pins are ALL inputs, and have defined "pull". Your problem is the bridge circuit which uses 4 inputs - most use 2 – Milliways Sep 4 '18 at 10:34
  • I used 4 so that using PWM doesn't move between pushing and pulling but rather pushing and off. Many use another MOSFET to switch the whole H-bridge but there's still the issue that you can't control what it's going to do in that period between power on and your program getting to set the state. While less-bad, it shooting off for half a second isn't ideal either. – Cramer Sep 4 '18 at 10:44
  • Yes, transients are not easy to figure out. I vote for “external pull down”. Have you done any circuit simulations? Is the 2n2222 load resistor too low? – Jan Hus Sep 4 '18 at 16:09
  • @JanHus When the pi has a chance to set itself up, it's quite happy and works quite well, it's just that transient period between power up and my script getting called. The Battery is 8.4V so the CE current is 7.8mA, well within spec, the 3.3V logic leads to 2.7mA which is quite manageable too I believe. – Cramer Sep 4 '18 at 21:36
  • what happens if you disconnect the RPi and power up the H-bridge? – jsotola Sep 5 '18 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.