Arduino 12v Solenoid High Side PWM

Thread Starter


Joined Oct 11, 2016
Hey Guys,

I've installed an air ride system into the rear of my car to keep the car at a constant height regardless of how much weight I have in the back of it. I was wearing out tires doing long road trips with all of my gear crammed in the back of the car. It all works well, but i'm ready to take it to the next level!

Currently I am running a block of relays to send 12v power to the solenoids.

I am ready to start controlling the speed at which the air flows through the solenoid valves. I've lost a few nights sleep researching how to control my block of (8) 12v solenoids with PWM from arduino.
Sounds like the easy answer is an N-channel MOSFET and a resistor or two. easy. nope.

My solenoids: Accuair VU4 Manifold
Voltage Requirements 10.5-16 Volts
Current Requirements 1.1 Amps (for each of the (8) Valves)

The 12-pin connector on my block of solenoids has the grounds grouped together. (Black wires)

I need to send PWM 12v+ signal to this bad guy now. Im nervous that using a single P-Channel MOSFET that if the Gate/Arduino gets disconnected somehow that the Solenoid would be left open and: a) overheat b) render the car un-drivable. (I might be wrong with thinking this)

I watched this video which seems to work. (screenshot of his schematic below)

My concerns though are that he uses a N-channel MOSFET, and theres no diode across the motor to protect from current spike when motor / solenoid is turned off.

I've also come across this post on about making high-side switches with raspberry pi.

It all makes sense to me, except he is using 0-5v to source a 5v load with a NDP6020P. I need to use 0-5v to source a 12v load.

here is the datasheet for his MOSFET, will that also work for my application?

is there a single unit that has both a N and P-channel mosfet built into it?

Thread Starter


Joined Oct 11, 2016
they could possibly. 4 valves are 'air in'. 4 valves are 'air out'. all valves need to be independent of eachother (2 up & 2 down - 4 up - 1 up & 3 down - etc)


Joined Nov 23, 2012
Oh, yeah, @MikesBikes, add a diode (reversed biased) in from mosfet to ground for each valve. That is, cathode should be connected to node between mosfet and coil, the anode connected to ground.