A faucet left running will use from 3 - 5 gallons a minute, or in a 24-hour period, you will have used 7, 200 gallons. 3. Check for leaking toilets. A leaking toilet can use up to 4 - 10 gallons of water an hour, or in a 24-hour period, 96 - 240 gallons of water. A scenario where the faucet is left open overnight could be a considerable loss as our precious water gets wasted and could add some electricity bill.
I'll be using the Nordic Thingy:53 which has numerous in-built sensors, and a digital microphone to detect whether the faucet is open more than the set time and create an alert.
- Connect the development board to your computer
- Use a USB cable to connect the development board to your computer. Then, set the power switch to 'on'.
- Download the latest Edge Impulse firmware: Edge Impulse firmware: nordic-thingy53-full.zip
- Open nRF Connect for Desktop and launch the Programmer app. Move the power switch SW1 to the OFF position. Take off the top cover to access the SW2 button. Press SW2 while switching SW1 to the ON position.
- Update the firmware
We will use edge impulse to build & train the TensorFlow Lite model. The prebuilt dataset for detecting whether a faucet is running is based on audio. It contains 15 minutes of data sampled from a MEMS microphone at 16KHz over the following two classes:
- Faucet - faucet is running, with a variety of background activities.
- Noise - just background activities.
We will be creating an edge impulse project named Thingy 53: Running faucet detection. Running the following command will require your edge impulse email & password.
edge-impulse-daemon
We can import this dataset to your Edge Impulse project using the Edge Impulse CLI Uploader. If you haven't done so, follow the Installation instructions. Download the faucet dataset and unzip them. Navigate to the directory using the command prompt. Run the following commands
$ edge-impulse-uploader --clean
$ edge-impulse-uploader --category training faucet/training/*.cbor
% / $ edge-impulse-uploader --category testing faucet/testing/*.cbor
We have an 87% & 13% split for training and testing data. Next, we create Impulse and add the processing block with MFE that extracts a spectrogram from audio signals using Mel-filterbank energy features, great for non-voice audio. Next, we add a Keras Classification learning block, then click on Save Impulse. Next, we click the Generate features to train the model. After a few minutes, we can see the output in the Feature Explorer.
Now we click the Impulse Design > NN Classifier page and select the neural network architecture to the 1D convolutional which is preferable for audio classification. We can see the accuracy and the confusion matrix for the output features.
We run the live classification with the existing test samples as shown. Once we load samples for each feature, you can find the detailed results of the live classification.
Click on the model testing -> Classify all. Now the model is tested with all the test data. You can find 99.58% accuracy in the model testing results.
Deploy your impulse by selecting Nordic thingy53 in the Build firmware and clicking on the Build button. Unzip the downloaded zip and move the library bundle to the nrfConnect project source directory.
DemoThis project can be implemented to reduce the wastage of water by detecting the running faucet. This might be a simple/tiny project but can make a huge impact in saving water (Indicator 6.4.1 - Change in water use efficiency over time)
Resources:
Comments