# Convert a Hall-effect flow meter to operate as an on-off switch

I'd like to convert a Hall-effect flow meter to operate as an on-off switch. The output is in pulses, which arrive at a rate proportional to the flow rate. What I would like to do is have a circuit that would turn on and off like a conventional flow switch i.e. a circuit that you can tell: "if X pulse rate, turn switch on."

edit: what I'm thinking about is basically a delay on make timer with the interval set to some timing that would give me the toggle function, e.g. we are getting 5 pulses per second, with the timer set to something just over 200 ms, such that the on state is maintained as long as that many pulses continue to register, but if it goes to 4 pulses, the frequency will be too low, and rejected by a Schmitt trigger or comparator.

There, I think I just told everyone how little I know. :)

• Welcome to EE.SE and thanks for sharing your little project. This isn't a free design service so you need to show some effort and ask for help where you are stuck. You have given no details on voltage and frequency so it would be difficult to give a useful answer. Commented Aug 19, 2017 at 19:26
• thanks Transistor~ I'll see what I can do and get back later. Commented Aug 20, 2017 at 20:08
• You can do this with an MCU (all processing done with firmware). Or some asynchronous logic with one-shots etc. But for (say) a CO2 laser cooling water protection, you can simply buy a flow switch from the usual suspects for a few dollars. Commented Aug 25, 2022 at 14:27

There are a few approaches to this problem, the easiest (if you don't mind a bit of programming) is the microcontroller, such as an Arduino, which was born for this kind of thing.

If you're interested in a more discrete design, read on.

First we need to clean up the sensor signal. We have these issues to take care of:

• The signal potentially has slow slewing edges, which might not be fast enough to operate logic circuitry. Those edges need to be squared up.

• We may not be guaranteed that the signal swings from ground all the way to the supply potential, so we should fix that.

• Sometimes a stationary sensor will output high, sometimes low. We want pulses that are guaranteed to occur at each sensor signal rising edge (or falling, but not both), and last long enough to discharge a capacitor (as we'll see later).

simulate this circuit – Schematic created using CircuitLab

Ignore sources V1 and V2, they are for graphing only. The hysteresis symbol near inputs of gates G1 and G3 indicate that the gate must be a schmitt trigger input device.

This circuit produces pulses of duration approximately $$\R_{1} \times C_{1}\$$ (100μs using the values shown) on each positive going edge of its input, and the output will always return to zero, even if the input remains forever high:

Here's an implementation of a missing pulse detector. An incoming pulse will discharge a capacitor, after which the capacitor is free to slowly charge. If left to charge, capacitor voltage may reach some threshold, which we can detect. Otherwise, if the pulses arrive frequently enough, that threshold is never reached.

simulate this circuit

With VR1 positioned so that the combined resistance of VR1 and R2 is about 270kΩ, here's what happens when pulses arrive 4 per second:

The CLEAN pulses (blue) are just far enough apart to permit the capacitor to charge (orange) beyond the threshold of 3V, and output FAST (brown) can be seen going low for a short period each cycle. By contrast, when pulses arrive at a rate of 5 per second, the capacitor is discharged before it can ever reach the threshold, and FAST remains high:

I imagine you probably don't want a sequence of pulses to indicate a low-flow condition, so the last thing to do is derive a signal which is a steady low when pulses at FAST are detected. I'll leave that one with you, and if I have any epiphanies about about it, I'll come back and tell you.

Your basic approach is correct. This is a common requirement in a fan failure alarm. The stream of pulses is integrated into a voltage level, and that is compared against a reference. The more the pulses are filtered, the longer it takes to detect either the on or off states, But, more filtering makes for less ripple in the signal voltage, and this makes it possible to reduce the amount of hysteresis around the trip point. Search for 'missing-pulse detector' and 'fan fail circuit' schematics.

I would do this by hooking the signal to a microcontroller interrupt pin. Once I saw that interrupts were coming in at >200ms, I would take an action. You could avoid the need for a Schmitt trigger by using a Hall sensor with a digital output. I would also build some hysteresis into the program by requing N pulses in a row to be >(200+h)ms to declare a low rate and M (or maybe N==M) pulses in a row to be <(200-h)ms to qualify as the high rate (to keep it from oscillating). Note that the uC chip is going to be very small; program using ISP.