Creating-Alert-Using-ThingSpeak+ESP32 and Vibration Sensor

Introduction: Creating-Alert-Using-ThingSpeak+ESP32 and Vibration Sensor

In this project, we will create an email alert of machine vibration and temperature using the ThingSpeak+IFTTT-vibration sensor and ESP32.

Vibration is truly a to and fro movement—or oscillation—of machines and components in motorized gadgets. Vibration in the industrial system may be a symptom, or motive, of a hassle, or it can be associated with everyday operation. For instance, oscillating sanders and vibratory tumblers depend upon vibration to feature. Internal combustion engines and tools drive, then again, revel in a sure amount of unavoidable vibration. Vibration can imply a hassle and if left unchecked can cause harm or expedited deterioration. Vibration can be resulting from one or extra factors at any given time, the maximum not unusual being an imbalance, misalignment, put on, and looseness. This damage can be minimized by analyzing Temperature and Vibration Data on ThingSpeak using esp32 and NCD wireless vibration and temperature sensor.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Hardware and Software Required


  • ESP-32: The ESP32 makes it easy to use the Arduino IDE and the Arduino Wire Language for IoT applications. This ESp32 IoT Module combines Wi-Fi, Bluetooth, and Bluetooth BLE for a variety of diverse applications. This module comes fully-equipped with 2 CPU cores that can be controlled and powered individually, and with an adjustable clock frequency of 80 MHz to 240 MHz. This ESP32 IoT WiFi BLE Module with Integrated USB is designed to fit in all IoT products.
  • IoT Long Range Wireless Vibration And Temperature Sensor: The IoT long-range wireless vibration and temperature sensor is battery operated and wireless, meaning that current or communication wires need not be pulled to get it up and operating. It tracks the vibration information of your machine constantly and captures and operate hours at full resolution together with other temperature parameters. In this, we are using NCD’s long-range IoT Industrial wireless vibration and temperature sensor, boasting up to a 2-mile range using a wireless mesh networking architecture.
  • I2C Cable:NodeLynk I2C cables with 4-color wire and latching connectors to link sensors and controllers together in any combination.
  • Particle Electron or Photon-Compatible I2C Shield
  • Long-Range Wireless Mesh Modem with USB Interface

Software Used

  • Arduino IDE
  • ThigSpeak

Library Used

  • PubSubClient Library
  • Wire.h

Step 2: Steps to Send Data to Labview Vibration and Temperature Platform Using IoT Long Range Wireless Vibration and Temperature Sensor and Long Range Wireless Mesh Modem With USB Interface:

Step 3: Uploading the Code to ESP32 Using Arduino IDE

  • Download and include the PubSubClient Library and Wire.h Library.
  • Compile and upload the ESP32-ThinSpeak.ino code.
  • You must assign your API key, SSID (WiFi Name) and Password of the available network.
  • To verify the connectivity of the device and the data sent, open the serial monitor. If no response is seen, try unplugging your ESP32 and then plugging it again. Make sure the baud rate of the Serial monitor is set to the same one specified in your code 115200.

Step 4: Serial Monitor Output

Step 5: Making the ThingSpeak Work

  • Create the account on ThingSpeak.
  • Create a new channel, by clicking on channels
  • Click on My Channels.

  • Click New Channel.
  • Inside New Channel, name the channel.
  • Name the Field inside the Channel, Field is the variable in which the data is published.
  • Now save the Channel.
  • Now you can find your API keys on the dashboard. Go to the tap on the homepage and find your 'Write API Key' which must be updated before uploading the code to ESP32.
  • Once Channel is created you would be able to view your temperature and vibration data in private view with Fields you created inside the Channel.
  • To plot a graph between different vibration data, you can use MATLAB Visualization.
  • For this go to App, Click on MATLAB Visualization.
  • Inside it select Custom, in this, we have select create 2-D line plots with y-axes on both left and right sides. Now click create.
  • MATLAB code will be autogenerated as you create visualization but you have to edit field id, read channel id, can check the following figure.
  • Then save and run the code.
  • You would see the plot.

Step 6: Output

Step 7: Create an IFTTT Applet

  • First, create an IFTTT account.
  • Create an applet. Select My Applets.
  • Click the New Applet button.
  • Select the input action. Click the word this.
  • Click the Webhooks service. Enter Webhooks in the search field. Select the Webhooks.
  • Choose a trigger.
  • Complete the trigger fields. After you select Webhooks as the trigger, click the Receive a web request box to continue. Enter an event name.
  • Create trigger.
  • Now the trigger is created, for resulting action click That.
  • Enter email in the search bar, and select the Email box . Now choose action. Select the Send me an email box and then enter the message information.
  • Retrieve your Webhooks trigger information. Select My Applets, Services and search for Webhooks. Click Webhooks and Documentation button. You see your key and the format for sending a request. Enter the event name. The event name for this example is VibrationAndTempData.You can test the service using the test button or by pasting the URL into your browser.

Create a MATLAB Analysis

  • You can use the result of your analysis to trigger web requests, such as writing a trigger to IFTTT.
  • Click Apps, MATLAB Analysis and select New.
  • Select Trigger Email from IFTTT in the Examples section. The code below is prepopulated in your MATLAB analysis window. Name your analysis and modify the code.
  • Save your MATLAB Analysis.

Step 8: Create a Time Control to Run Your Analysis

Evaluate your ThingSpeak channel data and trigger other events.

  • Click Apps, TimeControl, and then click New TimeControl.
  • Save your TimeControl.

Step 9: Output

  • At last Mail, an alert is created.

Be the First to Share


    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest



    6 months ago

    Hello there!

    We're glad you want to share something with the Instructables community!

    And we’re here to help you out.

    In order to be published live on the site and be eligible to enter a contest, an Instructable must consist of the following things:

    - Multiple written steps showing how you made your project

    - Photos in each step

    - Only your own original images

    Check out our free online class that walks you through how to write an Instructable:

    Beyond making your Instructable simply publishable, this guide ( explains what is required to have your Instructables featured by our site editors. It’s very helpful, and definitely worth checking out.

    We would love to review your project again after you have made the necessary edits, and we will publish your project if it is eligible.

    If you have any questions, please feel free to ask right here or send us an email to


    Instructables Community Manager