Creating-Alert-Using-Ubidots-ESP32+Temp and Humidity Sensor

by Manish_Jugran in Circuits > Wireless

1517 Views, 2 Favorites, 0 Comments

Creating-Alert-Using-Ubidots-ESP32+Temp and Humidity Sensor

imgonline-com-ua-twotoone-KfVhwaWcfr55M70.jpg

In this tutorial, we will measure different temperature and humidity data using Temp and humidity sensor. You will also learn how to send this data to Ubidots. So that you can analyze it from anywhere for different application. Also by creating email alerts for different temperature and humidity data we could be notified about various changes occurring on any system temperature.

Hardware and Software Required

Steps to Send Data to LabVIEW Temperature and Humidity Platform Using IoT Long Range Wireless Temperature and Humidity Sensor and Long Range Wireless Mesh Modem With USB Interface-

Uploading the Code to ESP32 Using Arduino IDE:

  • Download and include the PubSubClient Library and Wire.h Library.
  • You must assign your unique Ubidots TOKEN, MQTTCLIENTNAME, SSID (WiFi Name) and Password of the available network.
  • Compile and upload the temp_humidity.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.

Downloads

Serial Monitor Output.

serialout.JPG

Making the Ubidot Work:

device.JPG
Device.JPG
variable.JPG
device2.JPG
dahboard 1.JPG
dahboard2.JPG
dahboard3.JPG
widget1.JPG
widget2.JPG
widget3.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 Ubidots dashboard name esp32.
  • Click on devices and select devices in Ubidots.
  • 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 reading is passed as a string and store in a variable and publish to a variable inside device esp32.

OUTPUT

widget4.JPG

Creating Events in Ubidots:

event1.JPG
event2.JPG
event3.JPG
event4.JPG
event6.PNG
event9.JPG
event5.JPG
event6.JPG
event7.JPG

  • Select Events (from the Data dropdown).
  • Now click on Create Event.
  • Types of EventsUbidots support already integrated events to allow you to send Events, Alerts, and Notifications to those who need to know when they need to know. Ubidots' prebuilt integrations include:

1. Email notifications

2. SMS notifications

3. Webhook events - learn more

4. Telegram notifications

5. Slack notifications - learn more

6. Voice Call notifications - learn more

7. Back to Normal notification - learn more

8. Geofence notifications - learn more

  • Then choose a device and associating variable that indicates the devices' "values".
  • Now select a threshold value for your event to trigger and compare it to device values and also select time to trigger your event.
  • Now, create action type by clicking plus sign.
  • Establish and configure which actions are to be executed and the message to the receiver: Send SMS, Email, Webhooks, Telegrams, Phone Calls, SLACK, and webhooks to those who need to know.
  • Now fill all the required fields.
  • Determine the activity window the events may/may not be executed.
  • Confirm your Events.

Output of Event in Your Mail

event8.JPG