IoT- Ubidots- ESP32+Long-Range-Wireless-Vibration-And-Temperature-Sensor

by Manish_Jugran in Circuits > Wireless

907 Views, 1 Favorites, 0 Comments

IoT- Ubidots- ESP32+Long-Range-Wireless-Vibration-And-Temperature-Sensor

Vibration-Sensor.png

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, encounter 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.

In this project, we are introducing NCD’s Long Range IoT Industrial wireless vibration and temperature sensor, boasting up to a 2 Mile range using a wireless mesh networking architecture. Incorporating a precision 16-bit vibration and temperature sensor, this device transmits highly accurate vibration and temperature data at user-defined intervals. It has a different application:

  • Metalworking
  • Power generation
  • Mining
  • Food and Beverage

Hardware and Software Required

Vibration-Temp-NO-Zigmo-600x400.png
Zigmo_1.png
ESP32_1-600x400.png

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.

Uploading the Code to ESP32 Using Arduino IDE:

  • As esp32 is an important part to publish your vibration and temperature data to Ubidots.
  • Download and include the PubSubClient Library and Wire.h Library.
#include <WiFi.h>

#include <PubSubClient.h>

#include <Wire.h>
  • You must assign your unique Ubidots TOKEN, MQTTCLIENTNAME, SSID (WiFi Name) and Password of the available network.
#define WIFISSID "xyz" // Put your WifiSSID here
#define PASSWORD "xyz" // Put your wifi password here
#define TOKEN "xyz" // Put your Ubidots' TOKEN
#define MQTT_CLIENT_NAME "xyz" // MQTT client Name
  • Define variable and device name on which the data will send to ubidots.
#define VARIABLE_LABEL "sensor"// Assing the variable label

#define VARIABLE_LABEL1 "AdcValue"

#define VARIABLE_LABEL2 "Battery"

#define VARIABLE_LABEL3 "RMS_X"

#define VARIABLE_LABEL4 "RMS_Y"

#define DEVICE_LABEL "esp32" // Assig the device label</p>
  • Space to store values to send:
char str_sensor[10];

char str_sensorbat[10];

char str_sensorAdc[10];

char  str_sensorRmsx[10];

char  str_sensorRmsy[10];
  • Code to publish data to ubidots:
sprintf(topic, "%s", ""); // Cleans the topic content   
sprintf(topic, "%s%s", "/v1.6/devices/", DEVICE_LABEL);
sprintf(payload, "%s", ""); // Cleans the payload content
sprintf(payload, "{\"%s\":", VARIABLE_LABEL); // Adds the variable label
sprintf(payload, "%s {\"value\": %s", payload, str_sensor); // Adds the value
sprintf(payload, "%s } }", payload); // Closes the dictionary brackets   
client.publish(topic, payload);
  • Compile and upload the Ncd__vibration_and_temperature.ino code.
  • 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.

Code:

Serial Monitor Output:

vibration serial.JPG

Making the Ubidot Work:

dashboard1.JPG
device name.PNG
variableout.JPG
  • Create the account on Ubidots.
  • Go to my profile and note down the token key which is a unique key for every account and paste it to your ESP32 code before uploading.
  • Add a new device to your ubidot dashboard name esp32.
  • Now you should see the published data in your Ubidots account, inside the device called "ESP32".
  • Inside the device create a new variable name sensor in which your temperature reading will be shown.
  • Now you are able to view the Temperature and other sensors data which was previously viewed in the serial monitor. This happened because the value of different sensor readings is passed as a string and store in variable and publish to variable inside device esp32.

Create Dashboard in Ubidots:

dashboard.png
widget.PNG
  • Go to data select dashboard.
  • Inside dashboard creates different widgets.
  • Add new widgets to your dashboard screen.

Output at Ubidots Dashboard.

outputncd vibration.PNG