DEV Community

blueish4
blueish4

Posted on

My Bachelor's Degree project

My Final Project

I built an Internet of Things based noise loudness analyser that visualised the perceived volume of sounds on a web page.

Demo Link

https://individual-project-265621.firebaseapp.com/spectrogram

Link to Code

GitHub logo blueish4 / IndividualProject-device

A platform.io project that uses a Heltec LoRa V1 dev board and a microphone to monitor office usableness

Room noise monitor - Device

This is a section of my final year project which aims to create a system to monitor ambient noise in a given environment. A summary of the project can be found at https://blog.blueish.me/posts/dissertation/

Setup

This project used platform.io as a framework to compile code to an ESP32. The specific board used is the Heltec WiFi LoRa v1 board, but it shouldn't be too difficult to configure for any other esp32 board. It can connect to both WPA2-PSK and WPA2-Enterprise networks, and details should be supplied in lib/transmit/config.h.

It also uses Google's MQTT service, which should be configured as per the documentation lib/transmit/ciotc_config.h should contain the device's private key and the current X.509 certificate for the google service in your area (instructions are provided above the config options).

Methodology

Once connected to wifi, the board samples enough audio samples, performs an FFT on them, then…


GitHub logo blueish4 / ip-dashboard

A simple demonstration dashboard for the individual project, written as a static vue app!

fyp-dashboard

This acts as a web-based frontend to the information stored in Firebase. There are two pages - one houses an equaliser-style graph for the most recent reading and the other uses a HTML canvas to draw a spectrogram-style heatmap as well as a scatter plot of dBA values and the most prevalent frequency (as generated by the device).

This is now just an archive of my work, and the writeup and dissertation can be found at https://blog.blueish.me/posts/dissertation/

Architecture

This project fetches the last 20 records on initial load, then polls for an update every 5 seconds. 25 objects are kept in the VueX store in a time-based queue (insertions push out the oldest record). Charts all dynamically update when the required data is polled (except the spectrogram, which uses it's own 5 second timer to poll the store and refresh).

Project setup

npm install

Compiles and hot-reloads for development


GitHub logo blueish4 / IndividualProject-functions

The cloud functions that I created for my final dissertation project, to be run on GCP

Cloud functions - listener project

This is a simple script to act as a bridge between the Pub/Sub system and Firestore (for data ingest), and Firestore and clients (for data use). Ingest unpacks the binary format recieved by the MQTT bridge (double,double, ...uint16_t).

This is only one part of my final year project, which has a small write up and linkes to other repos at https://blog.blueish.me/posts/dissertation/




How I built it

It uses an Arduino base built with Platform.io that runs on an ESP32. This device calculates and weights the frequency bands appropriately. It gets stored in Google Cloud using serverless functions (running node.js) and Firestore.
The final view is provided through a simple Vue.js webapp that graphs out the most recent records on a spectrograph. Data is retrieved using another serverless function, and is hosted as flat files on Firebase.

Additional Thoughts / Feelings / Stories

Working with hardware is fun, but it did take a week of troubleshooting in the engineering lab to debug the weighting algorithm properly.

Top comments (0)