Codey OnlineArduino- & ESP32-Komponentenbibliothek › 3-Channel 5V Relay Module
3-Channel 5V Relay Module
Ausgabe

3-Channel 5V Relay Module

Dies ist ein Relaismodul, um externe Lasten von einem Mikrocontroller über digitale Eingangspins zu steuern. Es wird über VCC und GND versorgt, und die Relaiskanäle werden über die IN-Pins für galvanisch getrenntes Ein- und Ausschalten von Schaltungen mit höherer Leistung angesteuert.

Breite: 50.6 mm

Pinbelegung — 3-Channel 5V Relay Module

Pin Signal Beschreibung
GND ground Logic ground reference for the relay module control inputs
IN1 digital Active-low control input for relay 1 — drive low to energize
IN2 digital Active-low control input for relay 2 — drive low to energize
IN3 digital Active-low control input for relay 3 — drive low to energize
VCC power 5V logic/module supply input for relay control circuitry
GND.1 ground Additional ground connection for the relay module logic side

Beispielschaltplan — 3-Channel 5V Relay Module

Von Nach Kabel
board:GND x1:GND black
board:5V x1:VCC red
board:D4 x1:IN1 green
board:D5 x1:IN2 blue
board:D6 x1:IN3 yellow

Arduino-Beispielcode — 3-Channel 5V Relay Module

Dieses Beispiel wurde für das arduino-uno geschrieben und kompiliergeprüft. Codey Online passt es für jedes andere unterstützte Board an.

const int RELAY1_PIN = 4;
const int RELAY2_PIN = 5;
const int RELAY3_PIN = 6;

void setup() {
  Serial.begin(9600);
  pinMode(RELAY1_PIN, OUTPUT);
  pinMode(RELAY2_PIN, OUTPUT);
  pinMode(RELAY3_PIN, OUTPUT);

  // Most 5V relay modules are active-low:
  // HIGH = relay off, LOW = relay on.
  digitalWrite(RELAY1_PIN, HIGH);
  digitalWrite(RELAY2_PIN, HIGH);
  digitalWrite(RELAY3_PIN, HIGH);

  Serial.println("3-Channel Relay Module demo starting...");
}

void loop() {
  Serial.println("Relay 1 ON");
  digitalWrite(RELAY1_PIN, LOW);
  delay(1000);
  digitalWrite(RELAY1_PIN, HIGH);

  Serial.println("Relay 2 ON");
  digitalWrite(RELAY2_PIN, LOW);
  delay(1000);
  digitalWrite(RELAY2_PIN, HIGH);

  Serial.println("Relay 3 ON");
  digitalWrite(RELAY3_PIN, LOW);
  delay(1000);
  digitalWrite(RELAY3_PIN, HIGH);

  Serial.println("All relays OFF");
  delay(1000);
}

Ähnliche Komponenten

18650 3.7V Li-Ion Battery

18650 3.7V Li-Ion Battery

3W amplifier MAX98357A I2S DAC

3W amplifier MAX98357A I2S DAC

8-Channel Relay Module

8-Channel Relay Module

Active Buzzer Module

Active Buzzer Module

Bau dein Arduino- oder ESP32-Projekt mit AI

Beschreib einfach, was du bauen willst. Codey Online schreibt den Code, zeichnet den Schaltplan, kompiliert alles und flasht dein Board direkt aus dem Browser.

Kostenlos starten