Mastering Liquid Automation: The Exclusive YF-S201 Proteus Library Integration Guide
volatile int pulseCount = 0; float flowRate = 0.0; unsigned int flowMilliLitres = 0; unsigned long totalMilliLitres = 0; unsigned long oldTime = 0; void pulseCounter() pulseCount++; void setup() Serial.begin(9600); pinMode(2, INPUT); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); void loop() if ((millis() - oldTime) > 1000) detachInterrupt(digitalPinToInterrupt(2)); flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / 7.5; oldTime = millis(); pulseCount = 0; Serial.print("Flow rate: "); Serial.print(flowRate); Serial.println(" L/min"); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); Use code with caution. 3. Simulation
Connect a 10k resistor between Arduino Pin 2 and a +5V Power Rail. This replicates the open-collector output behavior of the physical Hall-effect sensor. yfs201 proteus library exclusive
Generally works with 5V to 24V DC, allowing for easy integration with Arduino, ESP32, or PIC microcontrollers. With a typical pulse frequency of approximately
Exclusive Guide: Using the YF-S201 Water Flow Sensor in Proteus The Go to product viewer dialog for this item. This replicates the open-collector output behavior of the
Download the (often provided in a zip file).
Ensure your code initializes the pin mode as INPUT_PULLUP . If your custom library mimics an open-collector layout, place an external 4.7kΩ resistor connecting the pulse line to the +5V rail within your Proteus workspace. Download the (often provided in a zip file)
(where f is frequency in Hz and Q is flow in L/min), directly in the simulation. This ensures your interrupt-based pulse counting code works before uploading it to a physical board. How to Install the Exclusive YFS201 Library To use this component in your projects, follow these steps:
Open Proteus, and search for "YFS201" in the component picker. Example Project: Arduino Water Meter
in Proteus, you typically need to download a custom library file (often provided by community sites like The Engineering Projects Download & Extract : Download the library package which usually contains , and sometimes Paste Files : Copy these files into the folder of your Proteus installation directory (e.g.,