Control an LED from your smartphone using ESP8266 NodeMCU over Wi-Fi — no Android app required!
In this tutorial, I show you how to build a simple IoT project where the ESP8266 creates its own Wi-Fi hotspot and hosts a web page. Connect your phone, open the browser, and turn the LED ON or OFF with one click.
Features:
• No Android App Required
• ESP8266 Wi-Fi Access Point Mode
• Mobile Browser Control
• Beginner Friendly IoT Project
• Arduino IDE Code Included
🛠 Components Used:
• ESP8266 NodeMCU
• LED
• 220Ω Resistor
• Breadboard
• Jumper Wires
• USB Cable
Arduino Code:
https://t.me/c/4311750489/2
Code Customization
Change the LED Pin
By default, the LED is connected to D2 (GPIO4).
#define LED_PIN 4
If you want to use another pin, simply change the GPIO number.
Examples:
#define LED_PIN 5 // D1
#define LED_PIN 4 // D2
#define LED_PIN 0 // D3
#define LED_PIN 2 // D4
#define LED_PIN 14 // D5
#define LED_PIN 12 // D6
#define LED_PIN 13 // D7
#define LED_PIN 15 // D8
Make sure to connect the LED to the same pin you define in the code.
Change the Wi-Fi Name and Password
Edit these two lines:
(const char* ssid = "LED";)
(const char* password = "LED12345";)
Note: The Wi-Fi password must be at least 8 characters long.
Change the Blink Time (For Blink Projects)
If you are using the LED Blink sketch, you can change the delay time here:
delay(3000);
Examples:
delay(1000); // 1 second
delay(2000); // 2 seconds
delay(5000); // 5 seconds
That's it! Enjoy your Wi-Fi controlled LED project.
If you found this project helpful, please Like, Comment Share , and Subscribe for more Arduino, ESP8266, ESP32, and IoT projects.
Thanks for watching!
#ESP8266 #NodeMCU #Arduino #IoT #WiFi #LEDControl #WebServer #DIY #Electronics #Programming