Arduino and relays - Page 1
Forum section: electronics / general

author: Flump
author_rank: Frequent Contributor
timestamp: February 06, 2015, 11:40:17 pm
content: Can I hook this up directly to an Arduino Uno ?http://www.ebay.co.uk/itm/351003594516It says it needs 50-60mah and I think thatson the limit of an Uno ?

author: dannyf
author_rank: Super Contributor
timestamp: February 06, 2015, 11:42:46 pm
content: Quote"mah" - nice spec,QuoteNo reason to guess - it is all in the datasheet.

author: mtdoc
author_rank: Super Contributor
timestamp: February 06, 2015, 11:49:14 pm
content: 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...

author: SL4P
author_rank: Super Contributor
timestamp: February 07, 2015, 12:18:39 am
content: The 50-60mA specis to pull in the relays(not the logic drive currentunless 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.

author: mtdoc
author_rank: Super Contributor
timestamp: February 07, 2015, 12:22:46 am
content: Quote from: SL4P on February 07, 2015, 12:18:39 amGood point and you're probably right but the listed specs do say: "5V 4-Channel Relay interface board, and each one needs 50-60mADriverCurrent"So maybe it is that poorly designed....

author: paulie
author_rank: Frequent Contributor
timestamp: February 07, 2015, 01:46:14 am
content: 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.

author: westfw
author_rank: Super Contributor
timestamp: February 07, 2015, 06:07:54 am
content: 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?)

author: Rick Law
author_rank: Super Contributor
timestamp: February 07, 2015, 06:41:02 am
content: Quote from: Flump on February 06, 2015, 11:40:17 pm(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 enoughto drive the coil. Thespecsheet of the relay said it takes 85-90mAfor 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 theblue jumper on the lowerleftrightin 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

author: SL4P
author_rank: Super Contributor
timestamp: February 07, 2015, 06:46:36 am
content: 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.

author: Rick Law
author_rank: Super Contributor
timestamp: February 07, 2015, 06:55:26 am
content: Quote from: SL4P on February 07, 2015, 06:46:36 amYou 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.)

author: picandmix
author_rank: Frequent Contributor
timestamp: February 07, 2015, 10:32:25 am
content: Quote from: Flump on February 06, 2015, 11:40:17 pmThe 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=6You 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

author: Rick Law
author_rank: Super Contributor
timestamp: February 07, 2015, 08:57:53 pm
content: Quote from: picandmix on February 07, 2015, 10:32:25 amJust 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. Thenominal current requirement is 89.3mAfor 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.

author: Flump
author_rank: Frequent Contributor
timestamp: February 08, 2015, 02:49:45 pm
content: thanks for your input guys