Go Down

Topic: can UNO digital out pins drive 8 channel relay? (Read 2705 times) previous topic - next topic

doughboy

I am thinking of using an 8 channel relay like this

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=110836428701

to turn on/off power outlets.
the spec says it take 15-20ma to drive the relay.

my question is, will the arduino be able to drive all 8 channels high at the same time (so total 160ma) just by connecting the digital out pin without additional circuit?  assuming my power supply has enough amps of course. is that fine with the atmega328 or is it too much to handle. the atmega328 spec says the digital out can drive 40ma, but I don't know if that means one pin at a time or it can drive all pins at 40ma simultaneously.

or is there a better way to turn on/off 8 outlets. I basically need an 8 outlet timer, that can turn on then off down to 1 second.

thanks
jerry

cmagagna

I think you would be fine. The spec sheet says the ATMega328 can handle about 200 mA so as long as you're not hanging too much more off the chip then you're within the tolerances.

Good luck!

CrossRoads

To improve on the answer: Yes, but you may have to watch out how many outputs on 1 port are connected to the relay.

Read the Notes to the tables in Section 29 of the '328 datasheet:

Notes: 1. "Max" means the highest value where the pin is guaranteed to be read as low
2. "Min." means the lowest value where the pin is guaranteed to be read as high
3. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
conditions (non-transient), the following must be observed:
ATmega48A/PA/88A/PA/168A/PA/328/P:
1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
If IIOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current
greater than the listed test condition.
4. Although each I/O port can sink more than the test conditions (20 mA at VCC = 5V, 10 mA at VCC = 3V) under steady state
conditions (non-transient), the following must be observed:
ATmega48A/PA/88A/PA/168A/PA/328/P:
1] The sum of all IOL, for ports C0 - C5, ADC7, ADC6 should not exceed 100 mA.
2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100 mA.
3] The sum of all IOL, for ports D0 - D4, RESET should not exceed 100 mA.
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
than the listed test condition.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

E40racer

What happens if you source to much current from the output pins? Does the chip just give the maximum it can source or do you risk destroying the pins or even the microcontroller?
www.bajdi.com

doughboy

thanks for the detailed reply.

I just realized now after checking the ebay listing again that the inputs are optically isolated, so it should be ok. I just need to power the relay board with a +5, and will probably be the same power from the arduino board. Now I can't seem to find any spec on the UNO board +5 output.

CrossRoads

@bajdi,
You risk damaging one or more pins, and up to destroying the chip.

@doughboy,
If powering from USB, limit is 500mA. Onboard Polyfuse should kick in, or PCs source may shutdown (or be damaged).
If powering from external regulator, limit is may 600-700mA depending on how high voltage being regulated is and what other IO is doing. 12V, 700mA for example, the regulator may overheat and go into thermal shutdown.
If powering from an external 5V source via 5V header pin, limit is maybe 1A, driven by the physical pin itself.  That bypasses the reverse polarity proteciton diode, be sure not to get 5V and Gnd swapped.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up