Author Topic: Arduino and relays  (Read 5272 times)

0 Members and 1 Guest are viewing this topic.

Offline FlumpTopic starter

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: gb
Arduino and relays
« on: February 06, 2015, 11:40:17 pm »
Can I hook this up directly to an Arduino Uno ?
http://www.ebay.co.uk/itm/351003594516

It says it needs 50-60mah and I think thats
on the limit of an Uno ?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Arduino and relays
« Reply #1 on: February 06, 2015, 11:42:46 pm »
Quote
it needs 50-60mah

"mah" - nice spec, :)

Quote
I think thats
on the limit of an Uno ?

No reason to guess - it is all in the datasheet.

================================
https://dannyelectronics.wordpress.com/
 

Offline mtdoc

  • Super Contributor
  • ***
  • Posts: 3575
  • Country: us
Re: Arduino and relays
« Reply #2 on: February 06, 2015, 11:49:14 pm »
The Uno datasheet says 40ma per I/O pin and that relay board says it needs 50-60 ma per relay so I think not.

You could do it with a voltage follower buffer circuit for each though...
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Arduino and relays
« Reply #3 on: February 07, 2015, 12:18:39 am »
The 50-60mA spec is to pull in the relays (not the logic drive current unless it's REALLY poorly designed!)

The control inputs will be fine with any micro (including Arduino), but make sure the relay +5Vcc is sourced from your 'dirty supply' - not the Arduino board itself.  It looks  like they give you a VCC link to separate the two rails - if you work that way.

0V/GND is common to the logic and the relays.  You may want to add a couple of uF to keep the 5V rail clean during relay operation.

Don't ask a question if you aren't willing to listen to the answer.
 

Offline mtdoc

  • Super Contributor
  • ***
  • Posts: 3575
  • Country: us
Re: Arduino and relays
« Reply #4 on: February 07, 2015, 12:22:46 am »
The 50-60mA spec is to pull in the relays (not the logic drive current unless it's REALLY poorly designed!)

Good point and you're probably right but the listed specs do say: "5V 4-Channel Relay interface board, and each one needs 50-60mA Driver Current"

So maybe it is that poorly designed.... :-//
« Last Edit: February 07, 2015, 12:24:19 am by mtdoc »
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Arduino and relays
« Reply #5 on: February 07, 2015, 01:46:14 am »
I've had no problem getting enough drive current out of an m8 and m328 pin to drive a small motor or relay directly. Measured milliamps usually about twice spec. Resetting the AVR due to back EMF a different story. In those cases a diode and/or small cap fixed that.

There's also the trick of using more than one pin to drive a bigger coil. Rarely had to resort to that though.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4416
  • Country: us
Re: Arduino and relays
« Reply #6 on: February 07, 2015, 06:07:54 am »
The picture shows optoisolators and transistors in between the inputs and the relays, so you probably only need 5-20mA to drive the optoisolators.  OTOH, I also don't see current limiting resistors on the optoisolator inputs, so you might need them externally.
(Isn't working with a poorly documented piece of hardware great fun?)
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3511
  • Country: us
Re: Arduino and relays
« Reply #7 on: February 07, 2015, 06:41:02 am »
Can I hook this up directly to an Arduino Uno ?
http://www.ebay.co.uk/itm/351003594516

It says it needs 50-60mah and I think thats
on the limit of an Uno ?

(1) Yes, you can drive control it directly by the Arduino.  As said, 50-60mA is to run the coil.  The DigitalOut pins can turn on the opto (that switches the coil) no problem.  (EDIT: adding this: I have not been using current limiter, that probably shorten the life if run too long that way.  A current limiting resister there is a good idea.)

(2) Number is wrong.  50-60mA is NOT enough to drive the coil.  The specsheet of the relay said it takes 85-90mA for the coil.  From actual measurement of a two rely unit, it takes APPROX 75mA each relay (including transistor LED, etc).  You should plan according to specsheet, allocate 85-90mA for the coil. If you run all four, you are talking a total of about 400mA. (or to be cheap, I measure it to be 75, at 75mA*4=300mA, but that is playing the margines.)

You should use an external power source.  (For a full size Arduino like the UNO, you can drive two.  Three would be too much.  I am not sure the NANO has enough power to drive two.)

(3) You see the blue jumper on the lower left right in the picture - JD-VCC&VCC.  If you pull that jumper, you can supply the coil's power at the JD-VCC pin.  The jumper there connects JD-VCC directly to VCC.  JD-VCC is the coil part (the coil side of the opto); VCC drives the MCU side of opto, the led, and all that good stuff.

(4) This could cause you to panic until you realize it.  I initially thought the unit didn't work.  With my two rely unit, LOW is when the LED is ON!  Yours should be the same.  LOW=on, HIGH=off.

Good luck,
Rick
« Last Edit: February 07, 2015, 07:22:00 am by Rick Law »
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Arduino and relays
« Reply #8 on: February 07, 2015, 06:46:36 am »
One option (not a lot of help to newbies) is using PWM to pull in the relays - with 80-100% duty cycle for around 20mS, then reduce to maybe 20% PWM to hold the  coil.

Mechanical relays need significantly more current to pull-in than they do to hold - so this is a completely valid method to reduce overall consumption - as well as offsetting/staggering the pull-in when multiple relay are turned on - to spread the peak current drawn.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3511
  • Country: us
Re: Arduino and relays
« Reply #9 on: February 07, 2015, 06:55:26 am »
One option (not a lot of help to newbies) is using PWM to pull in the relays - with 80-100% duty cycle for around 20mS, then reduce to maybe 20% PWM to hold the  coil.

Mechanical relays need significantly more current to pull-in than they do to hold - so this is a completely valid method to reduce overall consumption - as well as offsetting/staggering the pull-in when multiple relay are turned on - to spread the peak current drawn.

You are right!

Another (probably easier) idea is: don't turn them on at once.  Do a delay(10) before switching on the next relay.  (Actually, I have to review the spec sheet again to see how long does it takes to trigger.  Without re-reading the specs, delay(100) would probably be better.)
« Last Edit: February 07, 2015, 07:24:31 am by Rick Law »
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Arduino and relays
« Reply #10 on: February 07, 2015, 10:32:25 am »
Can I hook this up directly to an Arduino Uno ?
http://www.ebay.co.uk/itm/351003594516

It says it needs 50-60mah and I think thats
on the limit of an Uno ?

The seemingly same board available here in the UK, as they state can be driven direct from your Arduino, they would not be selling them if they were not suitable.
http://hobbycomponents.com/relays/75-4-channel-5v-relay-module-expansion-board?search_query=relay+board&results=6

You do not mention what load you are using on the relays , mains or DC but if its low current mains ( under 2 amps ) then something like these triac boards create less interference.
Available in 2 ,4 and 8 modules on ebay etc

 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3511
  • Country: us
Re: Arduino and relays
« Reply #11 on: February 07, 2015, 08:57:53 pm »
Can I hook this up directly to an Arduino Uno ?
http://www.ebay.co.uk/itm/351003594516

It says it needs 50-60mah and I think thats
on the limit of an Uno ?

The seemingly same board available here in the UK, as they state can be driven direct from your Arduino, they would not be selling them if they were not suitable.
http://hobbycomponents.com/relays/75-4-channel-5v-relay-module-expansion-board?search_query=relay+board&results=6

..


Just so there is no misunderstanding.  It is suitable for the Arduino and it is just plug in and go.  It just needs external power to operate four and the board has provision to power the coils externally.

By the way, I recheck the relay spec sheet.  The nominal current requirement is 89.3mA for the 5V version.  The 50-60mA part is incorrect.  It may be 50-60mA for a different relay, but not the Songle relay pictured.

The Arduino UNO can drive 2 relays fine, but three would be pushing it, and four would be wishful thinking.  Of the 500mA max USB can provide, with 4 relays taking almost 400mA out for the relay board will leave little for the MCU and everything else.
 

Offline FlumpTopic starter

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: gb
Re: Arduino and relays
« Reply #12 on: February 08, 2015, 02:49:45 pm »
thanks for your input guys :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf