Wi-Fi LED Controller

How It Works

How It Works

The ESP32 first connects to a local Wi-Fi network using the Wi-Fi credentials programmed into it. After successfully connecting, the ESP32 obtains an IP address and starts a simple web server. A smartphone or computer connected to the same network can open this address and access the LED control page.

When the user presses the ON button on the web page, the ESP32 receives the command and sets its selected GPIO pin, such as GPIO 2, to a HIGH state. Current then flows through the resistor and LED, causing the LED to illuminate. Pressing the OFF button sends another command that changes the GPIO to LOW, turning the LED off.

The complete operation demonstrates a basic IoT control system: the smartphone provides the user command, Wi-Fi carries the command, and the ESP32 processes it and controls the LED. The same principle can later be used to control multiple LEDs, sensors, relays, and other low-voltage devices.