Project Demo
Intro

Hardware Requirements
Software Requirements
Hardware Setup
The development board used in this project is the Seeed Wio Terminal. The reason why we used this development board in this project is that is a complete system equipped with Screen + Development Board + Input/Output Interface + Enclosure.


- When there is no flow
- When there is a flow
- When there is a leak

Software Setup
To set up your Seeed Wio Terminal for Edge Impulse, you can follow this guide. But we are using an alternative method to collect data. In our method, the data is collected as CSV files and uploaded to Edge Impulse. And then we proceed to the TinyML model generation as usual.1. Data Collection
We have the water flow sensor which outputs a PWM signal. So instead of collecting the analog values from the sensor, we calculated the flow rate using an equation and it is collected as the time series data. We have collected the flow rates for no flow, normal flow, and leak which seem to be distinguishable by the model. To collect data for your project, follow these steps:- Upload DataCollection.ino to Wio Terminal.
- Plug your Wio Terminal into the computer.
- Run SerialDataCollection.py in the computer.
- Press button
C
to start recording. - When you have enough data, press button
C
again to stop recording. - Once you have stopped recording, it will generate a CSV file on your computer. Name it according to the flow state.
- Upload the CSV file to Edge Impulse using the Data Acquisition Tab.




2. Impulse Design
An impulse is a machine learning pipeline that takes raw data, does signal processing to extract features, and then employs a learning block to categorize new data.


3. Model Training And Testing
Move on to the Classifier tab. Here we have 3 parameters to modify. First, leave the settings as it is and train the model once. In our case, it output a model with 30% training accuracy. So we tweaked the parameters many times until satisfactory training accuracy is attained. These are our Neural Network settings.


4. Deployment
From the Deployment tab, build an Arduino Library. You can enable optimisations with EON Compiler if you like, but is optional.
.zip
file containing the model and some examples. Add the library to the Arduino IDE using Sketch > Include Library > Add .ZIP library

static_buffer.ino
located at File > Examples > Your Project Name > static_buffer > static_buffer.ino to do dynamic inferencing.

Final Output
After the deployment, now we have a system consisting of a Wio Terminal, Flow Rate Sensor, and AI model that can detect a possible leak in the pipeline. The three modes of output are shown below.

