4

I'd like to use a liquid flow meter of type YF-S401 at 12VDC. It produces 1.7-35k pulses per minute (rise time: 0.04us, fall time: 0.18us).

I want to trigger a sinking input of a controller board if the frequency is above a certain number.

While this would be trivial with a MCU I was hoping to get away without one. The trigger level has not to be that exact. It should just give an alarm when the flow stops. A delay of a even a few seconds would be acceptable.

The rough idea was for the pulses to be buffered through a capacitor and that is driving a MOSFET that sinks the input to ground. If the pulses are too infrequent the voltage of the capacitor would drop and the MOSFET would stop sinking the input.

Here is an example circuit:

circuitjs

Now I got the following questions:

  • Should the circuit also work in real life? or are there problems with it?
  • Can I remove the diode? or is it required?
  • What MOSFET to use? AO3400?
  • How do I size the resistors and the capcitor correctly?
tcurdt
  • 201
  • 1
  • 5
  • It would be very Vgsth dependent. If you are already set on not using an MCU, which would be ideal here, I would recommend a comparator and reference. – winny Dec 02 '22 at 23:01
  • You've got the right idea, but the resistor should be on the diode not the cap, and the output threshold is very gradual -- consider a few more amplifying stages, and apply positive feedback (creates hysteresis aka a schmitt trigger circuit). Then the output will change suddenly, which can drive a switch easily. – Tim Williams Dec 03 '22 at 00:27
  • @winny I first thought about using an attiny - but that would need a step down from the 12V and flashing. And I only really need a binary flow/no-flow. So this idea felt more simple. I hope I don't regret it :) – tcurdt Dec 03 '22 at 13:45
  • @TimWilliams Thanks for pointing out the positioning of the resistor. I know it might take a while for the voltage to drop enough to trigger - but that should be OK in this use case. Totally OK to have a lag of even a couple of seconds. As long as it sinks the input eventually. Not sure how easy it would be to add a schmitt trigger. – tcurdt Dec 03 '22 at 13:54
  • Step-down = simplest and cheapest LDO would do. Both solutions would do the job. Have you found a comparator and reference? – winny Dec 03 '22 at 16:00
  • I checked https://circuitspedia.com/comparator/ and remember using a LM358 before. I guess it would give a clear trigger point - but in the end the input should also have a trigger point. Is it really that important to force a clear signal with a comparator or schmitt-trigger? at least for this use-case. – tcurdt Dec 03 '22 at 21:52
  • @winny I also gave the comparator a shot - but seems like I got something wrong there https://tinyurl.com/2ow5zebu – tcurdt Dec 03 '22 at 22:16
  • You need to tune your low-pass to fit your PWM frequency, probably 20 times lower for the -3 dB point. Schmitt trigger in this case is just hysteresis, which you probably want. – winny Dec 03 '22 at 22:44
  • @winny I think I got it somewhat working https://tinyurl.com/2posh72v ... would be nice if the logic was inverted though. – tcurdt Dec 04 '22 at 00:02
  • Just flip the + and - signal input to the opamp. – winny Dec 04 '22 at 08:39

0 Answers0