I was playing with Arduino and a PC817 optocoupler.
Simple circuit: using an Arduino digital pin, I wanted to switch on and off a 5mm LED via an optocoupler.
So, digital pin -> 220R resistor -> pin1 optocoupler (internal LED anode)
pin 2 optocoupler (internal LED cathode) -> GND
and
+5V (external power supply) -> pin 4 optocoupler (collector)
pin 3 optocoupler (emitter) -> 220R resistor -> 5mm LED -> GND
LOW level on Arduino digital pin -> 5mm LED off
HIGH level on Arduino digital pin -> 5mm LED on
Ok
The question:
Let's measure the voltages on the 2nd side of the circuit across the components, in both working conditions.
HIGH:
Vce= 0.2V
V across the resistor: 2.7V
V across the LED: 2V
Ok
LOW:
Vce= 3.5V
V across the resistor: 0V
V across the LED: 0V
What's happened to Ohm's law???
I tried to disconnect all components on the first side of the optocoupler and took again the voltages in LOW case.
Same as before
Where I'm wrong?