Yf-s201 Proteus Library | WORKING ◉ |
The YF-S201 is one of the most popular water flow sensors among hobbyists and engineering students. It is commonly used in projects involving water measurement, automatic dispensers, and smart irrigation systems. However, when it comes to simulation in Proteus ISIS, many users hit a wall.
Unlike standard components like resistors or LEDs, the YF-S201 does not have a dedicated "drag-and-drop" model in the standard Proteus library. This article guides you through understanding the sensor, why it is difficult to simulate, and how to build a functional simulation model using workarounds.
Let us walk through a complete simulation project.
For this example, assume the signal pin of the YF-S201 is connected to Digital Pin 2 of your Arduino. yf-s201 proteus library
const int flowPin = 2; // Digital pin for the flow sensor
volatile int pulseCount = 0; // Counts the number of pulses
void setup()
pinMode(flowPin, INPUT);
attachInterrupt(digitalPinToInterrupt(flowPin), pulseCounter, RISING);
Serial.begin(9600);
void loop()
static unsigned long lastTime = 0;
static float flowRate = 0;
if (millis() - lastTime >= 1000)
lastTime = millis();
// The YF-S201 gives 450 pulses per liter
flowRate = (pulseCount / 450.0) * 60; // Calculate flow rate in liters per minute
pulseCount = 0; // Reset pulse count
Serial.print("Flow Rate: ");
Serial.print(flowRate);
Serial.println(" liters per minute");
void pulseCounter()
pulseCount++;
If you need accurate, continuous flow simulation, consider these alternatives to a pure Proteus library:
| File | Destination |
|------|-------------|
| YFS201.LIB | \LIBRARY\ |
| YFS201.IDX | \LIBRARY\ |
| YFS201.3D (optional) | \MODELS\ |
The YF-S201 Proteus library offers several features that make it an invaluable tool for developers: The YF-S201 is one of the most popular
Unlike standard ICs, sensor libraries are community-driven. You won't find the YF-S201 in the official Proteus library. Instead, you need to download it from trusted electronics forums and GitHub repositories.
Recommended sources (as of 2025):
File types you will get:
Warning: Avoid random file-sharing websites. While Proteus libraries are not highly malicious, always scan downloaded files with antivirus software.
Copy the downloaded YFS201.LIB and YFS201.IDX files into the LIBRARY folder.