Most homes have several people, each with their own habits regarding water usage. Many studies have been done around the world, showing that one of the biggest waster wastage happens in our own washrooms:
- Taking unnecessarily long showers
- Flushing toilets too often, sometimes just to flush down a piece of tissue paper
- Leaving the tap running while brushing, etc
What most people don't realize is that billions of gallons of water is wasted in every city each year due to these habits, while people in many other places still have no access to clean water at all, even today. Also, in many places, this water is produced through desalination or other purification methods that consume huge amounts of fuel or electricity to power those processes. All of this contributes to unnecessary emissions and global warming. And in many cases, it happens without us realizing it.
If only we could develop better habits.
PlanMy plan is to build a small, self contained, low-cost, battery powered device that can be placed in the washroom. It can be just sitting in a corner, wearing a 3d printed cover for aesthetics. The device will keep track of the water usage by running ML on onboard microphone data and alert users when they've been showering for too long, or keeping the tap running for too long (while brushing teeth, for example).
The solution will work by using a model trained to recognize the following 4 categories through onboard microphone:
- Tap water running
- Flushing event
- Shower running
- No water Usage (Basically everything else, when water is not being used)
I hope to use the SensiML software for this part, and then deploy it on the Quick Feather.
Learning Process/Useful Resources:Quick start guide:
https://www.hackster.io/gatoninja236/getting-started-with-the-quickfeather-dev-kit-and-sensiml-9881a3 and the corresponding video here.
SensiML video series:
SensiML video series can be watched on youtube here.
Lots of good resources from QuickLogic on their competition page here.
One quirk i found with SensiML's Data capture Lab: After you disconnect from the device for any reason, you cannot connect back to it until you press the reset button on it again. Otherwise it will stay stuck at "Retrieving Configuration".
Building the projectInitially I followed the whole process in the resources mentioned above and hit a snag when I found that the firmware for data collection only supported the accelerometer, since I was planning to use the built-in microphone. However, this was recently fixed by QuickLogic.
For installation and setup, the procedure here works pretty well, except that we're using microphone instead of accelerometer.
First of all, i downloaded the data collection binary from here. I used the quickfeather-audio-data-collection-usb-serial.bin
file.
After cloning the Tiny Fpga programmer application using command line
git clone --recursive https://github.com/QuickLogic-Corp/TinyFPGA-Programmer-Application.git
And installing it
pip3 install tinyfpgab
I was now ready to program the device.
I placed the .bin file downloaded earlier into the same folder as the cloned TinyFpga Application, and then used command line to flash the binary to the quicklogic device connected via usb
python tinyfpga-programmer-gui.py --port COM10 --m4 quickfeather-audio-data-collection-serial.bin --mode m4
Note that COM10 is what i have on my machine and can be different on yours. Secondly, to put the board into flash mode, you have to press Reset followed by User button on the Quickfeather board. After the program had finished uploading, pressed the 'Reset' button to load the new application. The LED blinked blue for five seconds and then turned off. I also saw a new USB-serial device appear in my device manager (COM12 in my case).
At this point, I was setup to capture some data in SensiML Data Capture Lab.
I create a free account and downloaded the SensiML Data Capture Lab software.
After creating a new project in Data Capture Lab and connnecting to the device and selecting microphone ase the sensor, I created the following labels in my project:
I also created two metadata classes
After this, i went ahead and collected some data for each class.
Comments