Yfs201 Proteus Library !full! -
Hook up a digital signal generator directly to your microcontroller's reading pin, bypassing the sensor model entirely if you only wish to validate your mathematical frequency-to-flow conversion code. 6. Sample Arduino Integration Code
volatile int pulseCount; const int sensorPin = 2; // Pulse Output connected here float flowRate; unsigned int flowMilliLitres; unsigned long totalMilliLitres; void IRAM_ATTR pulseCounter() pulseCount++; void setup() Serial.begin(9600); pinMode(sensorPin, INPUT_PULLUP); pulseCount = 0; flowRate = 0.0; totalMilliLitres = 0; attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); void loop() // Calculate flow every second static unsigned long oldTime = 0; if ((millis() - oldTime) > 1000) detachInterrupt(digitalPinToInterrupt(sensorPin)); // YF-S201 formula: Frequency (Hz) / 7.5 = Flow Rate (L/min) flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / 7.5; oldTime = millis(); totalMilliLitres += (flowRate / 60) * 1000; Serial.print("Flow Rate: "); Serial.print(flowRate); Serial.print(" L/min"); Serial.print(" Total Volume: "); Serial.print(totalMilliLitres); Serial.println(" mL"); pulseCount = 0; attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); Use code with caution. Key Tips for Success
: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\Data\LIBRARY yfs201 proteus library
No dynamic change during simulation unless you script it with VSM Studio.
Always scan downloaded .DLL files with antivirus. Hook up a digital signal generator directly to
By mastering the YF-S201 library in Proteus, you can safely calibrate your flow formulas and test automated shut-off systems without ever getting your desk wet. adding an LCD display to this simulation to show the flow rate in real-time?
Once installed, you can build your simulation schematic. Open ISIS Schematic Capture and press on your keyboard to open the "Pick Devices" window. Search for "YF-S201" or "Flow Sensor". Component Pinout in Simulation Key Tips for Success : C:\Program Files (x86)\Labcenter
The YFS201 Proteus library can be used in various scenarios where a scalable and efficient file system is required, such as:
Because a software environment cannot physically pump water, the Proteus library uses an analog voltage input or an interactive state override to simulate changing water flow speeds. How to Simulate the Input Signal Connect a
Several GitHub repositories and electronics forums host YFS201 Proteus files. Here’s a reliable method: