Close
0%
0%

Running Faucet Alert System

A smart device that detects running faucets using a machine learning model and sends alert messages over a cellular network.

Public Chat
Similar projects worth following
Water conservation is the most cost-effective and environmentally sound way to reduce our water demand. Although water is used all over the world to generate electricity, using less water conserves a vast amount of energy annually. It also helps to alleviate pressures on our sewage and drainage systems. Most important, however, water conservation helps prolong the lifespan of lakes and rivers which are crucial to the health of ecosystems around the world.

This project tries to alleviate water wastage in households by reminding you but it also helps in seniors' safety. Poor memory is only one of the many unpleasant experiences that accompany old age and these problems can have far-reaching implications on the comfort and security of seniors. Dementia is one of the most common neurological problems associated with the elderly. Imagine a case of seniors leaving the faucet on. The kind of water damage that might ensue is simply unimaginable. Not to mention lots of safety concerns such as electrocution and drowning. Also, sometimes kids or even adults forget to turn off the faucet after use. It also adds up to your monthly water usage bills.

In this project, I have built a proof-of-concept of an AIoT (Artificial intelligence of things) device which can detect running faucets using a microphone and can send an alert notification message. 

Although this proof-of-concept device is used in the house with a wall outlet but it can be powered using batteries. Being equipped with cellular connectivity, it can be installed in those areas where there is no WiFi network. This is an easy-to-use and convenient device that respects users' privacy by running the inferencing at the edge and sends alert notifications on time.

Demo

  • 1 × Arduino Nano 33 BLE Sense
  • 1 × Blues Notecard (Cellular)
  • 1 × Blues Notecarrier-B
  • 1 × Protoboard
  • 1 × Generic DIY Project Plastic Box

  • 1
    Hardware Selection

    This project requires a low-powered, reliable, and widely available yet cost-effective cellular network radio to send alert messages to the phone and cloud. I will be using a Blues Wireless Notecard (for Cellular connectivity) and a Blues Wireless Notecarrier-B, a carrier board for the Notecard.

    Although the Notecard is capable as a standalone device for tracking purposes, we need to run Tensorflow Lite model inferencing using Edge Impulse, so we will be using an Arduino Nano 33 BLE as a host MCU. The slim profile of the Notecard with carrier board and inbuilt microphone on the Arduino Nano 33 BLE make it a good fit for our purpose. We need an antenna for better indoor cellular connectivity and a protoboard to assemble the hardware.

    The Notecarrier-B and Arduino Nano 33 BLE are connected over I2C.

    The schematics are given below.

  • 2
    Model creation and training

    We will use Edge Impulse Studio to train and build a TensorFlow Lite model. We need to create an account and create a new project at https://studio.edgeimpulse.com. We are using a prebuilt dataset for detecting whether a faucet is running based on audio. It contains 15 minutes of data sampled from a microphone at 16KHz over the following two classes:

    • Faucet - faucet is running, with a variety of background activities.
    • Noise - just background activities.

    We can import this dataset to the Edge Impulse Studio project using the Edge Impulse CLI Uploader. Please follow the instructions here to install Edge Impulse CLI:  https://docs.edgeimpulse.com/docs/cli-installation. The datasets can be downloaded from here:  https://cdn.edgeimpulse.com/datasets/faucet.zip.

    $ unzip faucet.zip
    $ cd faucet
    $ edge-impulse-uploader --clean
    Edge Impulse uploader v1.16.0
    ? What is your user name or e-mail address (edgeimpulse.com)?

    You will be prompted for your username, password, and the project where you want to add the dataset.

    $ edge-impulse-uploader --category training faucet/training/*.cbor
    $ edge-impulse-uploader --category testing faucet/testing/*.cbor

    After uploading is finished we can see the data on the Data Acquisition page.

    In the Impulse Design > Create Impulse page, we can add a processing block and learning block. We have chosen MFE for the processing block which extracts a spectrogram from audio signals using Mel-filterbank energy features, great for non-voice audio, and for the learning block, we have chosen Neural Network (Keras) which learns patterns from data and can apply these to new data for recognizing audio.

    Now we need to generate features in the Impulse Design > MFE page. We can go with the default parameters.

    After clicking on the Save Parameters button the page will redirect to the Generate Features page where we can start generating features which would take a few minutes. After feature generation, we can see the output in the Feature Explorer.

    Now we can go to the Impulse Design > NN Classifier page where we can define the Neural Network architecture. We are using a 1-D convolutional network which is suitable for audio classification.

    After finalizing the architecture, we can start training which will take a couple of minutes to finish. We can see the accuracy and confusion matrix below.

    For such a small dataset 99.2% accuracy is pretty good so we will use this model.

  • 3
    Model Testing

    We can test the model on the test datasets by going to the Model testing page and clicking on the Classify all button. The model has 91.24% accuracy on the test datasets, so we are confident that the model should work in a real environment.

View all 6 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates