Yfs201 Proteus Library May 2026

In the rapidly evolving world of embedded systems and IoT (Internet of Things), flow measurement is a critical parameter. Whether you are building a smart water meter, a fuel dispensing system, or an industrial liquid monitoring setup, the YFS201 Hall Effect Flow Sensor is a popular, cost-effective choice.

However, before soldering a single component or writing a line of code for a physical microcontroller (like an Arduino or PIC), smart engineers simulate. This is where the YFS201 Proteus Library becomes indispensable.

Proteus Design Suite by Labcenter Electronics is the industry standard for PCB design and virtual simulation. Unfortunately, out-of-the-box, Proteus does not include a native YFS201 component. This article serves as a complete resource for finding, installing, and effectively using the YFS201 library in Proteus.


If you have downloaded the library files, follow these steps to integrate them into your Proteus software.


Before we dive into the simulation, let’s briefly understand the hardware.

The YFS201 is a Hall Effect water flow sensor. It consists of a plastic valve body, a water rotor, and a Hall Effect sensor. When water flows through the valve, it rotates the rotor. The speed of rotation is proportional to the flow rate. yfs201 proteus library

How it works: The rotation of the rotor interrupts an internal magnetic field, causing the Hall Effect sensor to output a series of pulses. By counting these pulses, a microcontroller (like an Arduino) can calculate the volume of water that has passed through.


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);

// 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. In the rapidly evolving world of embedded systems


Real sensor fails below 1 L/min. Most libraries do not model this. Add a threshold in firmware.

In the library, typically 0–50 L/min, though real sensor max is 30 L/min.

Yes. Most libraries work with Proteus 8.6 and above.

The YFS201’s real-world accuracy is ±3% to ±5%. In simulation, it’s perfect. For practical use, calibrate:

Calibration Factor = Actual Volume / Measured Volume If you have downloaded the library files, follow

Modify code:

const float calibrationFactor = 0.96; 
flowRate = (freq / 7.5) * calibrationFactor;

Simulation can’t replace this step, but it gives you a working baseline.