Yf-s201 Proteus Library -

Simulating the YF-S201 Water Flow Sensor in Proteus: A Practical Guide

The YF-S201 is one of the most popular water flow sensors among hobbyists and engineering students. It is commonly used in projects involving water measurement, automatic dispensers, and smart irrigation systems. However, when it comes to simulation in Proteus ISIS, many users hit a wall.

  • FREQUENCY = 45 (default 10 L/min)
  • VOLTAGE = 5
// Total volume totalLiters += flowRate / 60.0;
  • INITIAL = 0
  • PULSE = 5 (Volts)
  • TW (Pulse Width) = 500ms for 1 Hz, but for flow: TW = 1 / (4.5 * L_min) / 2
  • PER (Period) = 1 / (4.5 * L_min)