Relämodul 12V med 1 relä på kretskort och LED-indikator för omkoppling av hög belastning.
SKU: OT901-C111 Artikelnummer: BA050 EAN: 5408955714471 Plats: C11.01
Alternativ
Relämodul 12v | 8-kanals
109 kr
Visa detta alternativ
Så här kopplar du Relämodul 12v till en Arduino UNO eller ESP32, med ett exempelsketch som du kan ladda upp direkt.
This project demonstrates how to control a 12V relay module with an Arduino Uno. The sketch periodically turns the relay ON and OFF every 2 seconds, displaying the current state in the Serial Monitor. An onboard LED indicator on the module will light up when the relay is energized.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : 12V Relay Module Control
* Board : Arduino UNO (arduino:avr:uno)
* Parts : Relais Module 12v AC250V 10A Relais 12v 1 relais LED indicator
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// Pin configuration
const int RELAY_PIN = 7;
void setup() {
// Initialize serial communication
Serial.begin(115200);
while (!Serial) {
; // Wait for serial port to connect
}
// Configure relay control pin
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, HIGH); // Default off (active-low module)
Serial.println(F("12V Relay Module Demo Initialized"));
}
void loop() {
// Activate relay (Low-level trigger)
Serial.println(F("Relay: ON"));
digitalWrite(RELAY_PIN, LOW);
delay(2000);
// Deactivate relay
Serial.println(F("Relay: OFF"));
digitalWrite(RELAY_PIN, HIGH);
delay(2000);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project demonstrates how to control a 12V single-channel relay module using an ESP32. The relay coil is powered by an external 12V DC power supply with a shared ground to the ESP32, and GPIO 4 toggles the relay on and off every two seconds.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : 12V Relay Control with ESP32
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : Relais Module 12v AC250V 10A Relais 12v 1 relais LED indicator
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// Pin connected to relay control input
const int RELAY_PIN = 4;
void setup() {
Serial.begin(115200);
// Configure relay pin as output
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, LOW);
Serial.println("ESP32 12V Relay Demo Started");
}
void loop() {
// Turn relay ON
Serial.println("Relay ON");
digitalWrite(RELAY_PIN, HIGH);
delay(2000);
// Turn relay OFF
Serial.println("Relay OFF");
digitalWrite(RELAY_PIN, LOW);
delay(2000);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Sökord: 12v relä, relä 12v, relay 12v, 12v relay
Mått
Längd: 5,1cm
Bredd: 2,54cm
Höjd: 1,9cm
| Bredd | 2,54 cm |
|---|---|
| Längd | 5,1 cm |
| Höjd | 1,9 cm |
| Hög belastning möjlig | AC250V 10A |
Bra produkt till ett bra pris
Gör det den ska
Bra produkt där man själv måste lista ut anslutningarna genom att mäta och så vidare. Det borde vara bättre
Inte nöjd? Du har 30 dagars ångerrätt efter leverans för att returnera produkten.
Allt om returer
Relämodul 12v