JCA34F:
If your circuit is working, I think you probably have a 39K, 3.1mA, I would try a 33k, 3.6mA, 0.370 Watts, but still use a 1W resistor, it will get pretty warm. CTR, current transfer ratio is the ratio of current through the LED to current the photransistor can pass, if it were 50% and LED current was 10mA, transistor could pass 5mA (in general).
Nope 390k 1 watt just ordered off digikey. 220k pullup resistor to 3.3v. voltage probes give me 3.2volts when mains off, and < 1 volt when mains is on. Enough for TTL logic to work. Thank you for your CTR explanation.
Wawa:
Current Transfer Ratio is the current you need in the LED to produce a current in the transistor.
Worst case for this opto seems to be 20%,
meaning if you need 0.5mA collector current, you must (at least) have 2.5mA LED current.
Is that current detector circuit I gave you in the other thread still on the backburner?
The 50 ohm resistor in that dissipates <1mW for 4mA LED current.
No special or double resistors needed either, because it only has 0.2volt across.
Leo..
You mean: Measure 50-70mA AC - Project Guidance - Arduino Forum? I didn't see a link/circuit you posted there? Are you referring to the opto/zener one? You did recommend 100k resistor, which I tried, and also worked fine.
Overall, nothing else is going to be on this section of the circuit. The SIGNAL will go directly in to a digital input of an esp8266 (lolin d1 mini pro) and be read if high/low. Given that device operates on a 3.3v signal, and TTL low is < 1v.
Honestly, I am pretty rusty with all this stuff, and I'm just trying to get an opto working with the least amount of parts and at the lowest possible current enough to provide me with a reliable TTL logic signal.
If the LED current should be 2.5mA it seems, with this circuit, I am looking at a ~68k resistor which will dissipate .211 watts
I've also attached a picture of the electrical characteristics of the ESP8266EX. It doesn't seem to tell me the amount of current that will flow when something is connected to an input. Just says Imax = 12mA