Arduino Blynk Lesson 2 : Notification

INTRODUCTION

In this lesson, we will learn on how to get a notification from arduino to the 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
  4. Flame Sensor Module

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

Figure 1 : Hardware connection

Sample Code

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



  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);

int sensorPin = A0;   // Input pin for the Flame Sensor
int sensorValue = 0;  // Variable to store the value coming from the flame sensor

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();
  sensorValue = analogRead(sensorPin);
  if (sensorValue < 700) {
    Blynk.notify("Fire! Fire!");
  }
 
}

Reference

  1. Blynk – Notification
  2. Flame Detector

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.

4 thoughts on “Arduino Blynk Lesson 2 : Notification”

  1. Hi Syazwan, it is better for you to study and try it step by step. Understand how the program works. Thanks.

  2. ASSALAMUALAIKUM.
    CAN YOU DO AN IOT TUTORIAL USING ARDUINO MEGA WITH RFID USING PUSH BUTTON NOTIFICATION USED BLYNK APP

    THANK YOU

  3. ASSALAMUALAIKUM.
    CAN YOU MAKE AN IOT TUTORIAL USING ARDUINO MEGA WITH RFID USING PUSH BUTTON NOTIFICATION USED BLYNK APP

    THANK YOU

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

Getting Started With ProjekIoT.com Using Raspberry Pi
Control Servo With Gesture Using ESP32 and Arduino
Send Sensor’s Data to ThingSpeak Using ESP32
Basic Usage of iMAX B6AC LiPo Charger
Colourful Bed Lamp Using Tilt Sensor on Maker UNO
Scroll to Top