Cards on the table first. I'm here not specifically because I'm wanting to learn Arduino, but who knows, I might get the bug! I have a very specific project and seek advice. I suspect there are very knowlegable people here!
I want to build a stand alone water flow meter with display for a CNC machine with a water cooling circuit. I already have a hall effect (3 wire) flow sensor. I wish to output to a display of the same type already fitted to the machine. The displays available all appear to be ammeters or voltmeters. I need to output the flow rate in the range of 0 to 4 Litres/minute. Thus it could be that the input to the meter is 0 to 4vdc, preferably in 0.1 increments. It would be perfect if the device could provide an output to drive a relay at a certain voltage level - the purpose of this would be to lock the machine out if the flow rate falls below a certain value (I'm thinking 2.5 l/min for my application). Can anyone help me with this?
An Arduino board is a perfect fit for this. I would, however, use a different display - one that is not driven by an analog voltage signal. Instead, you should use an LCD screen that you can specify the exact contents of the display, such as this one:
I've just been Googling that type of display and I do see why you're suggesting it, or similar types. However, If I can I'd prefer something like what I have in the panel already because being a large character LED display I can see it from across the room which is quite important.
If it were the type I suggest, would providing an analogue input to a voltmeter be significant extra work and hardware?
1.) Use an ESP-type arduino that has built-in wifi capability. Then you can send the flow rate over wifi to your computer/phone/etc directly
2.) Have the Arduino output a PWM signal with a duty cycle between 0-100%, then feed the PWM output to a low-pass-filter. Then the output of the filter can be fed as a 0-5V analog signal to your current display
3.) Use a Digital to Analog Converter (DAC) to automatically convert the flow to an analog voltage output directly without the use of a filter
I suggest #1, but if you're a beginner, #3 is probably the most feasible.
Those flow meters give a pulse output, the frequency (pulses per second) gives the flow rate. So that's quite straightforward: count pulses, every second see how many you had and you can calculate the flow with it.
The display: there are lots of LED display modules out there, different sizes/colours/numbers of digits. Get a 3-digit one, make sure it has a driver chip such as the TM1637 in place, so you need only two pins to control the device. Write the number to it, and it'll display it without any fuss.
So that breaks down the project in two parts. The flow meter and the display. Get each working on its own, then combine them.
For your machine to cut out: that'll be another output signal of the Arduino. You can easily control an output pin, setting the signal high or low depending on the measured flow rate.
Power_Broker:
You have a few options:
The way I read #0 it seems they're only interested in getting the correct number on a display of a certain type. I don't think the OP is interested in producing an analog output.
Here are some displays, up to 1.2 inches tall and some of them already have a back pack with them so you just send numbers on two wires. Lots of other places have similar displays
I would use an Arduino Nano, read the flow meter pulses with external interrupt, scale the pulse rate to 0 ~ 5 l/min = 0 ~ 255, output that with analogWrite on a PWM pin, then low pass filter to 0 ~ 5V for your analog volt meter. If the pulse rate fell below the equivalent of 2.5l/min for longer than, say, 5 seconds, stop the machine.
You can also flash a light(s) LED's for an alarm even have a two stage alarm - two colors - have more than one LED - maybe flash the display - warning then alarm - audible would also work but don't forget some sort of intelligent way to silence the annoyance
Consider using the counter timer that will minimize your code and give you some very high flow rates if you want them. Before you purchase more parts, you need to do some more research and know what you are working with. Some minor details are missing such as counts per unit, etc. which are necessary to solve your problem. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
The counter inputs are quite unnecessary for a slow signal like this. The best such flow sensors can pull off is a couple dozen pulses a second, maybe you can get it to produce 100 pulses per second but then you're really pushing the sensor to the limits.
You don't even need interrupts to count that. The counter input becomes interesting when you're handling 100 kHz or more, like a few MHz.