Tutorial: Arduino Interface for Multiple SF06 Liquid Flow Sensors
This quick start guide is aimed at customers who have worked with our Liquid Flow Meter Kits and are evaluating Sensirion liquid flow sensors in a prototyping scenario. This guide describes how to set up and connect multiple SLF3x sensors to an Arduino UNO via the Adafruit TCA9548A breakout board and how to run a first simple measurement using sample code.
What you have to do
Setting up your Arduino (UNO)
Please note that these steps are simply a suggestion. Sensirion AG is not responsible for any technical issues arising from the Arduino board, setting it up and all electrical connections.
- Download the Arduino Software here: https://www.arduino.cc/en/Main/Software
- Follow Arduino’s Getting Started Guide (https://www.arduino.cc/en/Guide/HomePage)
- For Arduino UNO: We have successfully tested our sample code with the Arduino UNO board and therefore recommend using it (Arduino UNO Getting Started Guide (https://www.arduino.cc/en/Guide/ArduinoUno)).
If you have successfully connected and tested your Arduino board, you are ready to continue to the next part.
Connecting your sensor
Wiring diagram with two SLF3x sensors
Connect your liquid flow sensors to the Arduino board as described in figure above. Using screw headers may help make reliable and easy to use connections (for example: 277-1275-ND from www.digikey.com) In case you want to design and use your own cable, please follow the pin descriptions shown below precisely. Using the wrong voltage or applying voltages to the wrong pins can damage the sensor. Sensirion AG is not responsible for any damages incurred this way.
|Pin Label||6 pin Molex Pin-no. |
|SCL||5||A5 or SCL|
|SDA||2||A4 or SDA|
Running your first measurement
Once you have successfully tested your Arduino and have connected your sensors correctly, you can start your first measurement. Double-click ‘example_20_simple_measurement_multiple_SLF3x.ino’ of Example 20 of Sensirion AG’s sample Arduino code. This will launch the Arduino software suite and open the sample code. Simply upload the code to your Arduino board and wait for the process to finish. The measurement will begin automatically. In order to see the results, start the serial monitor from within the Arduino software suite (see arrow in the figure below).
After opening the serial monitor, a window will open that displays the sensor reading of all detected sensor. Klick the reset bottom on the Arduino to restart it. The example program will scan all 8 ports of the multiplexer and start the measurement on all detected sensors.
All code examples are commented for ease of understanding. Feel free to use and edit the code as you please. Remember to save a new copy before you start editing, to avoid overwriting the original sample code.