..............
In this tutorial We will control LED via Browser , So you can control any device after adding some Relays.
here We are using ESP8266 or MINI NodeMcu.
it will send some HTML and CSS script on client so you can see user interface in browser.
For more videos and tutorial Please Subscribe my youtube cahnnel.
..............
Step 1: Begin With NodeMcuIf You are New with Wemos D1 R1 or mini NodeMcu then Follow the tutorial, link given below.
- Where you can learn How to install Driver for mini nodemcu.
- How to Install board in Arduino IDE.
- How to upload First blink Code in NodeMcu.
Instructable Link :- https://www.instructables.com/id/Nodemcu-Mini-D1-R...
Youtube link :-https://www.youtube.com/watch?v=IV25zd-hj7U
Step 2: Download Folder- Download the folder given below and extract it.
___________________
__________________
___________________
Step 3: Understand Built in LEDAs you can see in image the built in LED is Connected to VCC with resistor and GND terminal is connected with ESP8266.
So it will work in reverse, whenever we turn pin to HIGH the led will be off.
Whenever We turn pin to LOW, led will ON.
Step 4: Upload Code Based on HTML- Go to the downloaded Folder.
- find code "LED_toggle_HTML".
- Open the code in arduino ide.
- Select Correct board which is "Wemos D1 R1" and correct Port.
- Now upload the code.
NOTE:- No need to see IP every time, it is only one time process.
- Open Serial Monitor.
- Press reset Button in NodeMcu.
- You will see Connecting.........
- After Stable connection it will show IP address.
- Paste the IP address in Device Browser.
- Hit Enter, you will see a ON, OFF interface.
- Now you can Turn on LED via ON switch and turn off LED via OFF switch.
BUT you can the interface is less attractive and you have to Zoom in every time whenever you click the switch.
So in Next Step we will use CSS with HTML for attractive interface.
Step 7: Code Based on CSS- Find the code "LED_Toggle_CSS" in Downloaded folder.
- Open the Code in Arduino IDE.
- Select Correct Board "Wemos D1 R1"and Port.
- Upload Code.
NOTE :- This is one time process to know IP address, No need to do it every time.
- Open Serial Monitor.
- Press reset button in NodeMcu.
- Now you will see "Connecting......" till the connected.
- Once connected you will see IP address.
- Copy the IP address.
- Enter the IP address in Mobile Browser.
- you will see ON/OFF switch and Yellow circle which is LED.
- When we press ON then LED will turn on the LED circle will turn Yellow.
- When we press OFF then LED will turn off the LED circle will turn Black.
Congratulation.............
you have build a browser controlled LED.
if you new and want to begin with the NodMcu watch video or goto the tutorial link here.
Comments