Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Selection of transistors for switching Air solenoid valve?

Not open for further replies.


Member level 2
Sep 14, 2019
Reaction score
Trophy points
Activity points
Air solenoid valve 24V 5W with Flywheel diode
Power supply Switching 230V /24V
MOSFET transistor any as AO3400A 30V ,RdsON 50mOhm SOT23.
Drive over GPIO MCU 3,3V

The question is how safe is the use of a 30V transistor in this case?


An experienced electronics designer will be O.K. with a 30V transistor. I still recommend a bit higher margin.

An unexperienced designer will even kill a 100V rated transistor.


The designer can influence the max Flywheel diode in this case,
A good one will use fast recovery UF400x
A average one will use universal 1N400x
The wrong one uses 1N4148
Without a diode, he is not a designer, but an idiot.

The quality or political beliefs of the designer will not affect the life and quality of the capacitors in a switching power supply. (Power peaks in x years.)
I just can't get rid of the feeling that the transistor in these cases should be sized for twice the supply voltage.
The energy released as the solenoid switches off is in the opposite polarity to the voltage applied to energize it. That means the transistor only sees the supply voltage when turned off (via the solenoid) and a diode forward voltage less than that as it turns off. Of course most of us would add a little safety margin to the requirements. Using a fast diode is a good idea but in practice the voltage across it will never be more than supply in one direction and Vf in the other so the recovery time will be short, even for a standard speed diode.


The designer can influence the max Flywheel diode in this case,
A designer can also influence the stray inductance in the supply path and the path to the load... also the switching speed and thus the expectable peak voltage.

Don´t start to make an electronics forum a political place.


Don't take it as me disagreeing with you or wanting to argue, no . I'm trying to honestly assess the situation, maybe I'm missing something
There are three solenoids in total
I will place three ARK terminal blocks on the edge of the PCB. I will bring +24V to them, I will want to use a poly fuse and a blocking capacitor , There will be an effort to replace the expensive fuse with a cheap small resistor. It will be on the TOP side.
At the bottom, near the terminal block, the transistor itself will be in SOT23, spilled ground. The diode as close as possible to the terminal block, ideally on the bottom right next to the pins. +24V is 250mA each, wll be use track min 1mm because the power supply.
Why am I writing this, I don't see a lot of room to do it downright wrong.
Of course, it would probably be possible to add more capacitors, maybe a transil, but the price, space on the PCB / expediency

Originally I wanted to use a BC transistor, more precisely BC817, it is at 45V, but there would be two extra resistors in the base, therefore MOSFET
--- Updated ---

I forgot the switching speed
The transistor switches directly to the GPIO of the STM32 processor
AO3400A is quite a "monster" on SOT23, Input Capacitance is 630pF, , the switching will not be extremely fast and most importantly I will not do anything about it, we have around 10k pcs of them in stock.
Last edited:


If you want a detailed answer you need to give detailed informations.
At least:
* schematic with all part values,
* PCB layout
* wire types, wire lengths
* best a (multiple) photo of wiring from power supply via PCB to solenoids.

You wrote "solenoid ... with flywheel diode" .. thus I assume they both are combined.

This means all the wiring from the transistor to the solenoid forms an inductance, which causes overvoltage during switch OFF. This overvoltage is not suppressed by the solenoid inside flywheel diode. This overvoltage will hit your transistor. The energy is very small compared to the solenoid energy.
But sooner or later it may kill your MOSFET.

Thus a good designer may consider the wiring (stray) inductance and the switching speed. If there is an expectable peak above 30V the designer will add overvoltage protection close to the transistor.
* If wired as (additional) flywheel then an 1N4148 will do, but needs proper low impedance power supply path (fast power supply capacitor and low impedance signal path).
* if wired as zener/MOV/transil .... then it should be very close to the transitor C_E / D_S.

In the same way the designer will check and treat the power supply path and all it´s wiring.

Diode selection.
Fast diodes usually are fast in terms of trr (reverse recovery). But trr doesn´t play a big role here unless you are using PWM.
Even 1N400x are fast at turn_ON.
1N4148 is fast and can stand up to 2A peak. (short time, low energy)


Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to