Yfs201 Proteus Library Exclusive
Since the YFS201 outputs a simple digital square wave, a generic pulse generator can mimic its behavior.
Right-click the YFS201 and hit "Edit Properties" (or double-click). You will see unique fields:
This is where the "exclusive" factor shines. Because Proteus cannot simulate actual fluid mechanics visually, the model uses a mathematical abstraction.
The availability of an exclusive YFS201 library is more than just a convenience; it represents a shift in Hardware-in-the-Loop (HIL) simulation capabilities. yfs201 proteus library exclusive
| Feature | Generic Pulse Source | Manual Arduino Code | YFS201 Proteus Library Exclusive | | :--- | :--- | :--- | :--- | | Physical Pinout Accuracy | ❌ No VCC/GND | ❌ N/A | ✅ True 3-pin component | | Dynamic Flow Adjustment | ✅ Yes (via knob) | ❌ Requires recompile | ✅ In-simulation property edit | | Interrupt Latency Testing | ❌ No | ❌ No | ✅ Models Hall effect delay | | Ready-to-Drop Schematic | ❌ Must build from discrete parts | ❌ Not a component | ✅ Yes | | Cost | Free | Free | Exclusive (Free + Features) |
If you want, I can:
However, here's what you can do to simulate it in Proteus: Since the YFS201 outputs a simple digital square
#include <LiquidCrystal.h> LiquidCrystal lcd(7,8,9,10,11,12);volatile int pulseCount = 0; float flowRate = 0.0; unsigned long oldTime = 0;
void pulseCounter() pulseCount++;
void setup() pinMode(2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, RISING); lcd.begin(16,2); oldTime = millis(); Right-click the YFS201 and hit "Edit Properties" (or
void loop() if(millis() - oldTime > 1000) //every 1 second detachInterrupt(0); flowRate = (pulseCount / 7.5); // Liters per minute lcd.setCursor(0,0); lcd.print("Flow: "); lcd.print(flowRate); lcd.print(" L/min "); pulseCount = 0; oldTime = millis(); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, RISING);
Run the simulation in Proteus. As you change the Flow_Rate_Lpm property from 0 to 25, the LCD will instantly update. This exclusive library allows you to test edge cases (e.g., what happens if flow suddenly stops?) without wetting a single component.
Solution: The library didn't install correctly. Ensure the .IDX file is in the same folder as .LIB. Reboot Windows if necessary (Proteus caches the library index).
