Arduino mega 2560 powering lots of 5V relays.

Hi,

I wish to have a controllable variable resistor.
I am thinking of putting lots of resistors in series and then use a dpdt relay on each one to switch in a resistor or bypass it.
How many dpdt 5v relays can I power directly from the Arduino mega 2560?
I need to test in 1K steps from 0 to 1M Ohm.
If I use DPDT relays, I probably can do what i need with 10 relays. (I.e. 10 binary bits)

Please help.

You could power the relays (assuming <= 100mA coil current), BUT you will not be able to drive the coils directly from the GPIO pins on the Arduino Mega - they're only rated for 40mA each, maximum. Thus, you will need to use a transistor to switch power to the relay.

How many dpdt 5v relays can I power directly from the Arduino mega 2560?

Not many, and none at all unless they are the really small ones.

You will need to run the relays from a separate power supply (or from VIN if that's an appropriate level) and as mentioned drive them with transistors or driver chips.

Depending on the application it may be better to use transmission gates or FETs or for that matter a digital pot.


Rob

Sainsmart has 8 Inexpensive channel and 16 channel relay modules that will handle this.