The speed of the rotor changes with different rates of flow. The Hall-effect sensor outputs a corresponding high/low digital pulse signal (square wave). Pin Configuration: The sensor uses three simple wires: Red (VCC): 5V to 24V DC power supply. Black (GND): Ground connection. Yellow (Pulse/Data): PWM pulse output signal. Key Features of an Exclusive Proteus Library

is a staple in the DIY and industrial automation world for measuring liquid volume and flow rate. While Proteus is a powerhouse for electronic simulation, it does not natively include a dedicated model for this specific sensor. To bridge this gap, developers have created "exclusive" libraries that allow you to simulate water flow projects without a physical lab setup. What is the YF-S201 Flow Sensor?

Whether you are a student working on a school project, a hobbyist building a smart irrigation system, or a professional developing an industrial flow meter, integrating this library into your Proteus workflow is a smart, efficient, and reliable approach to electronics design.

Published: October 2023 | Updated for Latest Proteus 8/9 Versions

: You will typically get a .zip or .rar file containing .LIB , .IDX , and sometimes a .HEX file.

What do you want to track? (e.g., total volume data logging , relays for valves , etc.)

const int sensorPin = 2; volatile long pulseCount = 0; float flowRate = 0.0; unsigned int flowMilliLitres = 0; unsigned long totalMilliLitres = 0; unsigned long oldTime = 0; void pulseCounter() pulseCount++; void setup() Serial.begin(9600); pinMode(sensorPin, INPUT_PULLUP); // Interrupt 0 is tied to digital pin 2 attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); void loop() if((millis() - oldTime) > 1000) detachInterrupt(digitalPinToInterrupt(sensorPin)); // YF-S201 conversion formula: Pulse frequency (Hz) = 7.5Q, where Q is flow rate in L/min flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / 7.5; oldTime = millis(); flowMilliLitres = (flowRate / 60) * 1000; totalMilliLitres += flowMilliLitres; Serial.print("Flow rate: "); Serial.print(flowRate); Serial.print(" L/min Use code with caution. Troubleshooting Simulation Errors

The exclusive library uses a "Pull-up" configuration. Add a 10k resistor from OUT to VCC in your schematic. The model expects an open-collector output.