Introduction: Flame Sensor With Telegram Notifications

In this project the flame sensor with telegram notifications is realized. So when the fire is detected by a sensor, you get a notification about this event immediately in Telegram. It is pretty useful and convenient.

So how it works ? I'll show you! Let's get it started!

Step 1: Components Required

For this project we need:

  1. NodeMCU V3 with ESP12 - 1;
  2. IF Flame Sensor - 1 ;
  3. Jumper Wires - 3;
  4. USB cable - 1;
  5. Any PC - 1.

Step 2: Schematics

NodeMCU and Flame sensor must be connected as shown on a figure above. NodeMCU is also connected to PC via USB cable.

Step 3: Notifications Realization

To make notifications, we have to set up IFTTT.

Step 4: Setting Up IFTTT

Actions you need to do:

  1. Go to ifttt.com;
  2. Register on this website;
  3. Once you registered you can create applets. Press "New Applet" and then "if +this";
  4. Choose a service "Webhooks" and then click on "Receive a web request";
  5. Now you need to write a name of event you will refer to in your sketch to adjust notifications. It doesn't matter what a name you will give to it. It can be "fire_detected", for instance. But notice that the EXACT name of event must be used in your sketch.
  6. Press "+that";
  7. Now you are supposed to choose a service that will send you notifications when fire detected. In our case it is a Telegram, so choose action service "Telegram";
  8. Choose "Send message";
  9. Than you can modify the message content that you will receive when the event happens, so when fire detected. Also you can choose whether you will get notifications from standard IFTTT dialogue or any other dialogue. But notice that in any case you will be notified by IFTTT, so in fact to get notifications from any other dialogue, you need to add IFTTT to that dialogue. The only advantage of such action is that you can name this dialogue "Fire alarm" or somehow else and then only have read the name of dialogue in notification you will know what happened without reading a text of message.
  10. Click "Create action" and then "Finish".
  11. You set up IFTTT!

Step 5: Code of Program

On ifttt.com choose your profile and go to "My services". Click on "Webhooks" and then press "Settings". You will see URL like on a figure above. The symbols combination after last "/" is your Webhooks Service Key. It is necessary to know it because you will use it in the program. Just open "EMAIL.ino" and fill in your SSID, WiFi network password and Webhooks Service Key.

Step 6: Testing It Out