Electronic – arduino – Selecting the right relay

arduinorelay

I'm looking for some advice on what type of relay I should use for my circuit.

I have a 5v power supply and I want it to act just like a switch. I will be controlling it with an Arduino like described here: http://tronixstuff.wordpress.com/2010/04/20/getting-started-with-arduino-chapter-three/

Best Answer

The right relay depends on what you want to switch and how fast. What voltage, current, etc...

You won't be able to drive it directly from the Arduino pin, as most general purpose relays require at least 150mW to switch which is >30mA @ 5V. You will need to use something like this:

Relay driver

The NPN can be just about any general purpose NPN (2N2222, BC337, etc) and the diode can be most general purpose diodes (1N4001 or similar) VCC is your +5V.

If you go to somewhere like Farnell, and use the parametric search to narrow down you options, you will get hundreds of choices, here is an example search with 5VDC general purpose relays capable of >10A and >250VAC selected.

EDIT

It seems this is to turn an ATX supply on by pulling the PC_ON (usually green) connection to ground. In this case the relay is a bit overkill, and a simple open collector NPN transistor circuit can be used:

PC On transistor circuit

The dotted area is inside the PC, so all you need is the NPN transistor (almost any general purpose will do) and the resistor (4.7kOhm is shown, but depending on the transistor gain, R1 can be between say, 50kOhm and 1kOhm - between 1kOhm and 10kOhm should work with just about anything though)
The R_pullup of 1kOhm is assuming about the worst case - it will probably be between 2kOhm and 10kOhm. The circuit as shown would work with a pullup down to around 100 ohms though if needed.