Yfs201 Proteus Library Exclusive ((exclusive)) File
volatile int pulseCount = 0; void pulseCounter() pulseCount++; void setup() Serial.begin(9600); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, RISING); void loop() delay(1000); // Check flow every second Serial.print("Pulses: "); Serial.println(pulseCount); pulseCount = 0; Use code with caution. Copied to clipboard How to Make a Custom Component in Proteus
Close and reopen Proteus ISIS.
: Connect this to an external interrupt pin on your microcontroller (e.g., Pin 2 on an Arduino Uno). yfs201 proteus library exclusive
Perfect for designing prototypes before purchasing components.
The Proteus Design Suite (Standard and Professional editions) does not include a pre-installed model named "YFS201" in its default library. While Proteus contains generic "Water Level" or "Flow" sensors, they often lack the specific pulse-per-liter characteristics of the YFS201. Double-click the YFS201 symbol in Proteus
Double-click the YFS201 symbol in Proteus. You will see exclusive properties:
volatile int pulseCount = 0; float flowRate = 0.0; unsigned int flowMilliLitres = 0; unsigned long totalMilliLitres = 0; unsigned long oldTime = 0; void pulseCounter() pulseCount++; void setup() Serial.begin(9600); pinMode(2, INPUT); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); void loop() if ((millis() - oldTime) > 1000) detachInterrupt(digitalPinToInterrupt(2)); flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / 7.5; oldTime = millis(); pulseCount = 0; Serial.print("Flow rate: "); Serial.print(flowRate); Serial.println(" L/min"); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); Use code with caution. 3. Simulation float flowRate = 0.0
Show you with interactive water tanks.
You might find generic pulse sources online. The term in this context refers to three critical differentiators:
Run the simulation in Proteus. As you change the Flow_Rate_Lpm property from 0 to 25, the LCD will instantly update. This allows you to test edge cases (e.g., what happens if flow suddenly stops?) without wetting a single component.