Hello AAC forum,
Working to operate an Arduino using a PIR with some fairly long wire runs
so an opto-coupler is used to isolate the Uno.

This is the first attempt at a circuit. Perhaps, because the signal to the microcontroller,
represented by D2, has the same voltage source as the PIR the optocoupler does not
isolate the the UNO input from EMI.
To isolate the output from the PIR from the input to D2 there must be
separate power supplies, right? Voltage and ground or just ground?

The problem with the second schematic is the PIR, HC-SR505 has a signal output
of 2.5 volts. (The data sheet says 3.3 volts but the signal has been measured
several times and is never above 2.7 and has been measured a couple of times
at 2.49 volts.) The optocoupler, PC 817, requires at least 5 volts to
complete the connection between the collector and the emitter, so a transistor is used to boost
the signal to the optocouple anode.

It is believed this will work but post at this forum for some feedback might
improve chances of success.
Thanks.
Allen in Dallas
Working to operate an Arduino using a PIR with some fairly long wire runs
so an opto-coupler is used to isolate the Uno.

This is the first attempt at a circuit. Perhaps, because the signal to the microcontroller,
represented by D2, has the same voltage source as the PIR the optocoupler does not
isolate the the UNO input from EMI.
To isolate the output from the PIR from the input to D2 there must be
separate power supplies, right? Voltage and ground or just ground?

The problem with the second schematic is the PIR, HC-SR505 has a signal output
of 2.5 volts. (The data sheet says 3.3 volts but the signal has been measured
several times and is never above 2.7 and has been measured a couple of times
at 2.49 volts.) The optocoupler, PC 817, requires at least 5 volts to
complete the connection between the collector and the emitter, so a transistor is used to boost
the signal to the optocouple anode.

It is believed this will work but post at this forum for some feedback might
improve chances of success.
Thanks.
Allen in Dallas