ESP32 - Relay

You can connect an LED directly to ESP32 but you cannot connect a high voltage devices (such as an electric lamp, pump, electromagnetic lock, linear actuator, or even a big machine...) directly to ESP32. We need a relay in between ESP32 and the high voltage devices. Without relay, the high voltage will destroy ESP32.