Controlling Esp12E NodeMCU with LED from website using thingspeak from anywhere in the world

Teacher
Vivek Gupta
Vivek Gupta
Role : Writing free tutorials in free time
  • Website : http://vsgupta.in/
  • Experience : 5+ Years
  • Specialist in : IoT, NLP, Machine Learning, Chatbots, Voice Assistants, Hardware Engineering
Read More

Controlling Esp12E NodeMCU with LED from website using thingspeak from anywhere in the world(Part-1)

Control ESP12E from thingspeak using web page with LED from anywhere in the world requires a breadboard setup of ESP12E Node MCU with three LED on pin D1,D2,D3 respectively. Before beginning with this tutorial, make sure you have wired it up as shown below. You can also follow this specific lesson where I am explaining the step by step of wiring your breadboard. And return back here after you have setup the breadboard.

"Setting up Node MCU ESP12E with LED on breadboard"

And after that, install this library in your arduino IDE:

https://github.com/mathworks/thingspeak-arduino

And if you don't know how to install external library in Arduino IDE then you can see this tutorial :

Adding the Adafruit OLED library in Arduino IDE and programming Arduino Leonardo Pro Micro Part-1

Since you have already wired up your breadboard, lets program it. Here is the short video tutorial to make channel on thingspeak and program you NODE MCU ESP12E .

Here is the code for your arduino. Copy and program your ESP12E Node MCU with it:

 

Now you have successfully programmed and tested our NODE MCU ESP12E board and tested it to control led from any where in the world. Now in the next tutorial, we will be seeing how to make a webpage that will update the thingspeak server and control the LED on ESP12E. Go ahead and begin with the next chapter.

Please login to get access to the quiz
(Next Lesson) Controlling Esp12E NodeMCU with LED from website using thingspeak from anywhere in the world(Part-2)
Back to Controlling Esp12E NodeMCU with LED from website using thingspeak from anywhere in the world

Comments ( 19 )

  • Mujeeb

    Vivek Gupta sir
    its not working .. it gives error
    “exit status 1
    Error compiling for board NodeMCU 0.9 (ESP-12 Module).

  • Bindhu

    hello sir,
    im getting error in postman like Unexpected ‘P’. should i connect nodemcu while doing it? reply me fast sir.

    • There is some problem with Php code. There is a typo/missed symbols. Please check the code again.

  • Ijaz

    hello sir, can i get rely on off code same as led

    • Yes, just connect the relay instead of LED.

  • Hello Sir ,
    I am using esp2866-01 instead of esp12e so what should i change in the code above
    thanks

    • The code will be changed completely. You have to use software serial to interface arduino with esp-01.

  • Namita

    i want to one led ON OFF through switch and other want to blink always on nodemcu and update on thingspeak and want to control this from thinkspeak also how can i do this….plz help…

    • Code it? I don’t think it is difficult.

  • hello sir ,i want to use external switch as well i want to control led from website button as well as external switch and update on thingspeak …how can i do this…

    • Use relay to control AC appliances.

  • Naveen

    exit status 1
    ‘WiFiClient’ does not name a type
    while compiling this program i got this error….
    please give me a solution for that

    • Please install the libraries properly.

  • Sourav Prasad

    This works. I have a question. I have saved my index.html file on my desktop but I want to open this index.html file through a link on the internet(host this webpage) and turn on the LEDs. I hosted my index.html on github but it doesn’t work. How can this be done. I am new to this field. Kindly suggest. Thanks

    • Run your index.html using http-host nodejs library and run it on any. Use ngrok to expose that port. It will work.

Post a Reply