Module relais 5V à déclenchement bas. Capacité de charge élevée : AC 250V 10A / DC 30V 10A. Commande du relais : 5V. Signal : déclenchement bas. Carte relais 1 canal avec indicateur LED.
| Broche | Signal | Description |
|---|---|---|
NC |
Normally-closed relay contact; connected to COM when the relay is not energized. | |
COM |
Common relay switch terminal for the external load circuit. | |
NO |
Normally-open relay contact; connected to COM when the relay is energized. | |
IN |
digital | Active-low 5V control input; drive low to energize the relay. |
GND |
ground | Logic ground reference for the relay module control input and supply. |
VCC |
power | 5V supply input for the relay module coil and control electronics. |
| De | Vers | Fil |
|---|---|---|
board:5V |
x1:VCC |
red |
board:GND |
x1:GND |
black |
board:D7 |
x1:IN |
green |
Cet exemple a été écrit et vérifié à la compilation pour le arduino-uno. Codey Online l'adapte pour vous à toute autre carte prise en charge.
// Canonical beginner example for a 5V low-level trigger relay module
// Wiring:
// Arduino 5V -> Relay VCC
// Arduino GND -> Relay GND
// Arduino D7 -> Relay IN
const int relayPin = 7;
void setup() {
pinMode(relayPin, OUTPUT);
// Low-level trigger relay modules are often OFF when the input is HIGH
// and ON when the input is LOW.
digitalWrite(relayPin, HIGH);
Serial.begin(9600);
Serial.println("Relay module example started.");
Serial.println("Relay will switch ON and OFF every 2 seconds.");
}
void loop() {
Serial.println("Relay ON");
digitalWrite(relayPin, LOW); // active-low: energize relay
delay(2000);
Serial.println("Relay OFF");
digitalWrite(relayPin, HIGH); // de-energize relay
delay(2000);
}
Décrivez ce que vous voulez créer. Codey Online écrit le code, dessine le schéma de câblage, le compile et flashe votre carte directement depuis le navigateur.
Commencez gratuitement