# Help understanding relay datasheet?

For the 2nd time, I already ordered a relay module w/o first reading and UNDERSTANDING the datasheet, so now I am tasked to ensure that when my 8 channel relay module arrives, I will be able to safely connect it to my Mega (+ 3 shields) w/o fearing that I will fry my boards.

HERE is the link to the datasheet of the relays used. Also to note, I know absolutely nothing about Arduino and electronics save for what I was able to learn on the web for free, so my knowledge is a constant (free) work in progress. With that said, I know there are mathematical ways of determining ratings based on other numbers given, but I don’t know any of those conversions and was hoping someone could help?

Another note is that I am much more knowledgeable of AC circuitry than DC. I know that my meager 60amp service panel can not have more than 60 amps being drawn from it at any one given moment in time or the master will trip and the house w/o power. I know this same concept applies to my Arduino in that no more than 20 mA per pin, or 200mA can be sourced from the Mega lest it also fails.

So I am on a quest to ascertain what I need to do to safely power and control THIS 8 channel relay board → http://www.gearbest.com/development-boards/pp_29436.html?currency=USD&gclid=CjwKEAiAlvilBRC5ueCzkpXb4kgSJADxop1BQHiCFI5PoS2Gmp2bnJDlgFy1cGucChdzfyxg1gnNwRoC4Bvw_wcB ← I guess new members can only hyperlink a single instance?

Back to the datasheet, the relay ratings are given in “nominal voltages” and “coil resistance”. Can someone please share the process one needs to find out these numbers so I can determine if my modules are plug and play, or whether other components need to first be breadboarded after an external power supply? I have accumulated several wall warts and have a 5V1A, 9V210mA, 9V1A, 12V210mA, 12V1A and a 12V2A, so I hope to at least hit the ground running as far as external power is concerned.

I also saw on another thread a suggestion to use a 12V power source and use a heat sinked 7805 regulator to decrease voltage. I was able to salvage a 7805P and a 7809P which I hope might fit the bill if that route is my only one.

Any help, or other suggestions are most welcomed. I am building a multi room hydroponics controller and will be extensive when I complete it hopefully in the next 3 years. Any info that leads me in the direction of learning what is needed to accomplish this end goal is what I ultimately seek from my world wide web.

Thank you all

Looks like you'll need a 5V power source. The 5V coil has 70 ohm resistance, thus it needs 5V/70ohm = 72mA to turn it on, x 8 = 570mA if all 8 are to be on, more than Arduino board can supply without overheating the 5V regulator. http://www.datasheet4u.com/download_new.php?id=789549

Assuming there are transistors on the board already to drive the coils, can't tell from the pictures, you would only need to connect 8 output pins and Gnd to the board, then the drive the pins high or low as needed.

I know this same concept applies to my Arduino in that no more than 20 mA per pin, or 200mA can be sourced from the Mega lest it also fails.

Mega has 4 Vcc pins, each can handle 200mA, so the Mega IO can handle 800mA of output current. It must be spread across the pins as noted in 31.1 of the datasheet. Also, the 5V regulator will probably overheat trying to supply that much current. And USB is limited to 500mA. So there are other practical limits to reaching 800mA.

Thank you for the quick and informative reply CrossRoads! So then is the formula of finding the current ohms/volts=amps?

Also, being as though I have a 5V 1A wall wart, do you think I can power the relay and the meg +3 shields?

Yes, Ohms Law, Voltage = Current x Resistance, V=IR
Or, V/R = I
If you know 2, you solve for the 3rd.

I don’t see how a 1000mA (1A) wallwart could supply power for more than 14 relays being turned on at once, spread over 2 or 3 8-relay cards. I think you’d want a 2A supply:
http://www.dipmicro.com/store/DCA-0520
and make up a 1 to 3 splitter cable.

Oh, I'm sorry, I clearly miscommunicated a detail. The 3 shields are a data logging shield with RTC and SD, an Ethernet Shield and a sensor shield. I currently have a servo shield to play around with, but was unable to find out if it can function as a sensor shield so I'll just order one of those. I was told on another forum that the sensor shield can add IO and control the relays and some other stuff.

But for now, it's just the one 8 channel relay board the the arduino and shields are to control. By chance, have you come across any timed relay sketches that use an RTC?

Thanks for all the guidance!

I have not. Don’t imagine it would be difficult. You read the RTC on a continual basis, when time returned is >= the time you are looking for, you start an action, and start looking for the next time.
When the time returned is >= the next time you are looking for, you start another action, stop a previous one, etc,
You could do it with a couple of arrays, one with the times to be acted on, the second with bits to set the relays open/closed with.
The first might be unsigned long with AM/PM, tens hrs, one hrs, tens minutes, one minutes, tens seconds, ones seconds, using the same format as the RTC stores them (4 bits each typically), and
then a byte for the relay states, 0b00000001, where 1 is relay closed and 0 = relay open.

Once a second then, trigger with the 1 second square wave from the RTC:

// pseudocode example
if (one second elapsed){
if (RTC time >= timeArray[arrayPointer]){
update relays from relayArray[arrayPointer]
arrayPointer = arrayPointer +1; // point to time for next event
if (arrayPointer == 8){ // reset after events 0 to 7, or however many occur
arrayPointer = 0;
}
}
}

Thanks again for the lesson CrossRoads! I've been researching arrays these past few days and though I am yet to write one myself, I have a generalized concept of how they work, and how they use way less lines of code than otherwise would be needed. However, all the tutorials I've found only deal with a single array. Can you share some example code or point me to a multi array thread or tutorial? Also, does the code need to always comprehend and internalize the RTC? Is this wasteful in terms of memory used? Don't get me wrong, I want to get the relays controlling some AC circuits asap, but shortly after that milestone for me I will be expanding my project to include much more and I fear that the master sketch will become too bloated.

I want to learn as much as I can about this programming language so that when I have to go back and start writing basic stuff, I will have a much fuller understanding of what it is I would then be writing.

what I need to do to safely power and control THIS 8 channel relay board

If the relay board is optically isolated like in the below schematic, then the mega pins probably can support driving the optical isolators on the relay board. If this is the case, then a pc power supply might be an inexpensive way to power the relay board with 5v.

See this topic, especially 2nd page. I can post the code the youtube video is running later. http://forum.arduino.cc/index.php?topic=276450.15

zoomkat: If the relay board is optically isolated like in the below schematic, then the mega pins probably can support driving the optical isolators on the relay board. If this is the case, then a pc power supply might be an inexpensive way to power the relay board with 5v.

Wouldn't optical isolation still require external power to source the other side of the optocoupler?

I have a 750 watt Dell power supply that is ready to be turned into a benchtop power. If for instance it was only sourcing a couple hundred mA and a few volts, would the whole unit still be consuming all 750 watts? Or is the ATX only consuming the amount of current needed to source to the load(s)?

The reason I ask is because I am on a very tight current budget at my main service panel and have to count amps on every larger load device. If the ATX is consuming 750 watts and only sourcing a couple hundred mA, I would then need to get me a different, better suited power supply.

Wouldn't optical isolation still require external power to source the other side of the optocoupler?

Yes, the relays require electrical power to operate. If the relays require ~100ma each to operate, then an inexpensive 1A 5v wall wart might power all of them.

myggle: I have a 750 watt Dell power supply that is ready to be turned into a benchtop power. If for instance it was only sourcing a couple hundred mA and a few volts, would the whole unit still be consuming all 750 watts? Or is the ATX only consuming the amount of current needed to source to the load(s)?

It won't approach 750W of input consumption till it's running 750W on the output. It may be that it won't regulate, operate properly, without a minimum load on the 5V (which could be a couple of bulbs or some resistors that keep a minimum current draw going.)

Thanks Pancake! Would you advise grouping all of the different voltages together within their class, ie all the 5v together, all the 3.3v together, +12v together and -12together? I would think the ATX would be more useful when left not bundled, as I would think each wire may have different current ratings. Can you share more insights? Thank you

myggle: Thanks Pancake! Would you advise grouping all of the different voltages together within their class, ie all the 5v together, all the 3.3v together, +12v together and -12together? I would think the ATX would be more useful when left not bundled, as I would think each wire may have different current ratings. Can you share more insights? Thank you

Each "class" ties back to the same point inside the ATX (unless they are actually different, "5V1", "5V2" and so on.) You can everify that with an ohmmeter (ATX powered off and discharged.) If you were going to draw the rated current from an output having a number of wires then you should use all of those wires, you shouldn't draw rated current from one wire if there are several. dangerousprototypes.com features a board that accepts the ATX connector/s and has the outputs available on banana jacks. That board (interface) may be available from other suppliers.

Adding link http://dangerousprototypes.com/2015/01/09/atx-breakout-board-bench-power-supply-back-in-stock-6/ The copy states that it has 1A polyfuses on each output. If you want more then you'll have to source higher-rated fuses - or jumper them out.