Skip to content

VisData is a data monitoring project, where sensor data can be monitored and visualised.

License

Notifications You must be signed in to change notification settings

himanshushah05/VisData

Repository files navigation

🌤➡🖥 VisData

VisData is a data monitoring project, where sensor data can be monitored and visualised. In some small scale industries, where it is not possible or afforadable to install a proper PLC based system, we can integrate this system. This is effectively affordable and with slight modifications can be used to detect industry level signals as well.

🗒 Description:

The project includes an ESP32 connected to DHT11 sensor. After every 15 minutes, my system wakes up from deep sleep and records the reading and goes to deep sleep again. The data is written to google sheets using IFTTT. The google sheets data is further visualized using Grafana dashboard.

📸 Images of IFTTT applet and Grafana Dashboard

Dashboard

IFTTT Applet

🔮 Future Scope

  • This system can be used as an HMI for any type of sensor readings.
  • This device with some modifications and by connecting multiple devices to one central device, can be a prototype or a small scale version of DCS.

🔧 Hardware Setup

  • The hardware is very simple. It includes just a DHT11 sensor connected to ESP32.
  • Connections - signal pin connected to D4 of ESP32

🖥 Software

1. Setting up IFTTT applet:

  • Create a new applet after logging in to the IFTTT.
  • In the If this place, select Webhooks and choose Receive a web request as the trigger.
  • Name the event as per your choice. (In my case, it is dht_readings)
  • In the then that place, select Google Sheets as the service.
  • Connect the Google Sheets service with your Google sheets and then choose the action as add row to spreadsheet
  • Then, complete the action fields. Give the spreadsheet a name, leave the Formatted row field as default, and then, choose a Google Drive folder path. (If you leave this field empty, IFTTT will create a folder called “IFTTT” in your Google Drive folder to save the spreadsheet)
  • Finally, click the Create action button.

Testing the applet

  • Go to Webhooks Service Page and go to Documentation.
  • The page will show your unique API key. (Save this for later use)
  • Fill the trigger event section with your event name.
  • Then fill some values in the JSON body to send test it. (IFTTT supports 3 values only, if you want to add more, you can fill a json with multiple data and then seperate it in google sheets to different column)
  • Click test it button and it will show you a green message saying “Event has been triggered”.
  • Go to your drive and search for IFTTT, in that folder the new spreadsheet will be there and it will have the reading that just you added while testing.

Changes in Arduino code as per the applet

  • Replace your wifi credentials in the code
  • Put your resource URL as "/trigger/{your_event_name}/with/key/gJ868-fZ2z0QHxAW9vAlngrMRAcrFVnNElyAwuOxh8S"
  • My system is deep sleep mode for the whole time and wakes up only once in every 15 minutes hence saving battery. You can change this value by changing TIME_TO_SLEEP variable to as many seconds you want.

2. Creating Grafana Dashboard

Adding the Google Sheets Plugin

  • Sign up to Grafana.
  • After downloading Grafana from Downloads, visit http://localhost:3000/. It will load the Grafana.
  • The Grafana can take data from different sources so in order to setup Google sheets as the data source, we have to install plugin for it.
  • Go to https://grafana.com/grafana/plugins/grafana-googlesheets-datasource/?tab=installation and install the plugin.
  • Now, go to the Grafana (i.e., http://localhost:3000/ )and under add data source, search for google sheets plugin and select it.
  • To configure the data source, select API key as the Auth. (Make a note that this API key is different from the IFTTT API key)
  • Now to generate API key for authentication of google sheets, go to https://console.cloud.google.com/home/
  • Create new project and under API & services, go to credentials and generate a new API key. Now go to the dashboard from the same menu and click on Enable API and Services, search for Google Sheets API and enable it.
  • Now copy paste this Google cloud API key into Grafana and click save and test.

Now, Let's create the Dashboard

👨‍💻 Creating Dashboard

  • Now, in the Grafana menu, go to Dashboard and create a new dashboard.
  • then Add new Visualization and then select data source as Google Sheets and then under spreadsheet ID enter the part of url from d/{ID}/edit. for eg, https://docs.google.com/spreadsheets/d/1WolxfNRQPFwx5RC2aLBHSdERplVnZVVL1kQcOXznY64/edit?usp=sharing in this link 1WolxfNRQPFwx5RC2aLBHSdERplVnZVVL1kQcOXznY64 will be the ID.
  • Then by using different Visualization tools such as Gauges, graphs and tables, We can visualize the data as per our requirement.

About

VisData is a data monitoring project, where sensor data can be monitored and visualised.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages