Yfs201 Proteus Library Today

Simulating Water Flow: The Ultimate Guide to the YFS201 Proteus Library

Water flow measurement is a critical component in many electronics projects, from smart irrigation systems to industrial liquid monitoring. Among the most popular sensors for hobbyists and engineers is the YFS201 Water Flow Sensor. It’s cheap, reliable, and easy to interface with Arduino.

However, if you have tried to simulate this sensor in Proteus ISIS, you may have hit a wall. There is no default "YFS201" component in the standard library.

In this guide, we will explain exactly how to find, install, and use a YFS201 Proteus library to get your fluid dynamics simulations running perfectly—without needing physical hardware immediately.


Option A: Pulse Generator + Custom Formula

Place a Pulse Generator (in Proteus → Generators → DCLOCK or PULSE) and connect to the microcontroller pin. Manually set frequency = desired flow rate × 7.5. yfs201 proteus library

Drawback: No dynamic change during simulation unless you script it with VSM Studio.

Q2: Can I simulate multiple YFS201 sensors?

Yes. Add multiple instances; rename signal pins to avoid interrupt conflicts in code.

Part 6: Arduino Code for Flow Measurement

Upload this code to the Arduino in Proteus (using the virtual HEX file). Simulating Water Flow: The Ultimate Guide to the

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

volatile int pulseCount = 0; float flowRate = 0.0; float totalLiters = 0.0; unsigned long oldTime = 0;

void pulseCounter() pulseCount++;

void setup() pinMode(2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, RISING); lcd.begin(16, 2); lcd.print("Flow Meter Ready"); delay(2000); lcd.clear(); oldTime = millis();

void loop() if (millis() - oldTime >= 1000) detachInterrupt(0);

// Frequency = pulses per second
float freq = pulseCount;
flowRate = freq / 7.5;   // L/min
totalLiters += flowRate / 60.0;  // liters added this second
lcd.setCursor(0, 0);
lcd.print("Flow: ");
lcd.print(flowRate);
lcd.print(" L/min ");
lcd.setCursor(0, 1);
lcd.print("Total: ");
lcd.print(totalLiters);
lcd.print(" L   ");
pulseCount = 0;
attachInterrupt(digitalPinToInterrupt(2), pulseCounter, RISING);
oldTime = millis();

In Proteus, you will need to compile this code into a HEX file (using Arduino IDE) and load it into the Arduino model.