Brussels / 3 & 4 February 2018

schedule

Yf-s201 - Proteus Library __link__

YF-S201 Water Flow Sensor

The library for Proteus allows you to simulate water flow measurement and volume calculation in a virtual environment, typically interfaced with an Arduino or other microcontrollers. Since Proteus does not include this sensor in its default library, you must manually download and add external library files (usually .LIB and .IDX ) to your installation. 1. Key Library Features

Recommendation:

Good for testing code logic and timer interrupts. Do not rely on it for precise flow behavior – use the real sensor for hardware validation. yf-s201 proteus library

Cause:

Wrong folder (e.g., using USERLIB instead of LIBRARY ) or Proteus version mismatch. Fix: Ensure you placed files in DATA\LIBRARY , not DATA\USERLIB . For Proteus 9+, use ProgramData path. Restart Proteus as admin. YF-S201 Water Flow Sensor The library for Proteus

if (millis() - lastTime >= 1000) lastTime = millis(); // The YF-S201 gives 450 pulses per liter flowRate = (pulseCount / 450.0) * 60; // Calculate flow rate in liters per minute pulseCount = 0; // Reset pulse count Connect the output of the pulse generator to

Serial.print("Flow Rate: "); Serial.print(flowRate); Serial.print(" L/min\t\tTotal: "); Serial.print(totalLiters); Serial.println(" L");

  • Connect the output of the pulse generator to a digital input pin of your microcontroller (e.g., Arduino pin 2 for interrupt).
  • Write firmware to measure frequency or count pulses.