Skip to main content

Featured Post

Kerala's First 3D Printed Building

Created as a showcase project, AMAZE-28, the single-room summer house, was successfully constructed within 28 days on the grounds of the Kerala State Nirmithi Kendra. The 3D-printed building at the Kerala State Nirmithi Kendra in Thiruvananthapuram. (Photo: Shekunj)  The inauguration of Kerala's inaugural 3D-printed structure, a 380-square-foot single-room summer house, is scheduled to take place on October 10 at the Kerala State Nirmithi Kendra (Kesnik) campus located in PTP Nagar, Thiruvananthapuram.  Conceived as a showcase initiative, the summer house named AMAZE-28 was successfully finished within a mere 28 days. This impressive project was executed by Tvasta, a construction technology startup based in Chennai, founded by alumni of IIT-Madras, who have entered into a memorandum of understanding (MoU) with Kesnik.  AMAZE-28 is perched upon a concrete foundation atop a gentle elevation within the Kesnik campus. Febi Varghese, the Director and Chief Executive Officer of...

Controlling LEDs over WiFi using NodeMCU and Blynk App.

This article is the base on the Internet of things (IoT). IoT describes the network of physical objects—“things” or objects—that are embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the Internet. In this article 3 LEDs will be controlled by an android application (made using Blynk) over a wifi connection.

How to use NodeMCU with Blynk 

If you want to start learn the Internet of Things (IoT) concept, then controlling a LED over the  internet is the " Hello World!" of the IoT journey. Performing the " Hello World" task will be easy using NodeMCU micro-controller as the first client and Blynk as the 'broker' or server and Blynk android application as the second client. Now communication between two clients will happen through broker over the internet. Now lets, make this happen. 

Components Required

For this activity we will need following components:

  1. NodeMCU ESP8266
  2. Bread Board
  3. Jumper Wires
  4. Resistor (320 Ohm)
  5. LED
  6. 5V Power Supply
  7. Smart Phone

You can purchase the above components using the link given from Amazon.

Circuit Diagram

Before Moving further in the tutorial, lets prepare the circuit diagram as per the image given below. Two Circuit diagram has been shown below - one is showing the power input to NodeMCu through USB connected with computer; while another one showing the power input to NodeMCU at Vin Pin using +5V DC Power Source.

Fig 1: Circuit Diagram for LED with NodeMCU (For power connected to computer using USB)





Fig. 2: Circuit Diagram for LED with NodeMCU (Power at Vin using 5V DC Power Source)

 Preparing Arduino IDE for NodeMCU

Now we have to install NodeMCU ESP8266 board and Wifi Library in the board manager and Library  of our Arduino IDE respectively. If you have done these steps before then leave this step.

Installing NodeMCu Board Manager in Arduino IDE

  1. Open Arduino IDE in your computer.
  2. Go to: File > Preferences
  3. Then paste the Following link in the "Addition Board Manager" option and click OK:
Link : 
https://arduino.esp8266.com/stable/package_esp8266com_index.json
 

 Installing Libraries in Arduino ID

We have to use two libraries in this tutorial:
  1. ESP8266WiFi.h
  2. BlynkSimpleEsp8266.h
We have to install these two libraries in our Arduino IDE, for this got to:
Sketch > Include Library > Add .ZIP Library
 
 Download the ZIP file of each library and add them to Arduino IDE using the above Method.

Creating Account on Blynk

Next step is to creating profile on Blynk and getting the various credentials. We, also have to set the various parameters along with installing the Blynk Android Application.

After login create New Device on Blynk.cloud, on adding the New Device you will get Authorization code along with Template ID. This detail will be used at the top of code.

Creating Profile on Blynk Web Portal 

Visit the Blynk web portal using the link - Blynk. Sign Up using the email ID and then login. Open the Quickstart Template. 


 After opening quickstart template, we will get firmaware configuration detail, this detail has to be copy and pasted at the begining of our Arduino Code. 

 

we have to manage on two parameters for this tutorial:

  1.  Data Stream

  2. Web Dashboard

Define a pin type for the LED Control by creating a Virtual Pin name as LED  in the data stream as shown in figure below.

Web Dashboard:  Similarly Prepare the Dash board by creating a ON - OFF Switch and assigning it the Virtual Pin - LED, as shown in figure below.

 

Now, We have completed the Blynk application or Web dashboard  part. Next step is to prepare the Arduino code for this project and upload it on the NodeMCU board and check the working.

Arduino Code

At starting of the code we have to add Template ID, Device Name and Auth Token are provided by the Blynk.Cloud (See the Device Info tab, or Template settings).

#define BLYNK_TEMPLATE_ID           "XXXXXXXXX"
#define BLYNK_DEVICE_NAME           "XXXXXXXXX"
#define BLYNK_AUTH_TOKEN            "XXXXXXXXX"

Next you have to add the following libraries in Arduino IDE: ESP8266WiFi.h, BlynkSimpleEsp8266.h, and Arduino.h

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Arduino.h>

Next you have to add your WiFi SSID and Password details. You Can comment below for the complete code. 

Now we are fully ready  and lets see the working of our project.




 

 

 
 
 
 

Comments

Popular posts from this blog

How to Know the NodeMCU IP Address for Your Next IoT Project

  NodeMCU IP Address: The NodeMCU is a popular development board for IoT projects. It’s small, affordable, and comes with built-in Wi-Fi connectivity, making it the perfect choice for creating connected devices. But before you can start building your NodeMCU projects, you need to know the IP address of your device. This IP address is essential for communicating with the NodeMCU from another device, such as a computer or smartphone. In this article, we’ll show you how to find the NodeMCU IP address, so you can get started with your next IoT project. Method 1: To Know the NodeMCU IP Address One of the easiest ways to find the NodeMCU IP address is by using the serial monitor in the Arduino IDE. First, connect your NodeMCU board to your computer using a micro-USB cable. Then, upload the following code to the NodeMCU: #include <ESP8266WiFi.h> void setup() { Serial.begin(115200); Serial.println(); Serial.print("Connecting to "); Serial.println(...

Blinking of LED Using Arduino UNO

Hi !!!! Here we are going to learn very very simple use of Arduino, that is blinking of a LED. Here we will do simplest project using Arduino. So, here we go.... COMPONENTS REQUIRED - Bread Board Arduino UNO Jumper Wires Power Source (5V) / Battery Resistor (1K) CIRCUIT PREPA RATION - Take bread board and Arduino. Connect the +5V from Arduino to the +Ve line on Bread Board and GROUND from Arduino to -Ve line on bread board. Red Wire     : +5 V Black Wire  : GROUND     Now put a LED on bread board. Connect the Anode (+ / Longer terminal) of led to the pin 13 of Arduino. Connect Cathode (- / Shorter terminal)  to 1K ohm resistor and connect another terminal of resistor to the GND on breadboard.   Now our circuit is ready to work.  Our next aim is to build the code. Let's make our code. CODE -     To download the complete code -  CLICK HERE -----------------------------...