Page 1 of 1

Test of a Sain Smart 8 Relay Module Board with an Arduino Uno Board

Posted: Thu May 14, 2015 6:04 pm
by zappman
Test of a Sain Smart 8 Relay Module Board with an Arduino Uno Board
(Originally posted on the Savage///Circuits Forums December 27th, 2014, 06:04 PM by zappman)

Test of a Sain Smart 8 Relay Module Board part number 20-018-102 (ignore all the technical information here its wrong) with an Arduino Uno Board.

Link to part at Microcenter where I purchased the board for $11.99

To learn how to use this board, and how it works go to this link; http://arduino-info.wikispaces.com/ArduinoPower

*** Warning: Make sure you understand the correct operation of the Pins labeled "GND VCC JD-VCC" or you will damage your micro-controller board ***

Image

Image

Image

https://youtu.be/Yjw9HMGydHI

The Test Code

Code: Select all

/*
Test Program B Rev001 for the Sainsmart "5V 8-Channel Relay interface board" 20-018-102
Night Rider Chase Sequence Demo

This example code is in the public domain.

2014_12_13
by M. Sapp
*/
const int NbrRLYs = 8;
const int rlyPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
const int wait = 30; // 1000 = wait for a second

// this setup function runs once when you press reset or power the board
void setup(){

//When the baords power on or are reset, we want to ensure all relays are NOT energized
// To turn the Relays & LEDs off, a Logic High is needed on each input pin to the relay board
// Set the pins to Logic Highs

for (int rly = 0; rly < NbrRLYs; rly++)
{
digitalWrite(rlyPins[rly],HIGH); //relay IN8, Right most thru relay IN0, Left most
pinMode(rlyPins[rly],OUTPUT); //relay IN8, Right most thru relay IN0, Left most // initialize digital pins as an outputs.
}

}

// this loop function runs over and over again forever
void loop() {

for (int rly = 0; rly < NbrRLYs-1; rly++)
{
digitalWrite(rlyPins[rly], LOW);
delay(wait);
digitalWrite(rlyPins[rly+1], LOW);
delay(wait);
digitalWrite(rlyPins[rly], HIGH);
delay(wait*2);
}

for (int rly = NbrRLYs-1; rly > 0; rly--){
digitalWrite(rlyPins[rly], LOW);
delay(wait);
digitalWrite(rlyPins[rly-1], LOW);
delay(wait);
digitalWrite(rlyPins[rly], HIGH);
delay(wait*2);
}

}

Re: Test of a Sain Smart 8 Relay Module Board with an Arduino Uno Board

Posted: Thu May 14, 2015 6:38 pm
by Sparky
(Originally posted on the Savage///Circuits Forums December 28th, 2014, 06:47 PM by Chris Savage)

I will check it out tonight. I did watch the video though. Looks like the relays are driven by optos?

Re: Test of a Sain Smart 8 Relay Module Board with an Arduino Uno Board

Posted: Thu May 14, 2015 6:42 pm
by zappman
Chris Savage wrote:(Originally posted on the Savage///Circuits Forums December 28th, 2014, 06:47 PM by Chris Savage)

I will check it out tonight. I did watch the video though. Looks like the relays are driven by optos?


Yes the relays are driven by optos, but the inputs to the 8 optos are wired strangely.
The 8 mechanical relays energize when a logic '0' is input to the boards input pin(s).
For the $11.99 I paid for this board at a local store, I consider it a terrific bargain.
I have not yet tested the contacts of the mechanical relays.

*** Warning: Make sure you understand the correct operation of the Pins labeled "GND VCC JD-VCC" or you will damage your micro-controller board ***