In this article, we are going to control the Node MCU’s built in LED over the web using the Blynk application.
You will need the following items to carry out this project.:
- NodeMCU ESP8266 12E development board (Buy Here)
- Smart Phone with Blynk App installed (iOS or Android).
- Latest Arduino IDE (Download)
Introducing the NodeMCU Board
The NodeMCU is an Open-source, Programmable, Low cost, Simple, Wi-Fi enabled board which can help you to build IoT projects in the shortest possible time. The board is based on ESP8266 chips made by Espressif, and comes with GPIO pins, PWM, I2C, 1-Wire and ADC. To crown the NodeMCU as the king of IoT prototyping and DIY boards, it is programmable using the Arduino IDE.
One drawback though, it only works at 3V logic and you must make special arrangements when working with 5V circuits.
In the Blynk of an Eye
Blynk is a Platform with iOS and Android app that allows you to send control signals, visualize data and lots more on an Arduino, Raspberry Pi or ESP8266 over the Internet in the Blynk of an eye.
There are three major components that allow you to create graphical user interfaces for your IoT project in minutes.
See www.blynk.com for further details.
Now that we have some insights about the hardware and the app, we can proceed to implement.
Please ensure that the CH340 Driver for the NodeMCU board is installed.
STEP 1: INSTALL REQUIRED LIBRARIES
This Blynk app has set of library files which must be included in the Arduino IDE environment before the project is executed
- Follow the link to install libraries http://www.blynk.cc/getting-started/
- Once the Zip file is downloaded, extract it and individually copy all the folder to your libraries folder of your Arduino.
- Once done just open Arduino IDE and go to Sketch> Include libraries and you would see Blynk in the menu.
- If you find it, Blynk libraries have been included successfully.
The Arduino IDE does not come with a NodeMCU compiler installed. In order to compile and upload functional code to the board, follow these steps:
- In the Arduino IDE go to File>Preferences
- Now copy the below link and paste it in the Additional Boards Manager URL text box: http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Restart the Arduino IDE.
- Proceed to Tools>Board>Board Manager… Search for ESP8266 and install it (it takes a few minutes to download and install).
- Restart the Arduino IDE, go to Tools>Boards and select Node MCU board.
STEP2: Set Up Blynk
This step by step guide runs you through the steps required to run setup the Blynk App.
STEP 3: UPLOAD THE CODE
- Connect your Esp8266 Wi-Fi to your PC
- In Arduino IDE go to File>Examples>Blynk-Boards_Wifi->Esp8266Standalone
Select the correct board (NodeMCU 1.0) and the corresponding serial port from the Tools Menu.
- Edit the code by entering the Authentication token emailed, your WiFi SSID and Password
- Click the Upload button
- You should be able to control the LED with the press of a button.
Now that we have the basics, let’s know what you plan to build next in the comments section. Thank you.