Sizing a current-limiting resistor seems like the most trivial task in electronics. You grab Ohm's law, punch in two numbers, and drop a 1/4W carbon film resistor onto your breadboard. But when you move from 5V Arduino logic to 24V industrial control environments, that same casual approach will result in a scorched PCB and a failed isolation barrier. This walkthrough breaks down a real-world series resistor example, exposing the thermal traps that exam questions and generic tutorials usually ignore.

The Problem Statement: 24V PLC to PC817 Optocoupler

Exam / Field Problem:

You are interfacing a 24V DC industrial PLC output to a microcontroller using a standard PC817 optocoupler. The PLC outputs exactly 24.0V when active. The PC817 internal infrared LED has a forward voltage ($V_f$) of 1.2V and requires a target forward current ($I_f$) of 10mA to guarantee a reliable Current Transfer Ratio (CTR) without over-stressing the junction.

  • Calculate the exact theoretical series resistance required.
  • Select the nearest standard E24 resistor value.
  • Determine the minimum physical power rating required for reliable operation in a 50°C enclosure.
  • Specify a definitive commercial part number.

Method Selection and Step-by-Step Algebra

The governing methods here are Kirchhoff's Voltage Law (KVL) and Ohm's Law. KVL applies because this is a single, closed series loop: the sum of the voltage drops across the resistor and the LED must equal the source voltage. We use KVL first to find the voltage burden on the resistor, then Ohm's law to size it.

Step 1: Apply KVL to find the resistor voltage drop ($V_R$)
$V_{source} = V_R + V_f$
$24.0V = V_R + 1.2V$
$V_R = 24.0V - 1.2V = 22.8V$

Step 2: Apply Ohm's Law to find theoretical resistance ($R_{ideal}$)
$R = V_R / I_{target}$
$R = 22.8V / 0.010A$ (converting 10mA to Amps)
$R = 2280\Omega$

Step 3: Map to standard E24 values
2280\Omega is not a standard manufacturing value. Looking at the E24 resistor series, the closest available values are 2.0k\Omega, 2.2k\Omega, and 2.4k\Omega. We select 2.2k\Omega (2200\Omega). Choosing the lower value slightly increases the current, ensuring the optocoupler LED reaches full saturation even if the PLC voltage sags slightly under load.

Step 4: Recalculate actual current with the chosen part
$I_{actual} = 22.8V / 2200\Omega = 0.01036A$ (or 10.36mA).
Sanity Check: The order of magnitude is correct (tens of milliamps), the units are Amperes, and 10.36mA is well below the PC817 absolute maximum rating of 50mA. The math holds up.

The Classic Trap: Power Dissipation and Thermal Derating

Here is where 90% of students and junior engineers fail the exam (or burn up a prototype). They stop at 2.2k\Omega and grab a standard 1/4W (0.25W) through-hole resistor because it is the default in every lab kit. Let's calculate the actual power dissipated as heat.

Step 5: Calculate Power Dissipation ($P$)
$P = I^2 \times R$
$P = (0.01036A)^2 \times 2200\Omega$
$P = 0.0001073 \times 2200$
$P = 0.236W$

\u26A0\uFE0F The Thermal Trap: 0.236W is technically less than the 0.25W rating of a 1/4W resistor. However, resistor power ratings assume a 70°C ambient temperature. In a 50°C industrial control enclosure, a 1/4W resistor running at 94% of its maximum capacity will experience severe thermal drift, premature aging, and likely catastrophic open-circuit failure due to localized heating on the PCB pads. As noted in DigiKey's technical guidelines on resistor selection, you must derate resistors by at least 50% for continuous operation in confined spaces.

To run safely at 0.236W, we need a resistor rated for at least double that dissipation to maintain a safe thermal margin. We must step up to a 0.5W or 0.6W physical package.

Decision Tree: Selecting the Physical Component

Do not leave your BOM with a generic '2.2k 1/2W' note. Use this decision matrix to select the exact form factor and chemistry based on your calculated power dissipation.

Calculated Power ($P$) Minimum Wattage Rating Preferred Chemistry Concrete Part Pick
< 0.10W 1/4W (0.25W) Carbon / Metal Film Yageo CFR-25
0.10W to 0.20W 1/2W (0.50W) Metal Film Yageo CFR-50
> 0.20W (Our Case: 0.236W) 0.6W or higher Metal Film (Low Noise) Vishay MRS25000C2201FCT00

The Final Pick: For our 0.236W dissipation, we terminate the decision path with the Vishay MRS25000C2201FCT00. This is a 0.6W, 2.2k\Omega, 1% tolerance metal film resistor in a standard 0207 axial package. It provides a 60% safety margin over our calculated dissipation, ensuring the resistor stays cool to the touch even inside a sealed NEMA enclosure. You can verify the specifications on the Vishay fixed leaded film resistor catalog.

Independent Verification and Common FAQs

Once the circuit is built, you must verify the math on the bench. Do not just measure the current directly with a multimeter in series; breaking the circuit to insert the meter introduces lead resistance and risks shorting the PLC output if a probe slips.

The Verification Protocol:
Power the circuit and use your multimeter in DC Voltage mode. Measure the voltage directly across the two leads of the physical 2.2k\Omega resistor.
\u2022 If you read ~22.8V: The circuit is working perfectly. Back-calculate the current ($22.8V / 2200\Omega = 10.36mA$).
\u2022 If you read ~24.0V: The optocoupler LED is dead (open circuit) or inserted backward.
\u2022 If you read ~0V: The PLC output is inactive, or the resistor is shorted.

Frequently Asked Questions

Can I use two 1/4W resistors in series instead of one 0.6W resistor?
Yes, but you must split the resistance and the voltage drop. If you use two 1.1k\Omega (1100\Omega) 1/4W resistors in series, the total resistance is 2.2k\Omega. The 22.8V drop splits evenly to 11.4V per resistor. The power per resistor becomes $P = (11.4^2) / 1100 = 0.118W$. This safely fits within the 1/4W rating. However, this takes up twice the PCB space and adds an extra solder joint, making a single 0.6W MRS25 the superior manufacturing choice.

What if my PLC output is PWM instead of steady DC?
If you are driving the optocoupler with a high-frequency PWM signal for analog isolation, the RMS voltage changes. You must calculate the power using the RMS voltage ($V_{RMS} = V_{peak} \times \sqrt{DutyCycle}$) rather than the peak 24V. If the duty cycle is 50%, the power dissipation drops by half, and you could safely step back down to a 1/2W or even a heavily derated 1/4W resistor.