รู้จักสินค้านี้
รีเลย์แบบ 4 ช่อง 5V relay module optocoupler isolation high and low level trigger MCU red board
โมดูลรีเลย์บอร์ดแดง ที่ใช้ตัดต่อไฟเลี้ยงแบบ AC ได้ถึง 250V 10A หรือ DC ได้ถึง 30V 10A
ตัวอย่าง Code Relay 4 ช่อง ด้วย Arduino
/**
* www.arduinona.com
* ตัวอย่าง code ควบคุมรีเลย์ 4 ช่อง
* ด้วย Arduino
* Arduino - Relay 4ch
* 5V - VCC
* 3 - IN1
* 4 - IN2
* 5 - IN3
* 6 - IN4
* GND - GND
*/
void setup() {
pinMode(3, OUTPUT); //ตั้งขาสัญญาณ 3 เป็น Output
pinMode(4, OUTPUT); //ตั้งขาสัญญาณ 4 เป็น Output
pinMode(5, OUTPUT); //ตั้งขาสัญญาณ 5 เป็น Output
pinMode(6, OUTPUT); //ตั้งขาสัญญาณ 6 เป็น Output
}
void loop() {
digitalWrite(3, HIGH); //จ่าย logic HIGH ให้ 3
delay(1000); //หน่วงเวลา 1 วินาที
digitalWrite(3, LOW); //จ่าย logic LOW ให้ 3
delay(1000);
digitalWrite(4, HIGH);
delay(1000);
digitalWrite(4, LOW);
delay(1000);
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(6, HIGH);
delay(1000);
digitalWrite(6, LOW);
delay(1000);
}
ตัวอย่าง Code Relay 4 ช่อง ด้วย ESP8266
/**
* www.arduinona.com
* ตัวอย่าง code ควบคุมรีเลย์ 4 ช่อง
* ด้วย esp8266
*
* หากใช้เวอร์ชั่น Nodemcu v2, v3 ให้เลือก Tools- Board-Nodemcu 1.0
* เพื่อให้ระบบเจอขา D0 D1 D2 D3
*/
void setup() {
pinMode(D0, OUTPUT); //ตั้งขาสัญญาณ D0 เป็น Output
pinMode(D1, OUTPUT); //ตั้งขาสัญญาณ D1 เป็น Output
pinMode(D2, OUTPUT); //ตั้งขาสัญญาณ D2 เป็น Output
pinMode(D3, OUTPUT); //ตั้งขาสัญญาณ D3 เป็น Output
}
void loop() {
digitalWrite(D0, HIGH); //จ่าย logic HIGH ให้ D0
delay(1000); //หน่วงเวลา 1 วินาที
digitalWrite(D0, LOW); //จ่าย logic LOW ให้ D0
delay(1000);
digitalWrite(D1, HIGH);
delay(1000);
digitalWrite(D1, LOW);
delay(1000);
digitalWrite(D2, HIGH);
delay(1000);
digitalWrite(D2, LOW);
delay(1000);
digitalWrite(D3, HIGH);
delay(1000);
digitalWrite(D3, LOW);
delay(1000);
}
Module description:
1. the module adopts good quality relay, which often opens the maximum load of interface: AC 250V/10A, DC 30V/10A;
2. using the patch optocoupler isolation, the driving ability is strong, the performance is stable, the trigger current 5mA;
3. The operating voltage of the module is 5V, 9V, 12V and 24V.
4. the module can be triggered by high level or low level by the jump line.
5. Fault-tolerant design, even if the control line is broken, the relay will not move.
6. power indicator light (green), relay status indicator (red)
7. The interface design is humanized. All interfaces can be connected by connection terminals directly. It is very convenient.
8. Size: 73x50x18mm
9. Weight: 60g
High and low level trigger selection end:
1. S1 is the selection of high and low level triggering for 1 - way relay.
2. S2 is the selection of high and low level triggering for 2 - way relay.
3. com and low short connection, the corresponding relay is low level trigger, COM and high end short connection is high level trigger