Codey OnlineArduino- & ESP32-componentenbibliotheek › Relay Module 5V
Relay Module 5V
Output

Relay Module 5V

5V relaismodule met HIGH-trigger

Breedte: 38.1 mm

Pinout — Relay Module 5V

Pin Signaal Beschrijving
- ground GND pin 5V
+ power 5V VCC pin 5v
S digital Signal 3V - 5V
NO Normally open
COM Common
NC Normally Closed

Voorbeeld-aansluitschema — Relay Module 5V

Van Naar Draad
board:GND x1:- black
board:5V x1:+ red
board:D7 x1:S green

Voorbeeld-Arduinocode — Relay Module 5V

Dit voorbeeld is geschreven en compile-gecheckt voor de arduino-uno. Codey Online past het voor je aan naar elk ander ondersteund board.

// Relay Module 5V - Canonical Beginner Example
// This sketch switches the relay ON and OFF every 2 seconds.
// Wiring:
// Arduino GND -> relay -
// Arduino 5V  -> relay +
// Arduino D7  -> relay S

const int RELAY_PIN = 7;

void setup() {
  pinMode(RELAY_PIN, OUTPUT);
  Serial.begin(9600);
  Serial.println("Relay module demo starting...");
}

void loop() {
  digitalWrite(RELAY_PIN, HIGH); // Many 5V relay modules are active HIGH
  Serial.println("Relay ON");
  delay(2000);

  digitalWrite(RELAY_PIN, LOW);
  Serial.println("Relay OFF");
  delay(2000);
}

Vergelijkbare componenten

3W amplifier MAX98357A I2S DAC

3W amplifier MAX98357A I2S DAC

Active Buzzer Module

Active Buzzer Module

⚙️

LED

LED Matrix Module MAX7219

LED Matrix Module MAX7219

Bouw je Arduino- of ESP32-project met AI

Beschrijf wat je wilt bouwen. Codey Online schrijft de code, tekent het aansluitschema, compileert het en flasht je board rechtstreeks vanuit de browser.

Gratis starten