2
\$\begingroup\$

I'm building a DIY project with a Rapberry Pi. I tried to cut down the connections to the ones I think might be involved in a certain behavior I'd like to understand.

What I have:

  • a 12V power supply
  • a UBEC that is powering the RPi
  • a small DIY board with connection for some sensors, an LCD and some fans

The 12V arrives on the board through a TIP120, switched with a GPIO pin from the RPi. From the RPi itself, I'm using a VGA cable to bring many GPIO pins (for various purposes) and the 5V up to the DIY board; but not the RPi's GND: since it should be the same GND "shared" between the power supply and the UBEC through the RPi, I thought I could save a wire and use the GND from the 12V wire. This had the advantage of shutting down also all the other 5V stuff attached to the board when I cut the 12V off from the TIP120.

Imgur

pdf download

The behavior I don't clearly understand is this: when the GPIO pin in the schematic is LOW, and no current flows through the TIP120, the 5V part of the DIY board is also shut down, but the fans continue to spin at a very low speed, and in fact probing with a meter, there are ~6V across them.

I think that the circuit is being closed via the 5V wire through the RPi, thus having the 6V across the fans (12V are slightly lower, about 11V; and 11V - 5V = 6V).

Is this correct?

Then, if I disconnect the "common GND" and bring a wire from the RPi's GND to the 5V section of the board (connecting the two "X" in the schematic) it clearly stays always ON and also I'm able to completely shut down the 12V fans (in addition, I'm surprised that all PWM signals from the RPi to the fans, regulating their speed, continue to work).

(Sorry for the simple circuit diagram, I hope there are not too many mistakes, especially about notations - I do this for fun and I'm not an expert)

\$\endgroup\$
3
\$\begingroup\$

Yes, I think your problem is that when the TIP is not conducting, there is a current path from the 12V through the fan and the custom board / LCD to the 5V of the Pi. The custom board / LCD is reverse powered, and the Pi might receive more than 5V (in which case the 5V has more than 5V at its output). Not good!

A simple solution would be a diode in the line from the Pi to the custom board, but note that your are switching the 5V with the TIP, which will already cause a significant drop in the voltage. This might be a problem for your custom board / LCD. It is less likely to be a problem for the fan. Adding another diode drop might not be a good idea.

Another solution would be to use two separate TIP's to switch the fan and the LCD.

IMO the only real solution is to switch in the power line(s) instead of the in the ground. Assuming your custom board / LCD draws little power from the 5V I would add a 5V linear reguator and power both that regulator and the fan from a switched 12V.

Two quick grabs from searching "high side switch":

enter image description here

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ Thanks for the valuable help. What do you think about the (simple) solution of breaking the "shared GND" and using a separate one from the Pi to the 5V section of the board? It seems to work good. I suppose it would be also safe. Plus, it costs nothing in terms of re-designing this stuff (the LCD can be turned off in code). \$\endgroup\$ – dentex Oct 9 '16 at 10:33
  • 2
    \$\begingroup\$ You mean not switching the custom board / LCD, only the fan? That would be an easy solution. \$\endgroup\$ – Wouter van Ooijen Oct 9 '16 at 11:21

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.