This is a single-channel 12V relay module for switching external loads with a low-voltage control signal. It is rated for up to AC 250V 10A on the switched side and includes an LED indicator for status. The module is commonly used for Arduino/ESP32 projects to control mains-powered devices safely. with high low yello jumper
| Pin | Signal | Description |
|---|---|---|
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 |
| From | To | Wire |
|---|---|---|
board:5V |
x1:DC+ |
red |
board:GND |
x1:DC- |
black |
board:D7 |
x1:IN |
green |
This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.
// 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 what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.
Start for free