The article will cover:
If you are using Proteus 9, be aware that a known license issue can prevent DLL-based library models from functioning. Libraries that rely on LIB and MODEL files might work, but those that depend on .DLL files will fail. The community is actively working on a solution, but no official fix is available yet.
or a logic toggle to the sensor's Test Pin. By varying the voltage/logic on this pin, you simulate different flow rates. Configuration
Some premium or custom interactive libraries bundle an underlying operational firmware hex file that simulates the sensor's pulse behavior when adjusting manual controls. 4211421036/YF-S201 Water Flow - PlatformIO Registry yfs201 proteus library exclusive
Simulating fluid dynamics and sensor telemetry in Proteus requires accurate peripheral models. The YF-S201 water flow sensor is a staple in automation, smart agriculture, and liquid dosing projects.
Proteus, while extensive, does not include every electronic component in its default library. This is often due to several factors:
During the simulation run, you can pause the simulation, edit the "Flow Rate" property of the YFS201 model to "10 L/min", resume, and instantly see the Serial Monitor update to reflect that flow. The article will cover: If you are using
However, here's what you can do to simulate it in Proteus:
Integrating the exclusive YFS201 library into Proteus offers several massive advantages before you purchase and assemble physical hardware:
// YF-S201 Flow Sensor Simulation Firmware // Target Platform: Arduino Uno / Nano const int SENSOR_PIN = 2; // Connected to OUT pin of YF-S201 volatile unsigned long pulseCount = 0; float flowRate = 0.0; unsigned int flowMilliLitres = 0; unsigned long totalMilliLitres = 0; unsigned long oldTime = 0; // Calibration factor based on datasheet: F = 7.5 * Q const float CALIBRATION_FACTOR = 7.5; void IRAM_ATTR pulseCounter() pulseCount++; void setup() Serial.begin(9600); pinMode(SENSOR_PIN, INPUT_PULLUP); // Trigger interrupt on the falling edge of the pulse attachInterrupt(digitalPinToInterrupt(SENSOR_PIN), pulseCounter, FALLING); oldTime = millis(); void loop() // Execute calculations exactly once every second if ((millis() - oldTime) > 1000) // Detach interrupt while processing calculations to ensure data integrity detachInterrupt(digitalPinToInterrupt(SENSOR_PIN)); // Calculate flow rate in Liters per minute flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / CALIBRATION_FACTOR; oldTime = millis(); // Determine volume passed during this specific window flowMilliLitres = (flowRate / 60.0) * 1000.0; // Add to overall cumulative total totalMilliLitres += flowMilliLitres; // Print real-time diagnostics to the Proteus Virtual Terminal Serial.print("Flow rate: "); Serial.print(flowRate, 2); Serial.print(" L/min"); Serial.print("\t Total Liquid Quantity: "); Serial.print(totalMilliLitres); Serial.println(" mL"); // Reset the tracking counter and reattach the interrupt pulseCount = 0; attachInterrupt(digitalPinToInterrupt(SENSOR_PIN), pulseCounter, FALLING); Use code with caution. Step-by-Step Simulation Execution or a logic toggle to the sensor's Test Pin
Flow Rate (Q)=Pulse Frequency in Hz7.5Flow Rate open paren cap Q close paren equals the fraction with numerator Pulse Frequency in Hz and denominator 7.5 end-fraction Key Features of the Exclusive Proteus Library
Integrating the exclusive library files into your Proteus environment takes only a few minutes. Step 1: Download and Extract