Ks0251 keyestudio 4-channel Relay Shield

From Keyestudio Wiki
Revision as of 17:50, 27 July 2017 by Keyestudio (talk | contribs) (Created page with "==keyestudio 4-channel Relay Shield== <br>500px|frameless|thumb<br> ==Introduction== Keyestudio 4-channel relay shield will integrate 4-channel 5V rel...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

keyestudio 4-channel Relay Shield


thumb

Introduction

Keyestudio 4-channel relay shield will integrate 4-channel 5V relay module, which is fully compatible with keyestudio UNO R3 control board. It can work through stacking shield on the keyestudio UNO R3 control board, which is very easy and convenient. The 4-channel relay of shield is for high level effectively. And 4-channel relay control port should respectively connect with the digital port 4, 5, 6, 7 which is on the keyestudio UNO R3 control board. We only need to control the high and low level outputs of digital port 4, 5, 6, 7 on the 4-channel relay, which can achieve to control the relay switch.

Specification

Working style: high level is effective Contact capacity: AC120V / 3A

              DC24V/3A  


Code

int BASE = 4 ; //The first relay is connected to the I / O port int NUM = 4; //Total number of relays

void setup() {

  for (int i = BASE; i < BASE + NUM; i ++) 
  {
    pinMode(i, OUTPUT);   //Set the number I/O port to outputs
  }

}

void loop() {

  for (int i = BASE; i < BASE + NUM; i ++) 
  {
    digitalWrite(i, LOW);    //Set the number I/O port outputs to "low", that is, gradually turn off the relay.
    delay(200);        //delay 0.2S
  }
  for (int i = BASE; i < BASE + NUM; i ++) 
  {
    digitalWrite(i, HIGH);    //Set the number I/O port outputs to "high", that is, gradually open relay.
    delay(200);        //delay 0.2S
  }  

}

Resources

Datasheet

http://www.keyestudio.com/files/index/download/id/1464579818/ (wufajiazai)

Get One Now

http://www.keyestudio.com/catalogsearch/result/?q=ks0251