I want to use an phototransistor interfaced with microcontroller to detect absence of 118 dc voltage.The problem is how to calculate the right resistor value of the input(LED) circuit as well as output circuit(collector emmiter cct) thanks.
|
A simpler approach would be using a digital isolator such as the ADuM3210. Use a voltage divider to create a 5V input to side 1 of the isolator when the 118V supply is present. This will be communicated across the isolation barrier as a "1" on the output. When the 118V supply is absent the voltage will drop to 0V and a "0" will be observed on the output. You can power the isolator from a supply derived from the 118V supply if necessary. If the input supply is lost, the outputs will default to "0" by default and maintain the correct sense. You won't have to worry about CTR temperature variation or degradation over time in the optocoupler, and the power consumption will be much lower. You can learn more about digital isolator solutions here: |
|||
|
|
|
If you use the following circuit you'll get a high output voltage is the 118V is absent. Swap transistor and load resistor if you want a low output voltage.
Let's take a look at the CNY17 (though many other optocouplers will do). The CNY17 is available in different CTR (Current Transfer Ratio) classes. CTR tells us how much collector current there will flow in the phototransistor for a given LED current. Let's assume a 5V \$V_{CC}\$, that we draw \$200\mu\$A from the output and that the output voltage for a high level should at least be 4V. Then the maximum value for the load resistor should be
Then the collector has to sink 5V/5k\$\Omega\$ = 1mA to drive the output down to 0V. 118V across a resistor is a lot, so let's see if it can handle that. Power = 118V \$\times\$ 1mA = 118mW, so a standard 1/4W PTH resistor is OK. This can also handle the voltage. If you want to use an SMT resistor you'll need at least an 0805. The load resistor determines the current, and we can't use a value higher than 5k\$\Omega\$, otherwise the output voltage level will be too low. If that means that you have to drive the LED with a too high current (for instance in an optocoupler with a low CTR, CTRs much lower than 100% are common), you can use a voltage follower to limit the load current, so that you can use a larger resistor value.
|
|||||||||||||
|
|
Rectify line voltage with Diode , Cap and then use zener in series with opto input so voltage range max to zener / input current determines R. Then find worst case CTR ( current transfer ratio) and load threshold voltage. to ensure load current will drive the appropriate logic level. Tolerances are poor though.and consider Zener diodes around 100V or whatever you consider near a drop out. |
|||||||||||||||
|
