Electronic – RPi pin not controlling NPN transistor as expected

raspberry pitransistors

I'm using a Raspberry Pi to control an ESC and would like to be able to turn it on and off at will using a TIP3055 NPN transistor.

I've hooked everything up as diagrammed below. The 11 V battery runs through a distribution board that provides several 11 V lines and a regulated 5 V line which will power the RPi in the future. As for now, it's powered via a separate USB connection.

If I manually disconnect and reconnect the wire to GPIO20, the transistor works as expected. If I leave the wire connect and turn the pin on and off with software, the ESC maintains power the entire time. I thought maybe power was being forced from the transistor to the GPIO pin (as the wire reads ~2 V when connected) so I put a diode between the resistor and the pin but that had no effect.

At this point I'm fairly certain that I shouldn't have used this particular transistor. I believe I should have put in a MOSFET but I wasn't clear on what I was doing when I started.

Aside from "mostly everything" what do I not know that is not letting me set this up correctly?

circuit diagram

Best Answer

These are the basic ways of switching using either PNP / P channel MOSFET for high side switch or NPN / N channel MOSFET for a low side switch.

At all times the ground (0V) of the battery and the rpi are common.

enter image description here

Note: R5 (1k0) is optional but is a useful if using a Darlington NPN (high gain) as it helps to pull down any leakage current through the PNP.