How can I detect pulses from a YF-B10 water flow sensor and use them to switch a relay for a shower extractor fan?
Use pulse/edge detection rather than a simple steady high/low detector, because this kind of flow sensor can stay in a fixed state after flow stops [#20240124][#20240176] A simple solution is an Arduino Nano: connect the sensor to an external interrupt input (pins 2 or 3), count pulses in an interrupt routine, and drive the relay from another pin through a transistor [#20240190] An example Arduino wiring was also given as sensor on pin 2 and relay on pin 4, with example code available for the YF-B10 [#20240402] If you want a ready-made hardware approach instead of coding, there are flow-sensor relay modules on the market [#20240573] Another suggested low-cost hack was to adapt a cheap thermostat board by replacing the thermistor with the flow sensor and choosing the capacitor value to set the trigger threshold [#20249207][#20249619]
✨ The discussion revolves around the YF-B10 water flow sensor, specifically its application for detecting hot water in showers to activate an air extractor. The user seeks a finished PCB solution to detect the TTL rectangular waveform from the sensor, expressing difficulty in finding suitable circuits beyond basic Arduino implementations. Various suggestions are made, including using PWM converters, microcontroller interrupts, and ready-made relay boards. Some participants recommend Arduino Nano for handling interrupts and relay control, while others suggest searching for existing pulse detection circuits. The conversation also touches on the cost of ready-made solutions versus DIY approaches, with some users sharing circuit diagrams and code examples for Arduino and ESP32. Ultimately, the user expresses a desire for a simple, cost-effective solution that could work with different supply voltages. Generated by the language model.