Yf-s201 Proteus Library |verified|

by Ary Cahyo Nugroho

Cover

Yf-s201 Proteus Library |verified|

pulseCount = 0; lastTime = now; attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING);

Verify that your pulse signal line is connected to Arduino Pin 2 ( INT0 ). If it is connected to an incorrect pin, the interrupt routine will never fire. Also, check that the test potentiometer wiper is feeding the correct analog control pin on the sensor model. yf-s201 proteus library

| Parameter | Value | | :--- | :--- | | | 4.5 V – 24 V DC (typically 5 V) | | Max. Working Current | 15 mA (at DC 5 V) | | Flow Rate Range | 1 – 30 L/min | | Output Type | Digital square wave (TTL pulse train) | | Output Pulse "High" Level | >4.7 VDC (at 5 V input) | | Output Pulse "Low" Level | <0.5 VDC (at 5 V input) | | Output Pulse Duty Ratio | 50% | | Water Pressure Limit | ≤ 1.75 MPa | | Operating Temperature | ≤ 80°C | | Liquid Temperature | ≤ 120°C | | Connection Thread | G1/2" (External) | | Pinout | Red: VCC, Black: GND, Yellow: Signal Output | | Parameter | Value | | :--- | :--- | | | 4

Load this optimized firmware into your Proteus Arduino model to calculate and display real-time water flow statistics. Serial.print(" L/min\t\tTotal: ")

Serial.print("Flow Rate: "); Serial.print(flowRate); Serial.print(" L/min\t\tTotal: "); Serial.print(totalLiters); Serial.println(" L");