Create Push Notification over Flame Sensor

That is because the IDE monitor wants to use the same serial port the Arduino is using to connect to Blynk.

Also, everytime this line runs, it causes connection issues with the Server

Serial.println(sensor);  // display temperature

Use another terminal program like Termite, and connect it via a USB-TTL adapter (if you have one) to your SoftwareSerial port.

SoftwareSerial SwSerial(10, 11); // RX, TX

SwSerial.println(sensor);  // display temperature

Or send it to a Display Widget

Does that termit just work with RS232? How about CH340?

Do you mean value display? How about the program? Must I add push data program if I add value display to the app?

CH340 is a USB to serial (RS232) convertor chip, so as long as it is in the USB-TTL form like this, then that is what you can use to send serial print data from your Arduino to Termite (or any serial monitor, like Putty, etc).

http://www.electrodragon.com/product/usb-ttl-serial-ch340-board/

Combine your knowledge of these documents and you can simply use a command like this:

Blynk.virtualWrite(vPin, sensor);  // display temperature on Display Widget with matching vPin

I have tried use termite. When I run file blynk-ser.bat, termite canā€™t detect the port. Otherwise, when I close file blynk-ser.bat, termite can detect the port. But, if I open termite first, after that I run file blynk-ser.bat, then the command prompt will be error like this:

And I have modified the sketch:

    #define BLYNK_PRINT SwSerial
    #include <SoftwareSerial.h>
    SoftwareSerial SwSerial(10, 11); // RX, TX
    
    #include <BlynkSimpleStream.h>

    // You should get Auth Token in the Blynk App.
    // Go to the Project Settings (nut icon).
    char auth[] = "*******************************************";

    int buzzer = 13 ;// define buzzer Interface
    int pin = 2; // define the flame sensor interface
    int analoog = A0; // define the flame sensor interface
 
    int val ;// define numeric variables val
    float sensor; //read analoog value

    BlynkTimer timer;

    void readSensor()   // Costas
    {
       sensor = analogRead(analoog);
       Serial.println(sensor);  // display temperature
       // long uptime = millis() / 60000L;  Costas
  
      // You can send any value at any time.
      // Please don't send more that 10 values per second.
      Blynk.virtualWrite(V1, millis() / 1000);

      val = digitalRead (pin) ;// digital interface will be assigned a value of 3 to read val
      if (val == HIGH) // When the flame sensor detects a signal, buzzer beep
      {
         digitalWrite (buzzer, HIGH);
      }
         else
     {
        digitalWrite (buzzer, LOW);
     }
       //delay(1000);  // Costas
    }

    void setup()
    {
      pinMode (buzzer, OUTPUT) ;// define buzzer as output interface
      pinMode (pin, INPUT) ;// output interface defines the flame sensor
      pinMode (analoog, INPUT) ;// output interface defines the flame sensor
  
      // Debug console
      SwSerial.begin(9600);

      // Blynk will work through Serial
      // Do not read or write this serial manually in your sketch
      Serial.begin(9600);
      Blynk.begin(Serial, auth);

      // Notify immediately on startup
      if(val==HIGH){
      //Blynk.notify("Flame!!!");
      Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
      }

       // Setup a function to be called every 200ms Costas
       timer.setInterval(10L, readSensor);  // Costas
       Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
       }

      void loop()
      {
        Blynk.run();
        timer.run();
      }

When I click play button on the app, nothing value appear. Any wrong with my sketch?

I also have tried change the board to Wemos D1 mini.
I set the circuit like this:

And the sketch like this:

    #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[] = "*****************************************";

    // Your WiFi credentials.
    // Set password to "" for open networks.
    char ssid[] = "Redmi 3s";
    char pass[] = "***********";

    int buzzer = D1 ;// define buzzer Interface
    int pin = D0; // define the flame sensor interface
    int analoog = A0; // define the flame sensor interface
 
    int val ;// define numeric variables val
    float sensor; //read analoog value

    BlynkTimer timer;

    void readSensor()
    {
      sensor = analogRead(analoog);
      Serial.println(sensor);  // display temperature
      //long uptime = millis() / 60000L;

     // You can send any value at any time.
     // Please don't send more that 10 values per second.
     Blynk.virtualWrite(V1, millis() / 1000);

     val = digitalRead (pin) ;// digital interface will be assigned a value of 3 to read val
     if (val == HIGH) // When the flame sensor detects a signal, buzzer beep
     {
       digitalWrite (buzzer, HIGH);
     }
       else
    {
      digitalWrite (buzzer, LOW);
    }
      // Actually send the message.
      // Note:
      //   We allow 1 notification per 15 seconds for now.
      //Blynk.notify(String("Running for ") + uptime + " minutes.");
    }

    void setup()
    {
      pinMode (buzzer, OUTPUT) ;// define buzzer as output interface
      pinMode (pin, INPUT) ;// output interface defines the flame sensor
      pinMode (analoog, INPUT) ;// output interface defines the flame sensor
      // Debug console
      Serial.begin(115200);

      Blynk.begin(auth, ssid, pass);
      // You can also specify server:
      //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
      //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

      // Notify immediately on startup
      Blynk.notify("Device started");

       // Notify immediately on startup
       if(val==HIGH){
       //Blynk.notify("Flame!!!");
       Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
       // Setup a function to be called every minute
       timer.setInterval(10L, readSensor);
     }
       // Setup a function to be called every 200ms Costas
       timer.setInterval(10L, readSensor);  // Costas
       Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
    }

    void loop()
    {
       Blynk.run();
       timer.run();
    }

When I upload the sketch and I open serial monitor, the values appear only 5, 4, 3 repeatedly whereas I still havenā€™t yet started the fire.Anyway, the email come in when I started fire, but the nothing value come to email and buzzer canā€™t rang. The email just contained ā€œSensor acitvatedā€. Are there any wrong in my sketch or my circuit?

It will not ring if you donā€™t connect it.
In the Fritzing diagram itā€™s connected to WeMos D4 but your sketch states:

int buzzer = D1 ;// define buzzer Interface

The following line is no good in setup() unless you simply want to be emailed when the WeMos reboots.

Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");

Increase the 10L to at least 100L or you are likely to flood the server and get disconnected.

What readings does Serial Monitor show when you start the fire?

Sorry, I forgot to edit the fritzing diagram. I have change the pin to D1 on my circuit, but the buzzer still canā€™t rang.
Anyway, I have edit the sketch:

    #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[] = "******************************************";

    // Your WiFi credentials.
    // Set password to "" for open networks.
    char ssid[] = "Redmi 3s";
    char pass[] = "***********";

    int buzzer = D1 ;// define buzzer Interface
    int pin = D0; // define the flame sensor interface
    int analoog = A0; // define the flame sensor interface
 
    int val ;// define numeric variables val
    float sensor; //read analoog value

    BlynkTimer timer;

    void readSensor()
    {
      sensor = analogRead(analoog);
      Serial.println(sensor);  // display temperature
      //long uptime = millis() / 60000L;

     // You can send any value at any time.
     // Please don't send more that 10 values per second.
     //Blynk.virtualWrite(V1, millis() / 1000);

     val = digitalRead (pin) ;// digital interface will be assigned a value of 3 to read val
     if (val == HIGH) // When the flame sensor detects a signal, buzzer beep
     {
        digitalWrite (buzzer, HIGH);
     }
        else
    {
        digitalWrite (buzzer, LOW);
    }
       // Actually send the message.
       // Note:
       //   We allow 1 notification per 15 seconds for now.
       //Blynk.notify(String("Running for ") + uptime + " minutes.");
       //Notify immediately on startup
  
       if(val==HIGH){
        //Blynk.notify("Flame!!!");
        Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
        // Setup a function to be called every minute
        timer.setInterval(100L, readSensor);
      }
      // Setup a function to be called every 200ms Costas
      timer.setInterval(100L, readSensor);  // Costas
      Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
     }

    void setup()
    {
       pinMode (buzzer, OUTPUT) ;// define buzzer as output interface
       pinMode (pin, INPUT) ;// output interface defines the flame sensor
       pinMode (analoog, INPUT) ;// output interface defines the flame sensor
       // Debug console
      Serial.begin(115200);

      Blynk.begin(auth, ssid, pass);
      // You can also specify server:
      //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
      //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

      // Notify immediately on startup
      Blynk.notify("Device started");
      }

      void loop()
      {
         Blynk.run();
         timer.run();
       }

And the serial monitor just like this:

Nothing value appear when the fire started.

@Maria you have removed the call to the timer, put this as the last line of setup()

timer.setInterval(150L, readSensor); // Costas

Then the value 5,4,3 appear repeatedly again like this:

I have edit function readSensor and setup like this:

    void readSensor()
    {
      sensor = analogRead(analoog);
      Serial.println(sensor);  // display temperature
      //long uptime = millis() / 60000L;

      // You can send any value at any time.
      // Please don't send more that 10 values per second.
      //Blynk.virtualWrite(V1, millis() / 1000); 

      val = digitalRead (pin) ;// digital interface will be assigned a value of 3 to read val
      if (val == HIGH) // When the flame sensor detects a signal, buzzer beep
      {
        digitalWrite (buzzer, HIGH);
        Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
      }
        else
     {
        digitalWrite (buzzer, LOW);
     }
        // Actually send the message.
        // Note:
        //   We allow 1 notification per 15 seconds for now.
        //Blynk.notify(String("Running for ") + uptime + " minutes.");
     }

     void setup()
     {
        pinMode (buzzer, OUTPUT) ;// define buzzer as output interface
        pinMode (pin, INPUT) ;// output interface defines the flame sensor
        pinMode (analoog, INPUT) ;// output interface defines the flame sensor
        // Debug console
        Serial.begin(115200);

        Blynk.begin(auth, ssid, pass);
         // You can also specify server:
         //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
         //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

         // Notify immediately on startup
         Blynk.notify("Device started");

         // Notify immediately on startup
          if(val==HIGH){
          //Blynk.notify("Flame!!!");
          //Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
          // Setup a function to be called every minute
          timer.setInterval(10L, readSensor);
       }
       // Setup a function to be called every 200ms Costas
       timer.setInterval(150L, readSensor);  // Costas
       //Blynk.email("nurlela.dabukke@gmail.com", "Flame!!!", "Sensor activated");
     }

But, nothing changed in the serial monitor.

5, 4, 3 is better than nothing :slight_smile:

Does an LED light up when on the sensor when you put a flame within 1 to 2 feet?

I still havenā€™t started fire. Doesnā€™t it to strange if I havenā€™t started fire but the value has been appeared? And nothing changed in the serial monitor when the fire started.

I think the 5, 4, 3 is actually around zero and you should get 600+ when you have a flame. What about the LEDā€™s on the sensor?

I just use buzzer, not LED. Should I change the buzzer to LED?

No, most flame sensors have their own LEDā€™s on the board. Do you have small LEDā€™s on your flame sensor board?

The LEDā€™s are marked up as L1 and L2 on the board, do they come on when you put the flame near the sensor?

If they donā€™t you have either wired them up wrongly or they are faulty.

The LED is off. But, when I use arduino uno with usb serial, the sensor can work well. Is my circuit have any wrong?

Yes if the LEDā€™s are not coming on when you put a flame near them. Did the LEDā€™s come on when you were hooked up to an Arduino?

Iā€™ll check your Fritzing schematic to see if I can spot any problems.

Not sure what you are trying to do with the diode and 3.3 Ohm resistor.

Disconnect A0 and D0. Disconnect the 5V feed. Connect 3.3V directly to the sensor along with the GND.

Your sensor is shown to work from 3.3V to 5V but some are 3.3V on the digital pin and 5V on the analog pin.

Forget the software for a moment. With my revised wiring does a flame turn the LEDā€™s on?

If they donā€™t try the 5V feed from the WeMos in place of the 3.3V but you MUST disconnect all the other wires, except ground, first. Does 5V and a flame now turn on the LEDā€™s?

I have do it and the LED is on. After that, what else?