Which transistor is best suited?

Helo :slight_smile:

I would like to be able to turn ON/OFF my 16 relays board by an output pin of the Arduino. The 16 relays board is powered by 12VDC and each relay need ~30mA when ON so that is ~500mA when all relays are ON. Also there is a 5V output on this board that allow me to connect other devices if needed, so it may require more than 500mA (but less than 2A for sure).

At first I planned to use another relay to turn ON/OFF that 16 relays board but lately I've read about transistors used as switches and I think a transistor is better suited than a relay in this case.

Can you tell me, which transistor type and model would you use in this case? And do I require other components?

You better find this IC ULN2803, two for project

guix:
Helo :slight_smile:

I would like to be able to turn ON/OFF my 16 relays board by an output pin of the Arduino. The 16 relays board is powered by 12VDC and each relay need ~30mA when ON so that is ~500mA when all relays are ON. Also there is a 5V output on this board that allow me to connect other devices if needed, so it may require more than 500mA (but less than 2A for sure).

Firstly which board are you talking about? Also I can't tell if you want to switch the supply to the
entire board from one Arduino pin and transistor or if you want to switch individual realys. If the
former then how are the individual relays switched?

I would go with high-side switch, you would need a PNP transistor (or PMOS) with Ice=3A Uce=40V, and a driver transistor - NPN any low power general purpose would be ok (the transistor's part numbers depicted on the schematics are just an example).
No warranties of any kind :slight_smile:

brdsw.jpg

Sorry if this was unclear,

I want to turn ON/OFF the whole board, not individual relays (which are in my case controlled by 2x 595 shift registers)

This is the relay board (on which there is already 2x ULN2803, Magician ;)):

And I want to put a switch controlled by the Arduino, between the power supply and that screw connector (in the front of the picture)

pito, I have read that I shouldn't use PNP transistors because:

for a PNP transistor, active high becomes active low, meaning the transistor will switch on when you apply 0V from your Arduino, but it won't switch off when you apply 5V from the Arduino. You'll need to apply 12V to the base of the transistor to switch off

Is the BC517 a good choice?

"pito, I have read that I shouldn't use PNP transistors because:"

See the schematics above - with arduino's output HIGH you switch the NPN (Q2) transistor ON, which will switch the PNP (Q1) transistor ON - that will power ON your entire board. With arduino's output LOW, the NPN will be OFF, and the PNP will be OFF as well - that will power OFF your board.

So in order to control the PNP transistor we use the NPN "driver" - which allows us to control the PNP transistor via the arduino's output easily.

The PNP (Q1) transistor shall be one with min 3A Ice current and min 40V (45, 50, 60)Uce - so google for the best type - it depends where you live :slight_smile:
PS: Farnell has an Product selector - so go for Transistor polarity PNP, Collector Emmiter Voltage >= 40V, DC Collector current >= 3A

I see, thank you pito for the schematic I didn't see it when reading your post first time (slow internet...) :slight_smile:

But ideally i would like to use fewer components, isn't it possible with just one transistor (and one resistor between Arduino output and transistor base) ?

Something like that maybe?

R1 1Kohm
Transistor BC517

guix:
Sorry if this was unclear,

I want to turn ON/OFF the whole board, not individual relays (which are in my case controlled by 2x 595 shift registers)

This is the relay board (on which there is already 2x ULN2803, Magician ;)):

And I want to put a switch controlled by the Arduino, between the power supply and that screw connector (in the front of the picture)

pito, I have read that I shouldn't use PNP transistors because:

for a PNP transistor, active high becomes active low, meaning the transistor will switch on when you apply 0V from your Arduino, but it won't switch off when you apply 5V from the Arduino. You'll need to apply 12V to the base of the transistor to switch off

Is the BC517 a good choice?

Firstly you need to answer my second question:
"If the former then how are the individual relays switched?"

The point is if you remove power to the relay board and something is still driving its individual inputs, you may damage
the board (depending on how its inputs are designed). Alas just providing a photo doesn't give useful information - a link to the
datasheet is what is needed.

I'll assume you can arrange to remove individual drive to its inputs before powering it down for now.

You'll need to do high-side switching of the board (since grounds need to be common), which means
a PNP transistor or a p-channel MOSFET. You'll also need a NPN small signal transistor to level-convert
upto the 12V rail.

Look at the diagram in posting #24 of this thread: P-Channel mosfet controlling car 12v light - General Electronics - Arduino Forum

Choose a p-channel MOSFET with an Rds(on) of 0.05 ohm or less and you'll cope with several amps no problem. The NPN
can be anything small in that circuit.

guix:
I see, thank you pito for the schematic I didn't see it when reading your post first time (slow internet...) :slight_smile:

But ideally i would like to use fewer components, isn't it possible with just one transistor (and one resistor between Arduino output and transistor base) ?

Something like that maybe?

R1 1Kohm
Transistor BC517

I would not recommend you that kind of low-side switching..
PS: in my schematics above you can use any p-channel MOS transistor (Q1) with above params without any change in the schematics..

brdsw.jpg

Thinking about that board, if its inputs go just to ULN2803's then those have resistors on the inputs so are safe to
be driven when no power to the board...

so much fuss over somethin so trivial!

use the npn transistor and switch the 5v supply switch on and off when desired.

npn 2222 will handle it