A data visualisation project for data collected at home, such as Temperature, Humidity, Air Pressure and Air Quality.
The project offers the following main components:
- python script to collect data (in folder sensor_script)
- Flutter application to visualize data (in folder home_data_flutter)
- Node JS server to make data available to flutter application (in folder server)
The project includes a script (based on this example) to collect data for example on a Raspberry Pi, using a BME680 sensor. Said script is written in python. After cloning the project and setting up the connection to the sensor, the script can be started using the following command: python3 bme680_com.py
It will first conduct a burn in, to set the baseline for the Air Quality Index computation. More info here.
After the 5 min burn in, data will be collected every 10 minutes and sent to a MongoDB server on the local network. Basic setup instructions for MongoDB on a RaspberryPi can be found here.
A simple node js server with express js is being used to query the MongoDB database on the same device upon request and answer with the data that has been collected in the last 24 hours.
The server can be started from within the server folder with the following command: node index.js
You'll need the following packages to run the server:
- expressjs
- mongoose
The server will connect to the MongoDB database and then accept requests on port 3001.
The flutter application provides a simple interface to display the data of the last 24 hours. A server request at serverIP:3001/recentData
will return the data needed. This request will be fired upon start of the app and upon pull-to-refresh inside the app. NOTE: the server IP address in the project files is in a local network, remember to change it accordingly.
Screenshots of the app: