want to know the no. of transistor which suitable most.

I want to control a 6 solenoid valves(Operates at 24DCV and 0.5A) with the use of 6 relays connected to an Arduino's 6 pins via 6 BJT(NPN) Transistor.

The Arduino output pin is 5V and can source 40mA maximum.

I would like to use a relay to switch the valve on and off.

So, suggest me that which transistor is better to use here and value of resistor that I have to put between arduino and transistor. and DC voltage for relay to operate.

A 2n2222 would do it.

Or (better)

Bc338... i say whatever's cheaper go gor that...

They both should handle it even though they might get a little warm, but some thermal expoxy bend it flat face down against the pcb would handle that issue.

A 2N2222A (metal can TO-18) case can handle 500mA. It's max rating is usually shown as 600ma, sometimes a bit more at 800mA it depends on manufacturer datasheet you look at. Some other TO-92 epoxy case varieties of the 2222A are less capable and that much current is really pushing the part a hard and asking for a fail.

I agree that a BC338 would be choice based on max collector current of 800mA, but that would be running BC338 real close to the MAX Emitter Collector voltage of 25V in your circuit.

So actually, both offered are not the best choice.

I guess it depends on "how easy it is for you to get transistors". Can you run by a retail store like Radio Shack? or do you you have to order a part?

My "goto" part when a 2N2222A is not enough is the readily available TIP122. (meaning, I can go to the store and buy one)

cjdelphi:
A 2n2222 would do it.

Or (better)

Bc338… i say whatever’s cheaper go gor that…

They both should handle it even though they might get a little warm, but some thermal expoxy bend it flat face down against the pcb would handle that issue.

Even with 50mA base current a 2N2222 only guarantees 1V Vsat, so it will get extremely hot and can’t
be driven at that level anyway. ZTX851 will handle 1A with 25mA drive and low Vsat, a STX724 probably will

If you are going to use a relay to control the solenoid valve, then almost any NPN transistor will do, with base resistor of between 470 ohms and 1K.

If you decide to drive the valves directly from a transistor, then of the suggestions already made, ZTX851 is the best choice but BC337 should work too. I suggest you use 150 ohm base resistors, which should provide nearly 25mA base current.

Don’t forget to connect flyback diodes in parallel with the solenoid coils (and the relay coils if you use relays).

A typical driver circuit is shown below…

If your transistor Hfe is between 50 and 150, this should work fine. Otherwise, some recalculations of the base resistor are needed. IE; If you used the TIP122 darlington, with a gain of ~1000, the value should be re-examined/caclulated.