24V DC Solenoid valve control using BASIC STAMP

Thread Starter


Joined Jun 5, 2011
Hi for you
I am controlling the flow of gas using a solenoid valve (24 V DC - 0.3A required to switch ON the solenoid and short circuit current of 0.54 A) I have generated PWM signals using BASIC STAMP and couldnot find a suitable driver circuit using MOSFET to switch ON and OFF the solenoid. Please helpppppp


Joined Sep 4, 2010
Given that current is so low why not just use a large BJT?
I am also a little confused as to why you would want PWM!
That aside, your FET driver needs to do two basic things …
  1. Shift the logic level output because you will need at least 10V probably more.(It will depend on your specific device)
  2. Provide a low impedance high and low drive to quickly charge and discharge the FET gate.
These are just basic requirements, if you were switching very fast or handling significant currents there would be much more to consider.

The first thing to do is buffer your output, a single transistor arranged as an open collector output for the uP is easy to do but even easier is to use a buffer chip …

ULN2003A’s or 2803A’s are great, cheep east to get hold of, and difficult to break.
They are arrays of Darlington’s with all the bias circuitry on board to shift 5v to as much as 30v at significant currents. They are natively inverting but you can simply cascade 2 buffers with a 2-3K pull-up to get a non inverted buffer.
Add a pull-up resistor to your final buffer and you have a high voltage output with an impedance of your pull-up when its high and next to not a lot when its low.

Feed that to an NPN/PNP Totempole and you will buffer both high and low impedance’s giving you a simple and cheap, low side, FET driver.
Don’t forget to add a decoupling cap local to the Totempole circuit …

I appreciate this is hardly a master-class but it should give you enough to research
and work with.

Hope it helps, I learnt it all from this board, thanks guys.



Joined Apr 24, 2011
Actually there commonly found inexpensive MOSFETs called "Logic Level" that get to stellar saturation characteristics at 5 VDC.

Here is a list of MOSFETs

Start by picking:

"FET Feature" as "Logic Level Gate",

"FET Type" as "MOSFET N Channel, Metal Oxide"

"Drain to Source Voltage (Vdss)" of 60V

And then hit "Apply Filters." Then pick a case you want and just about anything there will work.