BLYNK Chapter
BLYNK Chapter
BLYNK Chapter
Blynk was designed for the Internet of Things. It can control hardware remotely, it can display
sensor data, it can store data, visualize it and do many other cool things.
Blynk App - allows to you create amazing interfaces for your projects using various
widgets we provide.
Blynk Server - responsible for all the communications between the smart phone and
hardware. You can use our Blynk Cloud or run your private Blynk server locally. Its open-
source could easily handle thousands of devices and can even be launched on a Raspberry Pi.
Blynk Libraries - for all the popular hardware platforms - enable communication with
the server and process all the incoming and out coming commands.
Now imagine: every time you press a Button in the Blynk app, the message travels to the Blynk
Cloud, where it magically finds its way to your hardware. It works the same in the opposite
direction and everything happens in a blynk of an eye.
The Blynk App is a well designed interface builder. It works on both iOS and Android.
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.
After downloading the app, create an account and log in. (If possible than log in with your real
mail id for better connectivity later).
You’ll also need to install the Blynk Arduino Library, which helps generate the firmware
running on your ESP8266. Download the latest release from https://github.com/blynkkk/blynk-
library/releases , and follow along with the directions there to install the required libraries.
Click the “Create New Project” in the app to create a new Blynk app. Give it any name and click
on “create”.
Blynk works with hundreds of hardware models and connection types. Select the
Hardware type. After this, select connection type. In this project we have select WiFi
connectivity.
Then you’ll be presented with a blank new project. To open the widget box, click in the project
window to open.
1. Click on Button.
2. Give name to Button say led.
3. 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”. You have
successfully created a GUI for Arduino.
Now that your Blynk project is set-up, open Arduino and navigate to the
ESP8266_Standalone example in the File > Examples > Blynk > Boards_WiFi>
ESP8266_Standalone menu as shown in below figure-9.
Execution : After the app has uploaded, open the serial monitor, setting the baud rate to 9600.
Wait for the “Ready” message.
Fig button
Then click the “Run” : . 10. Output after
in the top rightinstalling
corner ofand
the the Blynk
Blynk app. by using
Press theSerial
button and watch
monitor.
the LED. Then add more widgets to the project. They should immediately work on the ESP8266
without uploading any new firmware.
Virtual pins : Blynk can control Digital and Analog I/O Pins on you hardware directly. You
don’t even need to write code for it. It’s great for blinking LEDs, but often it’s just not enough…
We designed Virtual Pins to send any data from your microcontroller to the Blynk App and
back.
Anything you connect to your hardware will be able to talk to Blynk. With Virtual Pins you can
send something from the App, process it on microcontroller and then send it back to the
smartphone. You can trigger functions, read I2C devices, convert values, control servo and DC
motors etc.
Virtual Pins can be used to interface with external libraries (Servo, LCD and others) and
implement custom functionality.
Hardware may send data to the Widgets over the Virtual Pin like this:
Blynk.virtualWrite(pin, "abc");
Blynk.virtualWrite(pin, 123);
Blynk.virtualWrite(pin, 12.34);
Blynk.virtualWrite(pin, "hello", 123, 12.34);
All Controller Widgets can send data to Virtual Pins on your hardware. For example, code below
shows how to get values from the Button Widget in the App. For example the commands used to
to get values from the Button Widget in the App are,
When you press a Button, Blynk App sends ‘1 ‘ On the second click it sends ‘0’.
Fig : . 13.Widget setting for a single relay fig : . 14. Multiple arrays of widgets.
Module.
Features of Blynk :
Similar API & UI for all supported hardware & devices
Connection to the cloud using:
o WiFi
o Bluetooth and BLE
o Ethernet
o USB (Serial)
o GSM
o …
Set of easy-to-use Widgets
Direct pin manipulation with no code writing
Easy to integrate and add new functionality using virtual pins
History data monitoring via SuperChart widget
Device-to-Device communication using Bridge Widget
Sending emails, tweets, push notifications, etc.
features are constantly added.
You can find example sketches covering basic Blynk Features. They are included in the library.
All the sketches are designed to be easily combined with each other.
Formatting options ;
For example: your sensor sends vaule of 12.6789 to Blynk application. Next formatting
options are supported:
/pin/ - displays the value without formatting (12.6789).
/pin./ - displays the rounded value without decimal part (13).
/pin.# - displays the value with 1 decimal digit (12.7).
/pin.##/- displays the value with two decimal places (12.68).
Blynk libraries:
With Blynk Library you can connect over 400 hardware models (including ESP8266,
ESP32, NodeMCU, all Arduinos, Raspberry Pi, Particle, Texas Instruments, etc.)to the
Blynk Cloud. Full list of supported hardware can be found here.
Hardware can connect to Blynk Cloud (open-source server) over the Internet using
hardware connectivity available on your board (like ESP32), or with the use of various
shields (Ethernet, WiFi, GSM, LTE, etc). Blynk Cloud is available for every user of
Blynk for free. Direct connection over Bluetooth is also possible.
o Python.
o Micro python.