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.

About Using Transistor as a switch

Not open for further replies.


Newbie level 2
Aug 21, 2009
Reaction score
Trophy points
Buenos Aires
Activity points
transistor as a switch

Hello, I'm new to the forum.

I'm having trouble using a transistor as a switch to activate a solenoid electrovalve when an inductive sensor detects metal.

Here's the circuit:

Here are the details.

The sensor is a HT-P12NA PNP Inductive sensor (24V, 200 mA) that has 10V in the output when is sensing metal

The electrovalve has a 24V, 300mA Relay that activates it (it's a pneumatic valve)

I've tried two different transistors: 2N2218 (Vce max=30V, Ic max = 0.8 Amp) and BC639 (Vce max=80V, Ic max = 1A)

The problem is as follows:

With out the electrovalve (using a multimeter as the load) it works just fine, when the sensor is sensing metal, the transistor goes to saturation and I get 24V DC where the valve should be. But, when I put in the valve, and the sensor is on, I only get about 5V, so the relay on the valve never activates.

I tried a lot of Resistor values with no luck. I aldo checked the transistor placement a million times.

Any advice?

Note: As a power supply i'm using an 220V to 24V AC transformer and a bridge rectifier. The DC voltimeter shows a 24 V DC output, but, of course, the supply it's not perfect DC, could that be causing any trouble with the electrovalve internal impedance?

Thanks in advance.

transistor switch

the most important thing is the current going to the base.
for a transistor to be worked as switch the transistor must have two cases cut off and saturation.
So you will have to choose the resistor to saticefy this.

transistor as switch

It is the problem of Base current.
The sensor does not give proper base current for the particular collector current to get saturation. As you test with multimeter the collector current is very less , so it gets saturation with very low base current. As you connect the valve the collector current is larger then earlier case, so the base current has to be given more to get saturation. (In saturation Vce should be zero then only valve voltage become 24 Volts)
I hope you understood, other wise i can send circuit.
All the best


Could you please send me that circuit, it would be very helpful.


transistor switch

You can eliminate the base current problem by using a MOSFET that only responds to gate-source voltage. Another problem you may be facing is that your BJT will not work at the high currents that would have gone through the load.

switch transistor

What does Flatulent say is correct.You can choose mosfet also.But the valve current is in the milli ampere so he can prefer BJT(No need to worry about static).
I attached the circuit here with.

getting problem transistor as a switch

you want to put the load on the collector of the pnp.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to