Flow-Rate Monitor
Monitor and measure liquid flow rate.
To run this project yourself you’ll need to:
- Configure Notehub.
- Purchase and assemble the necessary hardware.
- Flash the project’s firmware.
- Run the project’s web application.
Notehub
The Flow Rate Monitor project runs on top of Notehub. As such, to run this sample you’ll need to create a Notehub account, start a new Notehub project, and configure a handful of environment variables.
Creating a New Project
- Sign up for a free Notehub account, if you don’t have one already.
- Click the blue Create Project button in the top-right corner of the screen.
- Give the project a name, such as “FlowRateMonitor”, and then click the next Create Project button.
Configuring Environment Variables
The Flow Monitor project uses environment variables for storing project settings that need to be shared and synchronized across devices.
You can set this project’s environment variables at the fleet level or device level, where fleet-level variables affect all devices in the fleet, and device-level variables are specific to an individual device.
Notehub creates an initial fleet for you when you start a new project, and you can use that for setting your initial variables.
- Navigate to your fleet in the navigation menu, and then click the Settings link.
- Click the Environment tab.
- Scroll down to the Fleet environment variables heading, and define the
four variables below.
flow_rate_alarm_threshold_max
: (number) The maximum expected flow rate from your device, in mL / min. Flow-rate readings over this amount will trigger an alarm.flow_rate_alarm_threshold_min
: (number) The minimum expected flow rate from your device, in mL / min. Flow-rate readings under this amount will trigger an alarm.monitor_interval
: (integer) How often to take readings from the device’s flow-rate monitor, in seconds.
- With all three defined, click the blue Save button.
With this your Notehub backend is fully configured, and you’re ready to start setting up your hardware.
Hardware
The following hardware is required to run the Flow Rate Monitor project.
- A Blues Starter Kit.
- A flow meter, such as this GREDIA Quick Connect Water Flow Sensor.
- Tubing for moving liquid throughout your hardware, such as this 1/4 OD silicone tubing.
- A power breakout, such as this HiLetgo power breakout for supplying correct voltage to this project’s various components.
- An I2C level shifter, such as this one from HiLetgo, to translate the flow meter’s pulses from 5V logic to 3.3V logic for the Swan microcontroller.
Additionally you may wish to also use the following:
- (Optional) An enclosure for your hardware such as this outdoor-friendly enclosure from Sixfab.
Once you have all of your hardware you’ll next need to assemble the pieces. To start, complete the Notecard and Notecarrier-F quickstart guide, which will help you connect your Notecard, Notecarrier, and Swan.
From there you’ll need to connect your flow meter to the Notecarrier. If you’re using this project’s recommended hardware, here’s a wiring diagram that shows how all the components connect.
Regardless of which hardware you use, you’ll need to have the following pin wired to your Notecarrier:
- The flow meter’s signal line must be be connected to the Notecarrier’s
F_D6
pin. The Swan uses this pin to read the flow rate from the flow meter.
When everything is put together your can then place your hardware inside the optional case like the one we recommended from Sixfab, and you should be good to go.
Your next step is getting the project’s firmware running on your device.
Firmware
The Flow Rate Monitor project has custom firmware that runs on the Swan. As a next step, complete the firmware’s setup guide to get your firmware up and running.
Web Application
The Flow Rate Monitor project’s web application allows you to view flow rates, set alarm thresholds, and manage environment variables in a browser.
As a final step, complete the web app’s setup guide to get the app running on your development machine.