I have a flow sensor with PWM output and I can't replace it with a flow switch due to mechanical restrictions. Is there any simple way to convert the PWM output to a logic / or analog signal and trigger a transistor with that? e.g. something like a filter that converts the PWM output to voltage and then after a specific threshold turns on a relay?
2 Answers
That should be fairly easy. You need to make a couple of measurements.
1) What DC power supply voltage is available for you to use to power the hall-effect sensor?
2) Is one leg of the current reed-switch connected to your DC ground rail. That is: the (-) supply connection. Or is it connected to some DC voltage above ground?
3) What is the DC voltage across the reed-switch when it is either open or disconnected?
The easiest connection is if one side of the reed-switch is connected to ground (negative supply rail) and if the open-circuit voltage across the reed-switch is less than the max output voltage rating of the hall-effect sensor.
If that is the case, connect the (-) lead of the hall-effect sensor to the ground where the reed-switch used to connect. Connect the output pin of the hall-effect sensor to the other wire where the reed-switch used to connect. Finally, power the (+) lead of the hall-effect sensor with any DC voltage that is within its' allowable power supply voltage. Note that in most logic-signal hall-effect sensors, the output pin voltage can be higher than the power supply voltage (open-collector or open-drain output stage).
Many logic-signal hall-effect sensors are will operate from about 4 Vdc through 24 Vdc and the output pin voltage can be as high as 24 Vdc. But you need to check the specs of the particular hall-effect sensor that your flow sensor has.
There is a couple of ways that you can tackle this project.
1) Filter (integrate) the PWM signal into an analog level that you then compare against a reference voltage. This is probably the easiest method but it may not be as accurate as other methods.
2) measure the PWM duty-cycle with a microcontroller such as a PIC or Arduino board. This requires software but has the advantage that it can be more accurate than the first method.
Question 1: does your sensor have an open-collector output?
Question 2: what is the PWM frequency? What duty-cycle range does it provide?
Question 3: are you certain that the output is PWM with variable duty-cycle as opposed to just variable frequency? Many flow sensors use a rotary vane with sensor and their output signal is a pulse train who's frequency varies with flow rate. This requires somewhat different measurement techniques than what I described above.
-
\$\begingroup\$ It's a hall sensor based flow sensor, I was told it's a PWM output but it may just have a variable frequency output. Using an mcu is out of the question as the scope of the project is to replace a simple magnetic reed sensor with a hall effect sensor (which already exists and is currently in our stock) the 1 way seems to be the most appropriate (accuracy isn't that critical) but I can't find any similar circuit to work with \$\endgroup\$– NoobFeb 7, 2015 at 18:19