" or "Flow Sensor" in the component picker to place it on your schematic Simulation Interfacing
To verify your sensor is working in the simulation, use this snippet:
Technical checklist (what I checked / recommend you verify)
Once your circuit is ready, use a library like FlowSensor-Arduino to handle the interrupts and calculations automatically. Key Specs for your Code: Operating Voltage: 5V to 18V DC. Output: 5V TTL Pulse. Flow Rate: 1–30 L/min. yfs201 proteus library exclusive
is a staple in the DIY and industrial automation world for measuring liquid volume and flow rate. While Proteus is a powerhouse for electronic simulation, it does not natively include a dedicated model for this specific sensor. To bridge this gap, developers have created "exclusive" libraries that allow you to simulate water flow projects without a physical lab setup. What is the YF-S201 Flow Sensor?
Before diving into simulation, it is essential to understand the hardware you are modeling. The YF-S201 is a compact, highly reliable . It is placed in line with your water line and contains a pinwheel/rotor with integrated magnets.
void loop() if (millis() - oldTime > 1000) // Every second detachInterrupt(digitalPinToInterrupt(2)); " or "Flow Sensor" in the component picker
Right-click your Arduino microcontroller, select Edit Properties , and ensure the clock frequency matches your code (typically 16MHz). Avoid setting the flow rate in the sensor model to its maximum value (30 L/min = 225Hz) immediately upon starting the simulation.
Unlike generic models, the YFS201 Proteus Library Exclusive exposes advanced properties:
These hold the component's schematic symbol, pin definitions, and electrical properties. When you search for "YFS201" in Proteus, the .LIB file tells the software how to draw the sensor and where its VCC, GND, and OUT pins are located. Flow Rate: 1–30 L/min
Follow these steps to add the custom library files to your Proteus environment:
Simulating fluid dynamics alongside digital logic has historically been a bottleneck for embedded system developers. While microcontrollers like the Arduino UNO are natively supported inside , specialized hardware—such as the YF-S201 Hall Effect Water Flow Sensor —lacks a native simulation model.
When fluid flows through the valve, it forces the internal turbine wheel to spin. The integrated magnet moves past the Hall Effect integrated circuit with each rotation, generating a distinct high/low square-wave output pulse.
: Double-click the YF-S201 component. In the Program File field, browse and select the .hex file that came with the sensor library (this is essential for the sensor to "work" in simulation).