Hello everyone! This is my first post although I've been reading the forums for a while now, and I'm very excited about Arduino
I'm working on a project that involves a flow meter controlled by Arduino (model Mega 1280). The problem is that I cannot make Arduino to read data coming from the flow meter. I've followed this guide (by TheMakersWorkbench) and plugged every cable as shown in the diagram but nothing happens... Using the code provided by TheMakers as a test, the Serial Monitor shows 0 L/Hours even when the liquid is flowing through.
I think it has something to do with the flow meter, here are the specs of the one I'm using:
Working voltage: 5 - 18 Vcc
Factor: 1120 pulses per liter
Max. frequency: 280 Hz
Output type: open collector
thanks for the input robtillaart! I'm confused about the pin 2 of the Arduino board, because I'm using Mega 1280 model and Pin 2 is located on the "Analog In" sector. The "digital" inputs are from pin 22 to pin 53.
That's okay, I think the IRQ0 port of the Arduino Mega 1280 is digital Pin 22. I ran your sketch and got something: when no liquid is flowing through, all stats are on 0, and when liquid flows through it rises to 0.0010.. What does this means? Thanks!
I managed to solve the problem, it was a stupid thing of my part: instead of plugging the sensor on Pin 2 of the PWM section I was plugging it on the Pin 2 Digital In section. I got confused because Arduino Mega is different from other models... Anyway, thank you very much!