I followed this: https://learn.edwinrobotics.com/230v110v-ac-mains-detection-using-arduino-raspberry-pi-and-esp8266-thing/#Step2
With the exception that I used an LTV-814 that doesn't require a bridge rectifier.
The forwards voltage of the optos led is 1.2 (1.4max) and If = 20mA
Give: Power = I^2 * R = (0.020A)2*(390000) = 156 watts
That doesn't make much sense to me. I'm only using a 1 watt resistor so it should have blown up by now, but it doesn't even get hot. What am I missing?
Further, I calculated my own resistor value for the 390k one rather than relying on the schematic I followed in the aforementioned link:
R = (170vpeak - 1.2forwardvoltage) / .020A = 8440 ohm
Is this correct? Should I use this instead of the 390k resistor?
Mains: 120v