| Error | Cause | Fix | | :--- | :--- | :--- | | | You didn't attach a source to the SIG pin | Connect a DCLOCK or VPULSE | | Arduino reads zero | Missing pull-up resistor | Enable INPUT_PULLUP or add a 10kΩ to VCC | | Frequency jumps | No debounce in simulation | Set DCLOCK rise/fall time to 1ns | | Total volume wrong | Interrupts disabled during calculation | Keep interrupts on or use a second timer |
: It allows you to verify your code's pulse-to-liter conversion logic (typically 450 pulses per liter for the YF-S201). yf-s201 proteus library
void setup() Serial.begin(9600); pinMode(2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(2), pulseCounter, FALLING); lastTime = millis(); | Error | Cause | Fix | |