Démarrer
Câblage vers l’ESP32
| Broche du capteur | Broche ESP32 | Statut | Rôle |
|---|---|---|---|
| Pin (-) | GND | Requis | Sol |
| Pin (+) | 5V | Requis | Alimentation (5 V requis) |
| Pin (S) | GPIO5 | Requis | Signal de contrôle (n'importe quel GPIO) |

Code
Aucune bibliothèque à installer.
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
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éristique | Valeur |
|---|---|
| Weight | 16 g |
| Dimensions | 53 x 18 x 20 mm |
| Maximum AC Load | 250V AC at 10A |
| Maximum DC Load | 30V DC at 10A |
| Operating Voltage | 5V DC |
| Control Signal Voltage | 5V DC |

