B4R Question How to use YF-S302 flowmeter

peacemaker

Expert
Licensed User
Longtime User
If any new hardware:
  1. Google something like "Arduino YF-S302 flowmeter"
  2. Study the hardware - how works, basing on what principle, what chipset is used - find the PDF datasheet of the chipset.
  3. There are only 3 data receiving ways only, basing on the principles:
    1. Analog single signal is to be measured by ADC
    2. Digital PWM signal - here the time measurement is needed (pulse width)
    3. And digital data exchange over some standard protocol: I2C, SPI, .... or just UART...
  4. And here you need to find some Arduino library that can work with your sensor.


    And next - study the library codes and inline-C for usage in B4R.
    Or write B4R code for reading from ADC in the simpler way.
    Or B4R code can be written according to the digital chipset datasheet directly.
    But fastest way - is to use some ready and documented Arduino lib with help of Inline-C.
If no ready code for your hardware - it seems, no one can help you to make a lib (for free maybe). Just you.
 
Last edited:
Upvote 0
Top