Arduino library for UFM01 ultrasonic flow sensing module through one-wire and UART from ScioSense.
The UFM-01 is a complete unit including the sensor electronics, spool piece, connectors with standard ½” thread, and a cable connector supporting single-wire and UART interfaces.
- Further information about the UFM01
- Datasheet
- Buy the UFM01 on Mouser or Digikey
- Buy the UFM01 evaluation kit on Mouser
It is assumed that
- The Arduino IDE has been installed. If not, refer to "Install the Arduino Desktop IDE" on the Arduino site.
- The library directory is at its default location. Normally this is
C:\Users\[your_username]\Documents\Arduino\libraries
.
- In the Arduino IDE, navigate to the Arduino Library Manager on the left side (or, alternatively, select Sketch > Include Library > Manage Libraries...)
- Search for
ScioSense_UFM01
- Select the library from the search results and press
Install
- Download the code from this repository via "Download ZIP".
- In Arduino IDE, select Sketch > Include Library > Add .ZIP library... and browse to the just downloaded ZIP file.
- When the IDE is ready this README.md should be located at
C:\Users\[your_username]\Documents\Arduino\libraries\ScioSense_UFM01\README.md
.
Please make sure that you use the correct supply voltage: The UFM-01 runs at VDD = 5V.
This example shows how to wire an ESP32 with a UFM-01 to communicate through UART. For other platforms a hardware UART port has to be used. The SoftwareSerial library does not support Even data parity and therefore cannot be used with the UFM-01.
UFM-01 | ESP32 |
---|---|
One-Wire | - |
VCC | 5V |
GND | GND |
UART_RX | 17 |
UART_TX | 16 |
This example shows how to wire an ESP32 with a UFM-01 to communicate through One Wire. A pull-up of 4.7kΩ must be connected to 3.3V for the ESP32, for other platforms it must be connected to the supply voltage of the micro-controller. The library works with Paul Stoffregen's OneWire library (v>=2.3.8), which is installed automatically if the UFM-01 library was downloaded through the Arduino IDE.
UFM-01 | ESP32 |
---|---|
One-Wire | 4 |
VCC | 5V |
GND | GND |
UART_RX | - |
UART_TX | - |
To build an example sketch
- (Re)start Arduino.
- Open File > Examples > Examples from Custom Libraries > ScioSense_UFM01 > 01_Basic (or any other of the provided examples you wish to run)
- Make sure Tools > Board lists the correct board.
- Select Sketch > Verify/Compile.
Contributions in the form of issue opening or creating pull requests are very welcome!