I have read on this website : http://www.ramge.de/powermonitor/doku.php?id=pulse_meter that I need a 200 Ohm resistor to connect a 24V input to the GPIO.
I know that RasPi need a voltage between 2 and 3.3V to detect a pulse. I also know that RasPi can't manage more than 16 mA. So I have tried a Voltage divider and putting the GPIO pin 2 in derivation with GND, but it doesn't work. So the website is correct but why ? And what is the internal resistor of the Raspberry ? (or equivalent).
Pulse output S0, passive opto-isolated, max. 27V / max. 27mA, switchable at max. power 100mW
which apparently is an input voltage to the device, which somehow the device can input pulses to the Pi. I'm very rusty on my EE so I don't see how this apparently works unless the device is able to take the 3.3v input from the Pi and pulse to GND to signal input to the Pi.