Hardware

Software Used

Library Used

Arduino Client for MQTT

This library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT.

For more information about MQTT, visit mqtt.org.

Download

The latest version of the library can be downloaded from GitHub

Documentation

The library comes with a number of example sketches. See File > Examples > PubSubClient within the Arduino application.Full API Documentation.

Compatible Hardware

The library uses the Arduino Ethernet Client api for interacting with the underlying network hardware. This means it Just Works with a growing number of boards and shields, including:

  1. Arduino Ethernet
  2. Arduino Ethernet Shield
  3. Arduino YUN – use the included YunClient in place of EthernetClient, and be sure to do a Bridge.begin() first
  4. Arduino WiFi Shield - if you want to send packets greater than 90 bytes with this shield, enable the MQTT_MAX_TRANSFER_SIZE option in PubSubClient.h.
  5. Sparkfun WiFly Shield – when used with this library
  6. Intel Galileo/Edison
  7. ESP8266
  8. ESP32The library cannot currently be used with hardware based on the ENC28J60 chip – such as the Nanode or the Nuelectronics Ethernet Shield. For those, there is an alternative library available.

Wire Library

The Wire library allows you to communicate with I2C devices, often also called "2 wire" or "TWI" (Two Wire Interface), can download from Wire.h

Basic Usage

  1. Wire.begin()Begin using Wire in master mode, where you will initiate and control data transfers. This is the most common use when interfacing with most I2C peripheral chips.
  2. Wire.begin(address)Begin using Wire in slave mode, where you will respond at "address" when other I2C masters chips initiate communication.
  3. Transmitting
  4. Wire.beginTransmission(address)Start a new transmission to a device at "address". Master mode is used.
  5. Wire.write(data)Send data. In master mode, beginTransmission must be called first.
  6. Wire.endTransmission()In master mode, this ends the transmission and causes all buffered data to be sent.

Receiving

  1. Wire.requestFrom(address, count)Read "count" bytes from a device at "address". Master mode is used.
  2. Wire.available()Returns the number of bytes available by calling receive.
  3. Wire.read()Receive 1 byte.

Steps to send data to labview vibration and temperature platform using IoT Long Range Wireless Vibration and Temperature Sensor and ZigBee Coordinator Long Range  Wireless Mesh Modem with USB Interface:

Uploading the Code to ESP32 Using Arduino IDE

Serial Monitor Output

Making the Ubidots Work

 Click on devices and select devices in ubidot.                            Click on devices and select devices in Ubidots.

 Now you should see the published data in your Ubidots account, inside the device called "ESP32".Now you should see the published data in your Ubidots account, inside the device called "ESP32".

Create New variable

 Now you are able to view the Temperature and other sensors data which was previously viewed in 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 .Now you can 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 the variable inside device esp32. 

 Go to data select dashboard and inside dashboard create different widgets and add new widget  to your dashboard screen.Go to data select dashboard and inside dashboard create different widgets and add a new widget to your dashboard screen.

Output

Creating Events in Ubidots

Types of Events :Ubidots 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

Output of Event in Your Mail

Export Your Ubidots Data to Google Sheets

In this we can extract the data stored in the Ubidots cloud for further analysis.The possibilities are enormous; for instance, you could create an automatic report generator and send it to your customers every week.

Another application would be device provisioning; if you have thousands of devices to deploy, and their information is in a Google Sheet, you could create a script to read the sheet and create a Ubidots data source for every line on the file.Steps to do this-

1) Variables

2) Values

Result