Aller au contenu
Bamba IoT

KY-019 : câblage ESP32, code et brochage

Modules KY-0xxNumérique

Le KY-019 est un module relais 5 V qui permet aux microcontrôleurs de contrôler des appareils haute tension.

Photo du KY-019

Démarrer

Câblage vers l’ESP32

Câblage vers l’ESP32
Broche du capteurBroche ESP32StatutRôle
Pin (-)GNDRequisSol
Pin (+)5VRequisAlimentation (5 V requis)
Pin (S)GPIO5RequisSignal de contrôle (n'importe quel GPIO)
Schéma de câblage du KY-019

Code

Aucune bibliothèque à installer.

basic.ino
int relayPin = 10; // Relay connected to digital pin 10

void setup() {
    pinMode(relayPin, OUTPUT);
    Serial.begin(9600);
    Serial.println("KY-019 Relay Module Test");
}

void loop() {
    digitalWrite(relayPin, HIGH); // Turn relay on
    Serial.println("Relay is ON");
    delay(1000); // Wait for a second
    digitalWrite(relayPin, LOW); // Turn relay off
    Serial.println("Relay is OFF");
    delay(1000); // Wait for a second
}

Brochage

Brochage
BrocheTypeDescription
Pin (-)PowerConnexion à la terre
Pin (+)PowerAlimentation5 V requis pour la bobine de relais
Pin (S)ControlEntrée du signal de commandeHIGH pour activer le relais
Brochage du KY-019

Caractéristiques

Le KY-019 est un module relais 5 V qui permet aux microcontrôleurs de contrôler des appareils haute tension. Il prend en charge les charges CA et CC, ce qui le rend adapté à diverses applications d'automatisation et de contrôle.

Caractéristiques
CaractéristiqueValeur
Weight16 g
Dimensions53 x 18 x 20 mm
Maximum AC Load250V AC at 10A
Maximum DC Load30V DC at 10A
Operating Voltage5V DC
Control Signal Voltage5V DC