I know I probably should post a schematic, but I think/hope this is a general question about how much power you can draw from an Arduino Nano...
Anyway, I'm doing a project, that involves 10 Takamisawa RY5W-K relays. I did most of the development/breadboarding on an 'genuine' Arduino Uno and everything seemed to work as expected.
But now I'm about to assemble the final standalone prototype, where I only have room for an Arduino Nano (from Gravitech, I think). I uploaded the code and all was fine: leds coming on and off, buttons worked etc.
But then I connected the relays, and suddenly I get erratic behavior: buttons sometimes don't activate and other weirdness too...
So I guess my question is: Is it at all possible to power 10 RY5W-K relays from a Nano? All 10 could even be 'on' simultaniously...
(note: its actually 8 'channels' - 6 mono and 2 stereo = 8 digital out pins)
I'm really not an electronics guy, but I know I could probably replace the relays with CMOS or FET variations, but this is an audio project, and I would really prefer to use mechanical relays.
So, I assume it's too much for a Nano, so my actual question is this:
Since the Arduino is to be powered be an external professional 9v power supply anyway, I wonder if I could power the relays from the main power supply too and then insert CMOS switches (controlled be the arduino) to power each relay on or off?
Would that work? if so, which CMOS switch should I get?
I doubt it, the regulator on the Nano is small, better to power the relays from
an external large 5V regulator or better still a 5V supply (USB charger?)
Add up the current for all the relays and make sure the power supply is greater
than the total.
and then insert CMOS switches (controlled be the arduino) to power each relay on or off?
No, you normally need a transistor to power a relay winding - if doing lots
you might consider a ULN2003 or similar chip to do lots in one package.
From a 9V supply the ULN2003 loses perhaps 1 to 1.5V, so relay windings rated
at 7.5V would be a straight match, but it will be easier to find 5V or 12V relays.
If switching audio analog signals you may need dual-rail capable CMOS switch/multiplexer,
since the audio signals are centred around ground potential. Relays do indeed avoid this
problem.
Almost any relay will require more current than can be drawn safely from the microcontroller. I hope you haven't damaged your MCU. Best practice is to limit pin current to 20mA, but there are also aggregate maximums per port so every pin cannot necessarily deliver 20mA simultaneously. See the datasheet for details.
I'm not familiar with your particular relays, and I didn't look them up, so I don't know what voltage and how much current they require, but the good news is that many relays can be driven using a simple bipolar junction transistor.
Simple one-relay circuit here. Note the flyback diode. This is included in the ULN2003 as already noted.
Again, i'm not an electronics guy (but rather software + musician), so please bear with me
(Btw: I already bought the mechanical relays, and according to the datasheet, they consume 150 mW.)
Anyway, I found this one: ULN2803 - 8 channel version of the ULN2003.
Seem to be the right size with 8 channels, but I'm just really unsure how to connect this.
I assume I feed 5v (from the external power supply) to the COM on the ULN - and then connect each arduino pin to the corresponding pin on the 2803? Would that do it?
No.
Feed the com to +5 and one end of each relay coil to the +5V as well.
Connect the other end of the coils to the outputs of the chip and finally the chip's ground to the arduino's ground.