Ks0251 keyestudio 4-channel Relay Shield: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[image:Ks0251 4-relay.png|thumb|800px|right|Keyestudio 4-channel Relay Shield]]
<br>
==Introduction==
==Introduction==
The keyestudio relay shield has integrated a 4-channel 5V relay module, which is fully compatible with UNO R3 control board.  
The keyestudio relay shield has integrated a 4-channel 5V relay module, which is fully compatible with [http://wiki.keyestudio.com/index.php/Ks0001_keyestudio_UNO_R3_BOARD UNO R3 control board]. The 4-channel relay on the shield is active at HIGH level. Separately connect the 4-channel relay to the digital port 4, 5, 6, 7 on the UNO R3 board, then through controlling output HIGH or LOW to control the relay on and off. <br>
The 4-channel relay on the shield is active at HIGH level. Separately connect the 4-channel relay to the digital port 4, 5, 6, 7 on the UNO R3 board, then through controlling output HIGH or LOW to control the relay on and off. <br>
<br>[[File:Ks0251 4-relay.png|500px|frameless|thumb]]<br>
 
==Specification==
<pre>
 
1.Working Style: high level is effective.
 
2.Contact Capacity: AC120V /3A
                    DC24V/3A
3.Weight: 39.4g


4.Size:69*53*27mm
<br>
==Features==
* The relay shield is 5V active HIGH
* Contact capacity: AC120V / 3A ;  DC24V/3A     
* Onboard LED indicator for relay output status
* Indicator: 4 LEDs are red when the relay is driven high, the corresponding indicator will light up.
* Standard interface can be directly connected with microcontrollers.
* Fully compatible with UNO R3 board
* Be able to control various appliances and other equipment with large current.
* 3 M3 screw positioning holes for easy installation
* Power Interface: 5V DC power interface
* Channel: 4 channel
* PCB Color: Black


5.Fully compatible with UNO R3 board
<br>
==Details==
* '''Size:''' 69mm*54mm*26mm
* '''Weight:''' 39.4g
[[Image:ks0251 dimensions.png|600px|frameless]]
<br>


6.Indicator LED onboard for Relay output status
==PINOUTS==
[[Image:ks0251 pinouts.jpg|800px|frameless]]
<br>
'''Relay Terminals:''' <br>
*Terminal high-power, high-current high voltage can be connected to the device.<br>
*When D4 is High, RELAY 4 turns on, LED4 lights up, COM4 and NO4 connected, COM4 and NC4 disconnected. If D4 is LOW, RELAY 4 turns off, LED4 not light, COM4 and NO4 disconnected, COM4 and NC4 connected. <br>
*When D5 is High, RELAY 3 turns on, LED3 lights up, COM3 and NO3 connected, COM3 and NC3 disconnected. If D5 is LOW, RELAY 3 turns off, LED3 not light, COM3 and NO3 disconnected, COM3 and NC3 connected. <br>
*When D6 is High, RELAY 2 turns on, LED2 lights up, COM2 and NO2 connected, COM2 and NC2 disconnected. If D6 is LOW, RELAY 2 turns off, LED2 not light, COM2 and NO2 disconnected, COM2 and NC2 connected. <br>
*When D7 is High, RELAY 1 turns on, LED1 lights up, COM1 and NO1 connected, COM1 and NC1 disconnected. If D7 is LOW, RELAY 1 turns off, LED1 not light, COM1 and NO1 disconnected, COM1 and NC1 connected.


</pre>
<br>


==Package Included==
==Hookup Guide==
Simply stack the shield on the [http://wiki.keyestudio.com/index.php/Ks0001_keyestudio_UNO_R3_BOARD  UNO board ].
<br>[[Image:ks0251 Connect.png|800px|frameless]]


1 x 4 Channel Relay Module
<br>


==Sample Code==
==Sample Code==
*How to download and install [http://wiki.keyestudio.com/index.php/How_to_Download_Arduino_IDE Arduino IDE] and [http://wiki.keyestudio.com/index.php/How_to_Install_Arduino_Driver driver].<br>
*[https://drive.google.com/open?id=1CR31iSw5coJIWzdxIYO2381jesIuTm__ Click here to download the code] or directly copy the code below to IDE.


<pre>
<pre>
int BASE = 4 ;  //The first relay is connected to the I / O port
int BASE = 4 ;  //The first relay is connected to the I / O port
int NUM = 4;  //Total number of relays
int NUM = 4;  //Total number of relays
void setup()
void setup()
{
{
Line 38: Line 59:
   }
   }
}
}
void loop()
void loop()
{
{
Line 47: Line 69:
   for (int i = BASE; i < BASE + NUM; i ++)  
   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.
     digitalWrite(i, HIGH);    //Set the number I/O port outputs to "high", that is, gradually turn on relay.
     delay(200);        //delay 0.2S
     delay(200);        //delay 0.2S
   }   
   }   
}
}
</pre>
[[Image:ks0251 upload.png|800px|frameless]]


</pre>
<br>


== Test Result ==
== Test Result ==
Stacking the keyestudio 4-channel relay shield on the keyestudio UNO R3 control board, burning the program, after connecting the electricity, the 4-channel relay is first connected, and then disconnected one after another, cycle alternately.
Done uploading the above code, you should see the 4-channel relay is first connected, and then disconnected one after another, repeatedly.
<br>[[Image:ks0251 Result.png|800px|frameless]]


<br>
==Resources ==
==Resources ==


'''PDF:''' <br>
'''Download the PDF file and code:''' <br>
https://drive.google.com/open?id=1yQsuD_PZcua1JsZxNUtyzAr6BCOev5Q7
 
https://fs.keyestudio.com/KS0251


'''VIDEO:''' <br>
'''VIDEO:''' <br>
http://www.keyestudio.com/wp/ks0251/
http://video.keyestudio.com/KS0251/
 
 
 
 
<br>


==Get One Now ==
==Get One Now ==
'''Official Website''' <br>
*[https://www.keyestudio.com/keyestudio-4-channel-5v-relay-shield-module-for-arduino-uno-r3-p0140.html    '''Official Website''']
http://www.keyestudio.com/ks0251.html
 
*[https://www.aliexpress.com/store/product/Keyestudio-4-channel-5V-Relay-Shield-module-for-Arduino-UNO-R3/1452162_32668782199.html?spm=2114.12010612.8148356.18.7902276fG5lTah  '''Shop on Aliexpress''']
 
*[https://www.ebay.com/itm/Keyestudio-4-Channel-5V-Relay-Module-for-Arduino-UNO-Mega-2560-Raspberry-Pi/132739030014?hash=item1ee7dcdbfe:g:86EAAOSwk6hbX6PT  '''Shop on eBay''']
 
*[https://www.amazon.com/dp/B07B2FTZD1  '''Shop on Amazon''']
 






[[Category: Shield]]
  [[Category: Shield]]

Latest revision as of 14:00, 6 January 2021

Keyestudio 4-channel Relay Shield


Introduction

The keyestudio relay shield has integrated a 4-channel 5V relay module, which is fully compatible with UNO R3 control board. The 4-channel relay on the shield is active at HIGH level. Separately connect the 4-channel relay to the digital port 4, 5, 6, 7 on the UNO R3 board, then through controlling output HIGH or LOW to control the relay on and off.


Features

  • The relay shield is 5V active HIGH
  • Contact capacity: AC120V / 3A ; DC24V/3A
  • Onboard LED indicator for relay output status
  • Indicator: 4 LEDs are red when the relay is driven high, the corresponding indicator will light up.
  • Standard interface can be directly connected with microcontrollers.
  • Fully compatible with UNO R3 board
  • Be able to control various appliances and other equipment with large current.
  • 3 M3 screw positioning holes for easy installation
  • Power Interface: 5V DC power interface
  • Channel: 4 channel
  • PCB Color: Black


Details

  • Size: 69mm*54mm*26mm
  • Weight: 39.4g

Ks0251 dimensions.png

PINOUTS

Ks0251 pinouts.jpg
Relay Terminals:

  • Terminal high-power, high-current high voltage can be connected to the device.
  • When D4 is High, RELAY 4 turns on, LED4 lights up, COM4 and NO4 connected, COM4 and NC4 disconnected. If D4 is LOW, RELAY 4 turns off, LED4 not light, COM4 and NO4 disconnected, COM4 and NC4 connected.
  • When D5 is High, RELAY 3 turns on, LED3 lights up, COM3 and NO3 connected, COM3 and NC3 disconnected. If D5 is LOW, RELAY 3 turns off, LED3 not light, COM3 and NO3 disconnected, COM3 and NC3 connected.
  • When D6 is High, RELAY 2 turns on, LED2 lights up, COM2 and NO2 connected, COM2 and NC2 disconnected. If D6 is LOW, RELAY 2 turns off, LED2 not light, COM2 and NO2 disconnected, COM2 and NC2 connected.
  • When D7 is High, RELAY 1 turns on, LED1 lights up, COM1 and NO1 connected, COM1 and NC1 disconnected. If D7 is LOW, RELAY 1 turns off, LED1 not light, COM1 and NO1 disconnected, COM1 and NC1 connected.


Hookup Guide

Simply stack the shield on the UNO board .
Ks0251 Connect.png


Sample 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 turn on relay.
     delay(200);        //delay 0.2S
   }  
}

Ks0251 upload.png


Test Result

Done uploading the above code, you should see the 4-channel relay is first connected, and then disconnected one after another, repeatedly.
Ks0251 Result.png


Resources

Download the PDF file and code:

https://fs.keyestudio.com/KS0251

VIDEO:
http://video.keyestudio.com/KS0251/




Get One Now