Yfs201 Proteus Library Official

Instead of a dedicated YFS201 model, simulate its output using a signal generator:

Proteus allows custom DLLs (VSM models) in C++. Advanced users can model YFS201 behavior with parameters like min flow, max frequency, and duty cycle.


| Component | Proteus Part Name | |-----------|-------------------| | YFS201 sensor | YFS201 (after install) | | Arduino Uno | ARDUINO UNO R3 | | 16x2 LCD | LM044L | | Resistor (10kΩ) | RES | | Potentiometer (for contrast) | POT-HG |

You can create your own:

In the world of embedded systems and IoT-based flow measurement, the YFS201 water flow sensor has emerged as a popular choice for hobbyists and professionals alike. Known for its affordability, ease of use, and decent accuracy, the YFS201 is frequently paired with Arduino, ESP8266, and STM32 microcontrollers. However, before committing to hardware, every smart developer knows the value of simulation. yfs201 proteus library

This is where the YFS201 Proteus Library comes into play. Proteus, developed by Labcenter Electronics, is one of the most powerful electronic design automation (EDA) tools, offering schematic capture, PCB layout, and—most importantly—microcontroller simulation.

But there’s a catch: Proteus does not include the YFS201 sensor in its default library. This article provides a complete walkthrough on sourcing, installing, and using a custom YFS201 library for Proteus. You will learn why simulation matters, how to model flow sensors, and how to write firmware that reads flow rate and total volume—all without a physical prototype.


Upload this code to the Arduino in Proteus (using the virtual HEX file).

#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); Instead of a dedicated YFS201 model, simulate its

// 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.