The YF-S201 flow sensor shows up in tons of projects, water meters, irrigation controllers, beverage dispensers. It’s reliable, cheap, and well-documented. The problem isn’t the sensor itself. The problem is that every time you want to test your code, you’re suddenly in the business of moving water around. Which is fine if you’re building an actual system, but terrible when you just want to debug your pulse counting algorithm. That’s exactly why I built this model.
What This Thing Actually Does
The YF-S201 flow sensor is everywhere in DIY and industrial projects, water meters, irrigation systems, beverage dispensers, you name it. It’s a simple Hall effect sensor that spits out pulses proportional to flow rate. The datasheet says 450 pulses per liter, but good luck setting up a test rig that gives you precise flow rates for testing.
My model eliminates all that hassle. Drop it into your Proteus schematic, and you’ve got a flow sensor that behaves exactly like the real deal, minus the wet lab setup.
YF-S201 Flow Sensor Specifications
- Flow Range: 1-30 L/min
- Supply Voltage: 5 V
- Output Type: Digital pulse train
- The Output Pulse High Level: >4.7 VDC (DC input voltage 5 V)
- The Output Pulse Low Level: <0.5 VDC (DC input voltage 5 V)
- Output Pulse Duty Ratio: 50%
Color | Name | Description |
---|---|---|
Yellow | Signal | Pulse Signal |
Red | VCC | 5V |
Black | GND | GND |

Flow Sensor Overview
The model handles all the tricky timing stuff internally. Pulse accuracy is maintained even when you change flow rates mid-simulation, something that’s nearly impossible with physical setups.
Flow range is 1-30 L/min, matching the YF-S201 datasheet. Below 1 L/min, most real sensors get unreliable anyway, so I set that as the minimum.
The pulse output is a square wave with voltage levels roughly between 0V (LOW) and 5V (HIGH), compatible with TTL logic levels.

How to use Flow Sensor with Arduino
- Counts
OUT
pulses using an interrupt on pin 2. - Every second, calculates:
- Prints both pulse count and flow.
If your flow sensor ui value sets:
- 10 L/min →
75 Hz
→ ~75 pulses in 1s → Flow ≈10 L/min
- 30 L/min →
225 Hz
→ ~225 pulses in 1s → Flow ≈30 L/min
- Each pulse = 1/450 litre ≈ 2.22 mL
- Total volume (litres) =
TotalLitres = TotalPulseCount 450
Arduino Code:
Proteus Simulation

Download Library
Simply click on the button to download the library. You can refer to this post for instructions on how to install the library in Proteus 8.
Proteus 8: How to Download and install Library in Proteus (electronicstree.com)
For Proteus 9: Proteus Library Download and Installation | Easy Guide for Proteus 9
ZIP Password : electronicstree.com
We’re always looking to expand our library collection based on what our community needs. If you’re looking for a specific Arduino module, sensor, or component that we don’t currently offer, we’d love to hear from you!
Reach out to us at help@electronicstree.com with your requests. We prioritize new library development based on community demand, so your suggestion could be our next addition.
This model is designed to closely mimic the Gravity Water Flow Sensor from DFRobot, capturing how it behaves in real-world use. If you’ve been following this series, you might also want to check out the other models I’ve created, like the Ambient Light Sensor, Digital Shake Sensor, Water Pressure Sensor, and Liquid Level Sensor. Each one offers a hands-on way to understand how these popular DFRobot sensors work in practice.