Este es un módulo relé de 12V de un canal para conmutar cargas externas con una señal de control de bajo voltaje. El lado conmutado admite hasta AC 250V 10A e incluye un indicador LED de estado. Este módulo se usa a menudo en proyectos Arduino/ESP32 para controlar de forma segura dispositivos alimentados por la red eléctrica. with high low yello jumper
| Pin | Señal | Descripción |
|---|---|---|
DC+ |
power | 12V positive supply input for the relay module coil and driver circuit |
DC- |
ground | 0V supply ground for the relay module control side |
IN |
digital | Relay control input from MCU or switch; trigger level is selectable by jumper |
NC |
digital | Normally-closed relay contact; connected to COM when relay is off |
COM |
digital | Common relay contact for the external load circuit |
NO |
digital | Normally-open relay contact; connected to COM when relay is energized |
| Desde | Hasta | Cable |
|---|---|---|
board:5V |
x1:DC+ |
red |
board:GND |
x1:DC- |
black |
board:D7 |
x1:IN |
green |
Este ejemplo se escribió y verificó por compilación para arduino-uno. Codey Online lo adapta a cualquier otra placa compatible.
// Canonical example for a 12V relay module with indicator LED
// Wiring:
// Arduino 5V -> DC+
// Arduino GND -> DC-
// Arduino D7 -> IN
const int RELAY_PIN = 7;
void setup() {
pinMode(RELAY_PIN, OUTPUT);
Serial.begin(9600);
Serial.println("12V relay module example starting...");
}
void loop() {
// Many relay modules are active LOW, but some are active HIGH.
// This example toggles both states with delays so you can observe the relay.
Serial.println("Relay ON");
digitalWrite(RELAY_PIN, LOW); // common active-LOW trigger
delay(2000);
Serial.println("Relay OFF");
digitalWrite(RELAY_PIN, HIGH);
delay(2000);
}
Describe lo que quieres construir. Codey Online escribe el codigo, dibuja el esquema de conexiones, lo compila y graba tu placa directamente desde el navegador.
Empieza gratis