The delay isnt a problem for my use case
But it's getting a little bit weird here.
I have to Raspis and my program works only on one of them.
Here is how the setup looks like:
I am using a ARCELI PC817 for this.
The positive Pol is connected to the GPIO Pin 04 (5v DC power) and the negative Pol is connected to Pin 03, which my application is listening to.
So, when I connect my Raspi 1 to the optocoupler, I only get ~1,96v to begin with. When the optocoupler is "activated" it drops to 1,26v.
This I can detect with my Application.
Raspi2 nevertheless puts out 4,87v and when the optocoupler is connected, it only drops to 4,85v. This difference is too small to detect.
But why do they have different Outputs in Voltage? I checked the voltage on various Pins from the Raspi1 and it seems that nearly all of them have ~3 less then Raspi2. Even the ground Pins show me a negative voltage -3,18v.
Is Raspi1 defect or am I missing something?