matizzy wrote:I've tried to connect it in many ways and it doesn't work. I attached one of the GPIO pins with an internal pull-up to the + pin of the meter and I connected the - min of the meter to the ground of the raspberry pi. In terms of software I have a loop that waits for a falling edge and increments a counter by 1 every time it sees the edge and prints the count number.
If your lucky the legend means that the meter output tolerates an external voltage of 18 - 27V (nominal 24V?) and will sink up to 27mA. Nothing happens because you aren't supplying a suitable voltage.
If you are unlucky the meter outputs a poorly regulated ~24V which you have connected to a 3.3V input and destroyed a GPIO input.
Step one is to test your GPIO input, With it configured as input ground the GPIO pin and check that your code, or command line GPIO read detects the changing state.
Check your code does basic pulse counting stand-alone.
If you connect two 9V batteries in series you get 18V. Wire that in series with an 1k ohm resistor and an LED.
Batt+ --> resistor --> LED Anode | LED Cathode --> Meter+ | Meter - --> Batt-
The resistor limits the short cicuit current to 18/1000 = 18 mA, which is within the meter rating.
Hopefully the meter will be low impedance when pulsing and current will flow in the LED lighting it up.
Voltage across the (red) LED will be ~2V and current will be ! 16/1000 = 16mA
Do not connect this circuit to your Pi!
If that works you will need to convert from 18V to 3.3V. Buy an opto-isolator and connect its LED terminals in place of, or series with, the LED in the circuit described above.
Now you should have a stransistor output in the Opto-isolator that you can conect to a GPIO input. Collector pin to GPIO, emitter pin to Pi 0V.
You don't need any electrical connections between the meter and the Pi.
If you can now count pulses from the meter you will need to sort out a permanent power supply. You may find it easier to find 24V supplies. 24 - 2V(LED) - 2V(opto-isolator) = 20V
20V/1000 = 20mA
An opto-isolator something like this