Introduction: Control Home Appliances Using NodeMCU(ESP8266) and Blynk App

About: For more project and tutorial visit my YouTube Channel Smart Technology

In this tutorial,we are going to learn how to use Blynk app and NodeMCU (ESP8266) in order to control lamp(any other home appliances will be just fine),the combination will be through the internet.

The purpose of this instructable is to show the simplest solution remotely-controlling your Arduino or compatible hardware (NodeMCU) over the Internet and to explore the world of Internet Of Things(IoT).

What's Blynk ?
Blynk is a Platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. It’s a digital dashboard where you can build a graphic interface for your project by simply dragging and dropping widgets.(Source : Blynk website).

Step 1: Hardware/Software Supplies

Hardware components :

1. NodeMCU (ESP8266).

2. Relay

3. Lamp

4. Wires

6. 5V Power Supply 1AMP (optionnal but I recommend to use it in order to avoiding the lack of electric current by supplying 5v to the relay.

Software apps :

1. Blynk App

2. Arduino IDE

3. Blynk Library for your OS (Windows,Linux,iOS)

4. ESP8266 Board Manager for Arduino IDE

Step 2: Download Blynk Library

Follow the instructions:

1. Download Blynk_Release_vXX.zip (scroll down to the Downloads section)

2. Unzip the archive. You will notice that archive contains several folders and several libraries.

3. Copy all of these libraries to your_sketchbook_folder of Arduino IDE. To find the location of your_sketchbook_folder, go to top menu in Arduino IDE:

Windows: File → Preferences

Mac OS: Arduino → Preferences

To download Blynk Library and get more information follow this link(here).

Step 3: Adding ESP8266 Board Manager

In the Additional Boards Manager enter below URL.http://arduino.esp8266.com/versions/2.4.0/package_esp8266com_index.json

As highlighted in the figure and enter OK.

Note : To get more information about this step watch the video.

Step 4: Watch the Video for More Details

Step 5: Blynk's Configuration

To setup Blynk App,you should follow the steps below :

1. Download the Blynk app on your smartphone and create an account.

To do this: Download Blynk apps:

• iOS: https://itunes.apple.com/us/app/blynk-control-ard...

• Android : https://itunes.apple.com/us/app/blynk-control-ard...

2. Create a new project, select from the list your hardware (NodeMCU).

3. Select connection type (USB,Wifi,Bluetooth...).

4. Add a widget to your control panel by clicking on the plus icon on the top right.

5. Select the Button widget,and double tap on it to edit its settings.

Note : Authentication key is send to your email.

Step 6: Schematic

Kindly follow the steps bellow :

1. The 5v of the power supply to the Vcc of the relay board.

2. The GND to the GND of the relay board.

3. The D1 of the NodeMCU to the IN1 of the relay board.

Note : The relay required 5v and output of nodemcu is just 3.3v this is why I highly recommend to use external 5v power supply.

Step 7: Arduino Code

About the code

#define BLYNK_PRINT Serial
#include <esp8266wifi.h>
#include <BlynkSimpleEsp8266.h>
/// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
void setup()
{
  // Debug console
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);

}
void loop()
{
  Blynk.run();
}

Step 8: For Support

You can subscribe to the my YouTube channel for more tutorials and projects.

Subscribe for support.

Thank you. Go to my YouTube Channel -link https://goo.gl/EtQ2mp

Arduino Contest 2017

Participated in the
Arduino Contest 2017