Controlling LED brightness with a PWM signal to LED driver

No current limit resistors in either circuit.

Circuit A - Vf across LED ~1.5V?
(5V - 1.5V)/.035A = 100 ohm, or higher. Many Opto's only 10mA thru the LED for fully saturated output transistor.

Circuit B - Vbe ~ 0.7V
(5V - 0.7V)/.035A = 123 ohm, or higher. Transistor may not need 35mA to go into full saturation.