Greetings,
I am back, needing more help...
I used an PC817 optocoupler with the included circuit - modeled after @ledtester's suggestion. I did some tests with an input generated from an Arduino. Worked fine, as expected. Then I tried to do a real world test, and it did not work. In the circuit the orange part is the LED on the device, and I am attaching the IR LED (input) side to that. The phototransistor side (output) stays "closed".
Here's what I've tried. In all of the cases the phototransistor side does not change. Using the same 3.3V DC with a 10K resistor. For R1 I tried 1K, 100, and 0 (wire) ohm resistors.
Using a DC power supply to drive the input side.
A-B input voltage: 1.14V. At that value the D-E output voltage drops to about 130mV, which I figured would register as logic 0. The output opens fast between 1.00V and 1.14V. With lower than 1.00V the output is closed, and D-E is close to 3.3V as expected (pulled high).
With a 100 ohms for R1 the input draws 2.7mA. With 0 ohms - 130mA
The above indicates to me normal working, and that the optocoupler isn't shot.
Next I connect the input to the actual device - parallel to its LED I want to monitor. Not working - the output stays closed, and the signal was a flat line at some 3.3V. I expect to see a similar pulse signal on the output, but inverted.
Following are the captures from the oscilloscope. The first one is without my circuit being attached. All are 5ms and 1V per division.
With a 100 ohm R1 the current was 2.2mA. With 0 ohm - 2.3mA. The signals had no perceived difference.
So, why is my circuit not working? Not enough current? The DC test had very similar value. Signal too fast? Based on the datasheet switch time is microseconds - this is milliseconds. Input voltage just a tad low?
How do I fix this?
And also - how come even with D1 the AC signal still goes negative. I was expecting to see just to top part. My test isn't set up right? I guess the oscilloscope would still see the "reverse" signal.
Cheers!
tjk