Arduino Blynk Lesson 1: LED

INTRODUCTION

In this lesson, we will learn on how to control an LED using smartphone. This is a simple project designed specially for a beginner who are interested in get started with Internet of Things (IoT). 

HARDWARE PREPARATION

This tutorial use :

  1. Maker UNO
  2. Cytron ESP 8266 WiFi Shield
  3. USB Micro B Cable

You can make the hardware connection based on the diagram and table below.

Figure 1 : Hardware Connection

Software Preparation.

  1. Open the Arduino IDE. Please make sure that your Arduino IDE is version 1.6.9 and above.
  2. Then, click at the on Sketch – Include Library – Manage Libraries… Search for “blynk” and install the latest version of Blynk.
  3. Next, we need to add an additional library for Blynk. Click on this link to download the library. Watch the video on how to include the library.
  4. Then we can continue to program by edit the program from the Example file of the Blynk. (File – Examples – Blynk – Boards_WiFi – ESP8266_Shield)

Sample Code

This is the sample code used for this tutorial. Try it!

/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
This example shows how to use ESP8266 Shield (with AT commands)
to connect your project to Blynk.
WARNING!
It's very tricky to get it working. Please read this article:
http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware
Change WiFi ssid, pass, and Blynk auth token to run 🙂
Feel free to apply it to any other example. It's simple!
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.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";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
}
void loop()
{
Blynk.run();
}
view raw Blynk_Lesson_1.ino hosted with ❤ by GitHub

Thank you

Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiry, please post at Cytron Technical Forum.

2 thoughts on “Arduino Blynk Lesson 1: LED”

  1. Hahh, saya punya masalah ESP not responding, mana yang silap ah? saya sdh follow btul2 smua ni

  2. assalamualaikum dan salam sejahtera,
    sy da ikut langkah2 seperti dalam video,tetapi tidak besambung degan wifi,wifi phone da buka, kenapa yup?
    [13977] Fail to connect wifi
    mohon tunjuk ajar

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Raspberry Pi Pico VS Arduino MKRZero
Raspberry Pi Pico VS Teensy LC
A New Challenger in MCU Platform – Raspberry Pi Pico
Raspberry Pi Pico VS Arduino UNO
Raspberry Pi Pico VS micro:bit V2
Scroll to Top