Location of Flow Sensors in Schematic | Location of Sensirion Flow Sensor in Schematic |
---|---|
![]() |
![]() |
%%HTML
<video width="800" height="600" controls>
<source src="img/video_2024-07-26_07-01-26.mp4" type="video/mp4">
</video>
Labeled Image of Sensor with Pins Labeled | Pinout Diagram in Datasheet |
---|---|
![]() |
![]() |
Connect the Arduino to the Sensor | A4 is for SDA and A5 is for SCL |
---|---|
![]() |
![]() |
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/uNjWOinYsms?si=XAR_2zqnOr8F-Ozr" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/HiPDJiEU-a0?si=lQvxD__1ARV8tmb3" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/Zoi-bUeLWCg?si=Zvi9YNC_1nitU7VC" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
import serial
import time
arduinoSensirionFlowMeterCOM="COM7"
arduino_Bead_Flow_meter = serial.Serial(arduinoSensirionFlowMeterCOM, timeout=1, write_timeout=1)
time.sleep(5.0)
print(arduino_Bead_Flow_meter.name)
print(arduino_Bead_Flow_meter.get_settings())
print(arduino_Bead_Flow_meter.is_open)
COM7 {'baudrate': 9600, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 1, 'write_timeout': 1, 'inter_byte_timeout': None} True
def get_bead_channel_flowrate():
#Empty the buffer if its more than 11 bytes so new values can be brought in during sampling.
#The arduino has been programmed to send a maximum of 10 bytes of data in a line.
if arduino_Bead_Flow_meter.inWaiting()>11:
buffer=arduino_Bead_Flow_meter.read(arduino_Bead_Flow_meter.inWaiting())
while True:
try:
beadChannelFlow=float((arduino_Bead_Flow_meter.readline()).decode("utf-8"))
break
except ValueError:
pass
return beadChannelFlow
get_bead_channel_flowrate()
1.97
arduino_Bead_Flow_meter.close()