KS0212 keyestudio RPI 4-channel Relay Shield: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
==keyestudio RPI 4-channel Relay Shield==
 
<br>
==Introduction==
This shield uses SONGLE relay, providing 4-channel input and output. The relays are isolated in the PCB. All the channels can control up to 24V DC or 250V AC on 10 A. It allows you to control high power components like lights and motors via Raspberry Pi 3. Just plug it directly into your pi with 5 V. You will find a LED indicates the status of the relays. <br>
We will provide installation package, source code and quickstart guide PDF. We will teach you step by step, so don’t worry! <br>
<br>[[File:ks0212-1.png|500px|frameless|thumb]]<br>
<br>[[File:ks0212-1.png|500px|frameless|thumb]]<br>


==Introduction==
This shield uses SONGLE relay, providing 4-channel input and output. The relays are isolated in the PCB. All the channels can control up to 24V DC or 250V AC on 10 A. It allows you to control high power components like lights and motors via Raspberry Pi 3. Just plug it directly into your pi with 5 V. You will find a LED indicates the status of the relays. We will provide installation package, source code and quickstart guide PDF. We will teach you step by step, so don’t worry!<br>


<br>
==Specification==
==Specification==
* Control Signal: TTL Level
* Control Signal: TTL Level
* Rated Load:
* Rated Load:
10A 250VAC  <br>
  10A 250VAC  <br>
10A 125VAC    <br>
  10A 125VAC    <br>
10A 30VDC    <br>
  10A 30VDC    <br>
10A 28VDC  <br>
  10A 28VDC  <br>
* Rated Current: 10A(NO)  5A(NC)
* Rated Current: 10A(NO)  5A(NC)
* Max Switching Voltage: 250VAC  30VDC
* Max Switching Voltage: 250VAC  30VDC
* Contact Time: under 10ms
* Contact Time: under 10ms
<br>


==Connection Diagram ==
==Connection Diagram ==
The shield is on the top of Raspberry Pi board and fixed with copper pillar and screws as shown in below figure.
The shield is on the top of Raspberry Pi board and fixed with copper pillar and screws as shown in below figure.<br>
<br>[[File:ks0212-2.png|500px|frameless|thumb]]<br>
<br>[[File:ks0212-2.png|500px|frameless|thumb]]<br>


<br>
==Sample Code==
==Sample Code==
<pre>
<pre>
Line 51: Line 57:
</pre>
</pre>


<br>
==Program Writing==
==Program Writing==
1. Copy the rpi_relay_4 file and put it into the rpi_shield file through winSCP. Next, type this command: '''cd rpi_relay_4''' to go inside the rpi_relay_4 folder. Then type this command: '''make''' to make an executable file relay as shown in below figure. <br>
<br>[[File:ks0212-3.png|700px|frameless|thumb]]<br>
<br>
2. Finally type this: '''sudo ./relay''' to launch the program. <br>
<br>[[File:ks0212-4.png|700px|frameless|thumb]]<br>


1. Copy the rpi_relay_4 file and put it into the rpi_shield file through winSCP. Next , type this command: cd rpi_relay_4 to go inside the rpi_relay_4 folder. Then type this command: make  to make an executable file relay as shown in below figure.
<br>
<br>[[File:ks0212-3.png|500px|frameless|thumb]]<br>
 
2. Finally type this: sudo ./relay to launch the program.
<br>[[File:ks0212-4.png|500px|frameless|thumb]]<br>


==Result==
==Result==
Relays are turned on in sequence and then after a short pause turned off in sequence. Then use Ctrl+C to quit the program.   
Relays are turned on in sequence and then after a short pause turned off in sequence. Then use '''Ctrl+C''' to quit the program.  <br>


<br>
== Resources ==
== Resources ==
'''PDF File:'''
* '''PDF File:'''<br>
https://drive.google.com/open?id=1SBrxGLsXen0IcSGLF7Gk7z_OM_N-elyk
 
* '''Installation Package:'''<br>
https://drive.google.com/open?id=1RWsPq3KBYIdtv44p52X4WWfGmypBJ0zg


https://drive.google.com/open?id=1H_C0OvCc10Dyx4a2d2QJEp8MKkg47E8g
* '''Source Code:'''<br>
https://drive.google.com/open?id=12WtlCJaByyWWgOqqVe59q5dPwy5O0PPe


'''Installation Package:'''


https://drive.google.com/open?id=1RWsPq3KBYIdtv44p52X4WWfGmypBJ0zg
<br>


'''Source Code:'''
== Get One Now ==


https://drive.google.com/open?id=12WtlCJaByyWWgOqqVe59q5dPwy5O0PPe
*[https://www.keyestudio.com/keyestudio-rpi-4channel-relay-5v-shield-for-raspberry-pi-ce-certification-p0475-p0475.html  Official website ]


== Get One Now ==
*[https://www.aliexpress.com/store/product/Keyestudio-RPI-4channel-Relay-5V-Shield-for-Raspberry-Pi/1452162_32780156359.html?spm=2114.12010612.8148356.17.6e9660ffsewRl7  '''Shop on aliexpress''' ]
http://www.keyestudio.com/keyestudio-rpi-4-channel-relay-shield.html




[[Category:Raspberry Pi]]
[[Category:Raspberry Pi]]

Revision as of 10:33, 19 April 2019


Introduction

This shield uses SONGLE relay, providing 4-channel input and output. The relays are isolated in the PCB. All the channels can control up to 24V DC or 250V AC on 10 A. It allows you to control high power components like lights and motors via Raspberry Pi 3. Just plug it directly into your pi with 5 V. You will find a LED indicates the status of the relays.
We will provide installation package, source code and quickstart guide PDF. We will teach you step by step, so don’t worry!

thumb



Specification

  • Control Signal: TTL Level
  • Rated Load:
 10A 250VAC   
10A 125VAC
10A 30VDC
10A 28VDC
  • Rated Current: 10A(NO) 5A(NC)
  • Max Switching Voltage: 250VAC 30VDC
  • Contact Time: under 10ms


Connection Diagram

The shield is on the top of Raspberry Pi board and fixed with copper pillar and screws as shown in below figure.

thumb


Sample Code

#include <wiringPi.h>
int main()
{
  wiringPiSetup();

  pinMode(7,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(22,OUTPUT);
  pinMode(25,OUTPUT);
  printf("relay testing!\n");
  while(1)
  { 
        digitalWrite(7,HIGH);
        delay(500);
        digitalWrite(7,LOW);
        digitalWrite(3,HIGH);
        delay(500);
        digitalWrite(3,LOW);
        digitalWrite(22,HIGH);
	delay(500); 
        digitalWrite(22,LOW);
	digitalWrite(25,HIGH);
	delay(500);
	digitalWrite(25,LOW);
	delay(500); 
  }	
}


Program Writing

1. Copy the rpi_relay_4 file and put it into the rpi_shield file through winSCP. Next, type this command: cd rpi_relay_4 to go inside the rpi_relay_4 folder. Then type this command: make to make an executable file relay as shown in below figure.

thumb

2. Finally type this: sudo ./relay to launch the program.

thumb


Result

Relays are turned on in sequence and then after a short pause turned off in sequence. Then use Ctrl+C to quit the program.


Resources

  • PDF File:

https://drive.google.com/open?id=1SBrxGLsXen0IcSGLF7Gk7z_OM_N-elyk

  • Installation Package:

https://drive.google.com/open?id=1RWsPq3KBYIdtv44p52X4WWfGmypBJ0zg

  • Source Code:

https://drive.google.com/open?id=12WtlCJaByyWWgOqqVe59q5dPwy5O0PPe



Get One Now