If you are using the Pulse Generator workaround to simulate the YF-S201, you must configure its properties to match realistic water flows. Double-click the generator device on your schematic.
Observe the LCD screen. It will dynamically calculate and display the water flow rate and the cumulative liquid volume based on the incoming frequency pulse stream. Troubleshooting Simulation Errors
Open the Component Mode (P) in Proteus and search for and select the following: (or your preferred microcontroller) YF-S201 Flow Sensor (now visible via your new library) LM016L (Standard 16x2 HD44780 LCD display)
Search online for trustworthy electronics simulation blogs or repositories using the term "YF-S201 Proteus Library Zip" . Download the compressed library archive. yf-s201 proteus library
Simulating the YF-S201 Water Flow Sensor in Proteus: A Comprehensive Guide
is a Hall Effect water flow sensor often used in Arduino projects to measure liquid flow. While Proteus does not always include it by default, you can add it via third-party libraries. Here is the "story" of how this sensor works and how it comes to life in a simulation. The Mechanics: How the YF-S201 Works
Serial.print("Flow rate: "); Serial.print(flowRate); Serial.print(" L/min\tOutput Frequency: "); Serial.print(pulseCount); Serial.println(" Hz"); If you are using the Pulse Generator workaround
volatile int pulseCount = 0; float flowRate = 0.0; float totalLiters = 0.0; unsigned long lastTime = 0;
Provide the for different flow sensor models.
Simulating the YF-S201 is crucial for validating software logic before hardware assembly. A Proteus model allows you to: It will dynamically calculate and display the water
, the LCD screen will dynamically output a constant fluid reading of 4.0 L/min . The Total volume row should consistently tick upward every second. Troubleshooting Common Simulation Errors
: As water flows through the valve, it spins the internal rotor.
Connect the of the sensor to Digital Pin 2 of the Arduino (this pin supports external interrupts on the ATmega328P).
void loop() unsigned long now = millis(); if (now - lastTime >= 1000) // Every second detachInterrupt(digitalPinToInterrupt(2));
C:\Program Data\Labcenter Electronics\Proteus 8 Professional\Data\LIBRARY
