Today i show you how to control Led use Blynk App In IOT platform .First i introduce what is Blynk and Why use Blynk App.
What is Blynk App
What is Blynk App?
Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi, and similar devices over the Internet. It's a digital dashboard where you can build a graphical interface for your project by simply dragging and dropping widgets. Setting everything up is straightforward, and you'll start tinkering in less than 5 minutes. Blynk isn't tied to a specific board or shield; it supports the hardware of your choice. Whether your Arduino or Raspberry Pi is connected to the Internet over Wi-Fi, Ethernet, or the ESP8266 chip, Blynk will get you online and ready for the Internet of Your Things. For more information, click here.
Why Use Blynk App?
There are many third-party IoT platforms, but Blynk stands out for its user-friendly interface. Blynk isn't an app that works only with a particular shield; it's designed to support the boards and shields you're already using. Plus, it works on both iOS and Android.
How It Works
Blynk works over the Internet, so the only requirement is that your hardware can talk to the Internet. Regardless of the connection type—Ethernet, Wi-Fi, or the ESP8266—Blynk libraries and example sketches will get you online, connect to the Blynk Server, and pair up with your smartphone.
Architecture of Blynk system -Mechatronicslabrpi |
Architecture of Blynk System
Blynk consists of three major components:
- Blynk App: The app allows you to create projects and interfaces to interact with your hardware.
- Blynk Server: Responsible for communication between your hardware and smartphone.
- Blynk Libraries: Enable communication with the server and process all incoming and outgoing commands.
Download the Blynk App
- Android Blynk App: Download from Google Play Store
- iOS Blynk App: Download from Apple App Store
Setting Up Your Project
Blynk supports hundreds of hardware models and connection types. For this project, select your hardware type (NodeMCU) and connection type (WiFi). After this, Blynk will email you an Auth Token, which is essential for connecting your hardware to the Blynk app.
Adding Widgets to Your Project
- Open the widget box by clicking in the project window.
- Select a button widget to control the LED connected to your NodeMCU.
- Name the button "LED".
- Under the OUTPUT tab, select the pin to which the LED is connected (e.g., digital pin D2).
- Under the MODE tab, choose whether you want the button to act as a "Push Button" or "Switch".
Software Setup
First, download the Blynk library from here.
Installing the Blynk Library
- Unzip the
Blynk_Release_vXX.zip
archive. - Copy the
libraries
andtools
folders to the Arduino library and tools directories.
Uploading the Firmware
- Open Arduino IDE.
- Go to File > Examples > Blynk > Boards_WiFi > ESP8266_Standalone.
- Enter your Auth Token, SSID, and password in the code.
blynk app new project -mechatronicslabrpi |
- Click on Button.
- Give name to Button say led.
- Under OUTPUT tab- Click pin and select the pin to which led is connected to NodeMCU, here it is digital pin 2, hence select digital and under pin D2. And Click continue.
- Under MODE tab- Select whether you want this button as "push button" or "Switch".
- Unzip the Blynk_Release_vXX.zip archive. you can see a library and tools folder copy the library and tools then past to the ardunio library and tools folder
nodemcu led connection |
cpp#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(9600);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
}
- Upload the code to your NodeMCU.
Testing Your Setup
- Open the serial monitor and set the baud rate to 9600.
- Wait for the "Ready" message.
- Use the Blynk app to control the LED.
Circuit Diagram (With Connection)
Connect your NodeMCU and LED as follows:
- LED Anode (long leg): NodeMCU D2 (GPIO 4)
- LED Cathode (short leg): NodeMCU GND
This comment has been removed by the author.
ReplyDelete