Electrical – Using transistors to switch 12v from a 3.3v signal

mosfetsolenoidtransistors

I'm a pretty accomplished programmer, but working directly with electricity is giving me the fits.

I'm trying to replicate a design that switches a 12v/300ma solenoid based on a GPIO signal from a Raspberry Pi. The design suggests a TIP120 "darlington" transistor to accomplish this task, but no way that I hook it up seems to actuate the solenoid.

I've actually removed the RPi from the design and am trying to just jump wires to practice.

schematic

simulate this circuit – Schematic created using CircuitLab

I read somewhere about an issue with the TIP120 where there is too much voltage loss resulting in the case where the solenoid doesn't have enough juice to fire.

I read that I should try replacing the TIP120 MOSFET NDP6020, so I gave that a shot, but the solenoid is triggering even when there's no source signal!

I believe that it's quite possible that I'm an idiot, so I actually set up a dummy circuit using 3.3v LEDs. Using those LEDs, I was able to get the TIP120 to work (kinda – the voltage loss was evident in the brightness of the LED), but not the NDP6020.

And yes, I tried with multiple units, in case one was DOA or I accidentally burnt it out.

What have I missed? I'm stumped.

Best Answer

Did anyone tell you to move the transistor to the low side yet? ;-).

And, add a resistor to the base drive - 2k maybe should do it. It doesn’t take much base current to saturate a Darlington like a TIP120, which has a current gain (hfe) of about 1000.

When fully on, the transistor will have a small collector-to-emitter voltage, Vce, of about 2V for TIP120. Not enough to make a difference really.

You could use an N-FET too (on the low side) but make sure its threshold voltage (Vgs(th)) is low enough that it will be fully on with at 3.3V at the gate. This kind of FET is sometimes called a ‘logic level’ FET. This one would work: https://www.mouser.com/datasheet/2/308/FQP30N06L-1306227.pdf

Finally, add a reverse-biased freewheeling diode across the coil to catch the coil’s flyback spike when the switch turns off.