Yfs201 Proteus Library Exclusive [ High Speed ]
const int sensorPin = 2; volatile long 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(sensorPin, INPUT_PULLUP); // Interrupt 0 is tied to digital pin 2 attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); void loop() if((millis() - oldTime) > 1000) Total: "); Serial.print(totalMilliLitres); Serial.println(" mL"); pulseCount = 0; attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); Use code with caution. Troubleshooting Simulation Errors
: It allows you to test code logic for measuring flow rate and volume without needing physical plumbing or hardware.
To use the YF-S201 in your simulation, you need both the files for the component model and the .HEX file for its internal logic. yfs201 proteus library exclusive
Close and reopen Proteus ISIS.
Download the library package and extract it using software like WinRAR or 7-Zip. You will typically find the schematic library ( .LIB ), Proteus component layout ( .IDX ), and sometimes a model file ( .MDF or .DLL ). 2. Copy to the Library Folder const int sensorPin = 2; volatile long pulseCount
: They offer a wide range of custom Proteus Sensor Libraries .
: When water flows through the rotor, it spins the magnetic rotor. The Hall Effect sensor detects the magnetic field changes and outputs a series of digital pulses. Close and reopen Proteus ISIS
Search for (or the specific keyword designated by your downloaded library) and add it to your workspace. Search for and add an Arduino Uno board model.
This article explores the , a game-changer for engineers looking to validate their designs without getting their hands wet.
If your total volume calculation is drifting, you can see exactly where the code or hardware interrupts are failing without hardware interfering.
Do you need the to convert pulses to Liters/Minute?