This project allows you to control 5 LEDs using the ESP8266 via the Blynk app over Wi-Fi. Each LED is mapped to a separate button in the Blynk app, enabling individual control. ποΈ
- Install the Blynk IoT app from:
- Open the Blynk app and sign up/log in.
- Click β New Project.
- Enter the Project Name (e.g., "ESP8266 LED Control").
- Select π‘ Device β Choose ESP8266.
- Choose π Connection Type β Set to Wi-Fi.
- Tap β Create β You will receive an Auth Token via email. π§
- Inside the project, tap the β β+β icon to add widgets.
- Select π Button and place it on the screen.
- Tap the button, set:
- π Name: LED 1
- π Pin: V0
- π Mode: Switch
- Repeat this for LED 2, LED 3, LED 4, and LED 5 using V1, V2, V3, and V4.
- Click πΎ Save and exit the editor.
Ensure you have the following Arduino libraries installed:
- π Blynk (Download)
- π ESP8266WiFi
Modify the following code snippet in your Arduino IDE:
#define BLYNK_AUTH_TOKEN "YOUR_BLYNK_AUTH_TOKEN" // π Enter Blynk Auth Token
char ssid[] = "YOUR_WIFI_SSID"; // πΆ Enter Wi-Fi Name
char pass[] = "YOUR_WIFI_PASSWORD"; // π Enter Wi-Fi Password- π Connect ESP8266 to PC via USB.
- π₯οΈ Open the Arduino IDE.
- π§ Select Board: "NodeMCU 1.0 (ESP-12E Module)".
- βοΈ Select Port (COMx).
- π€ Click Upload and wait for completion.
- β‘ Power the ESP8266.
- π± Open the Blynk app and start the project.
- πΉοΈ Press buttons in the app to control LEDs!
Each LED is connected through a 220Ξ© resistor to prevent excess current. β‘
| π‘ LED | π₯οΈ ESP8266 Pin | π Virtual Pin |
|---|---|---|
| LED 1 | D0 | V0 |
| LED 2 | D1 | V1 |
| LED 3 | D2 | V2 |
| LED 4 | D3 | V3 |
| LED 5 | D4 | V4 |
π Connections:
- π΄ LED Anode (+) β ESP8266 GPIO pin (D0 - D4) through a 220Ξ© resistor.
- β« LED Cathode (-) β ESP8266 GND.
- β Preferred: USB power or 5V adapter.
β οΈ If using a 9V battery: Use a 7805 voltage regulator to step down to 5V.
β
Press Button V0 β π‘ LED 1 Turns ON. Press again β LED 1 Turns OFF.
β
Press Button V1 β π‘ LED 2 Turns ON. Press again β LED 2 Turns OFF.
β
Repeat for LEDs V2, V3, V4.
π Now, you can control your LEDs wirelessly using ESP8266 & Blynk! ππ‘