Electronic – Designing a switching system for solenoids on Raspberry Pi

mosfetraspberry pisolenoidswitching

As part of a project I'm working on, I'm having a Raspberry Pi GPIO pin activate three solenoids, but the pin itself does not supply nearly enough current (each solenoid requires at least 1A, close to 1.5A optimally). I'm trying to set up some sort of switching system with a secondary power source. My first idea used a CMOS switcher, but I ended up using spare parts I had lying around and it didn't work perfectly.

Is a CMOS setup good for what I'm trying to do? If so, what specific MOSFETs should I look into; if not, what would be a more efficient way to tackle this problem?

Best Answer

Typically you want to use a NPN driver circuit, using a 2n3904 or similar. The NPN drives your p channel mosfet or PNP driver circuit. Logic will be inverted but it will work it the max 16mA output of the RPi.

schematic

simulate this circuit – Schematic created using CircuitLab

Schematic shown has a 6mA load on the RPi output. Resize the resistors as needed. Left Q2 could be a BJT PNP or a P-Channel Mosfet. Right Q5 is NPN and N-Channel Mosfet. Size for your solenoid power.