Level shifting (in Learning)

Hi,

really beginner ... :o

As in the following doc : Level Shifting

If I understand well, to sense >5volts tension I can use a 4N33 optocoupler as describded in the doc.

If I have 30 volts to the input, and considering the 4N33 led consume 20mW, a 1.500 Ohm resistor is OK, with 0,6 Watt capacity (maybe 1 Watt for safety) ?

Am I right ?
suggestions welcome !

p

Datasheet

You may want to calulate the led resistor value first.

EXAMPLE:

First, looking at Fig 1, 10mA would be a good current level through the IRLED to get full CTR.

IRLED current limiting resistor (ohms) = (30-1.25)/0.01 = 2875.
Therefore, could use 2.7K resistor.

The resistor's power dissipation = (28.75*28.75)/2700 = 0.3W
Therefore, 0.5W or higher resistor power rating would be suitable.

On the output side, a good value for the transistor's resistor would be 1K pullup or pulldown resistor (depending on if you need to invert the signal). Note that 1K would give propagation delay of 60┬Ás (check datasheet Fig 5). The approximate calculated CTR = 2.7/1 = 270% which is well within the specified CTR. Using resistors that result in CTR over 500% would attenuate the signal.