If you managed to build a working simulation, share your .pdsprj file in the comments! For more Proteus tips, check my profile.
: Copy these files into the Proteus Library folder.
Search for DCLOCK or SIGNAL GENERATOR in Proteus.
The standard conversion formula provided by the manufacturer is: yf-s201 proteus library
void setup() Serial.begin(9600); pinMode(2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, RISING); oldTime = millis();
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_PULLUP); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); oldTime = millis(); void loop() if ((millis() - oldTime) > 1000) // Calculate every 1 second detachInterrupt(digitalPinToInterrupt(2)); // YF-S201 formula: Flow Rate (L/min) = Frequency / 7.5 flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / 7.5; oldTime = millis(); // Calculate total volume flowMilliLitres = (flowRate / 60) * 1000; totalMilliLitres += flowMilliLitres; Serial.print("Flow Rate: "); Serial.print(flowRate); Serial.print(" L/min"); Serial.print("\tTotal: "); Serial.print(totalMilliLitres); Serial.println(" mL"); pulseCount = 0; attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); Use code with caution. 6. How to Run the Simulation
A typical flow meter system involves reading the sensor's pulse output with a microcontroller. In Proteus, you can connect: If you managed to build a working simulation, share your
// YF-S201 Formula: Flow (L/min) = Frequency / 7.5 flowRate = frequency / 7.5;
: Place an Arduino Uno block into your workspace. Sensor : Place the YF-S201 component. Connections : Connect the VCC pin of the sensor to a +5V Power Rail. Connect the GND pin of the sensor to the Ground Rail.
The YF-S201 consists of a plastic valve body, a water rotor, and a Hall Effect sensor Search for DCLOCK or SIGNAL GENERATOR in Proteus
Before simulating, it is critical to understand how the hardware operates so you can model its behavior accurately in Proteus. Operating Principle
Ensure connections are correct before applying real power and water. 3. How to Install the YF-S201 Proteus Library
Do you need assistance for the library files? Share public link
The YF-S201 is a highly popular, low-cost water flow sensor used extensively in DIY electronics, smart agriculture, and industrial prototyping. However, because the official Proteus Design Suite library does not include this sensor by default, simulation requires a dedicated third-party library or an accurate workaround.