Yfs201 | Proteus Library
yfs201 proteus library
Digital Magazine Software

Yfs201 | Proteus Library

To simulate the YF-S201 Water Flow Sensor in Proteus, you need to manually add the component library since it is not a native part of the standard Proteus installation. 1. Download and Install the YF-S201 Library

Since the YF-S201 outputs a pulse signal based on water flow, most Proteus libraries for it consist of two specific file types: .LIB and .IDX.

Download the Library: Search for a "YF-S201 Proteus Library" (often found on sites like Engineering Projects or GitHub) and download the .zip file.

Extract the Files: Unzip the folder to find the .LIB and .IDX files.

Move to Proteus Directory: Copy these files and paste them into the LIBRARY folder of your Proteus installation.

Common Path (Proteus 8.x): C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\Data\LIBRARY yfs201 proteus library

Note: If you cannot find the Data folder, it may be hidden in C:\ProgramData\Labcenter Electronics.

Restart Proteus: Close and reopen Proteus for the new component to appear in your library search. 2. Wiring the YF-S201 in Proteus

The sensor typically has three pins that you must connect to your microcontroller (e.g., Arduino): VCC: Connect to +5V. GND: Connect to the common Ground.

Pulse (Signal): Connect to a Digital Pin on your microcontroller. For Arduino, Pin 2 or 3 is recommended because they support External Interrupts, which are essential for counting flow pulses accurately. 3. Simulating Water Flow

Because Proteus cannot simulate physical water, the YF-S201 component in the software usually acts as a Pulse Generator. To simulate the YF-S201 Water Flow Sensor in

When you run the simulation, you may need to adjust the "flow rate" by clicking on the sensor and changing its frequency or pulse properties to mimic different water speeds.

If the component has a "test" pin, you might need to toggle a switch or logic state to generate the pulses. 4. Code Implementation (Arduino Example)

To read the sensor, use a simple interrupt-based script in your firmware:

volatile int pulseCount = 0; void pulseCounter() pulseCount++; void setup() Serial.begin(9600); // Trigger on falling edge of the signal attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); void loop() // Logic to convert pulseCount to Liters per Minute (L/min) Use code with caution. Copied to clipboard

If you encounter a "No library found" error, ensure you are running Proteus as an Administrator so it has the permissions to read the newly added files. How the Proteus Model Works: Unlike a simple

How to Add Arduino UNO Library to Proteus | Step-by-Step Guide


How the Proteus Model Works:

Unlike a simple switch, the YFS201 library contains a Property called Frequency or FlowRate. When you run the simulation, the OUT pin toggles at this frequency.


What You Need

To proceed, you will need to download a YFS201 Proteus Library. This usually comes in a ZIP file containing:

  1. Library Files: (YFS201.LIB or similar)
  2. Linker Files: (YFS201.IDX or similar)

Note: These files are created by the open-source community to bridge the gap between the hardware and simulation software.


Running the Simulation:

  1. Upload the Hex file to the Arduino in Proteus.
  2. Double-click the YFS201. Change FLOW_RATE to 15 (L/min).
  3. Run the simulation.
  4. Observe: The LCD should display Flow: 15.00 L/min.

If the LCD shows zero, your interrupt pin is not detecting the virtual pulses—check the YFS201 output connection.