0
\$\begingroup\$

I'm creating a circuit to do communications via a digital serial infrared link. My requirements are for the link to support relatively high speeds (maximum serial bit rate is 4,000,000 bps or 4Mbps) and for it not to draw a unreasonable amount of power; both requirements derive from the fact that I'm intending to drive this with a Raspberry Pi. The driver for this is a UART TX line directly from the Pi. I've chosen the Kingbright APTD3216F3C-P22 IR transmitter and a BC817-40 as the driver transistor (mostly because I have a lot of them leftover from an earlier project!). If it matters, this will be on FR4 PCB with 0402 resistors.

Calculations

Here are my calculations for the various resistors. When the transistor is on, I want to drive 15mA of current through D1. Since the forward voltage drop across D1 is about 1.2V, and \$V_{CEsat} \le 0.7V\$, and the supply is 3.3V, I calculate the value of R3:

$$ R3 = \frac{(3.3 - 1.2 - 0.7)\text{V}}{15\text{mA}} = 93\Omega \approx 100\Omega$$

For R1, I am driving it with 3.3V and \$250 \le h_{FE} \le 600\$ for this transistor, so I calculate the resistor from the required base current times a factor of ten to make sure it's driven into saturation:

$$R1 = \frac{V_{in}}{10I_B} = \frac{3.3\text{V}}{150\text{mA}/250} = 5.5\text{k}\Omega \approx 5.6\Omega$$

To accommodate the higher speeds with clean transitions, I have R2 and used the rule of thumb that it should be about 10x R1. (Is there a better way to calculate that?)

When I do a SPICE DC sweep of Vin, however, the transition isn't very sharp, so I'm inclined to decrease R1 and increase R2, but I'm not sure what values to choose without just guessing.

Questions

  1. Are my calculations correct and reasonable?
  2. How should I increase the switching speed of the transistor?
  3. Is there a better design method? How should I choose the resistor values?

Schematic

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
  • 1
    \$\begingroup\$ 1) (maximum serial bit rate is 4000000) That's too many 000s, better use: 4,000,000 or 4 Mbit/s. 2) that IR LED has a certain capacitance, did you incorporate that in your simulation? Suppose that capacitance was very large, would in that case increasing the switching speed of Q1 help in any way? 3) At 4 Mbit/s I think you're reaching the boundries of what can be achieved with such a simple circuit. You might want to use some kind of push/pull stage to drive the LED. \$\endgroup\$ Commented Mar 1, 2021 at 14:27
  • 1
    \$\begingroup\$ Any high speed design will require careful considerations for both sides of the opto design. Both the driver and the receiver will require co-design efforts. You cannot design either side in isolation. This is serious design work, not some half-measures thing. Also, you will also almost certainly require active high and active low driving -- neither quadrant passive. So get your design visors on and dig in. \$\endgroup\$
    – jonk
    Commented Mar 1, 2021 at 15:01
  • \$\begingroup\$ Don't do a spice DC sweep. Perform a proper transient analysis and show waveforms in your question. Use an emitter degeneration resistor like 47 ohm and forget about saturating the drive transistor hence, get rid of R3. Drive the base from a potted down version of the 3 volt peak input such as 1.4 volts (thus leaving 0.7 volts across the newly introduced 47 ohm emitter degeneration resistor - that will cause 15 mA to flow in your diode. \$\endgroup\$
    – Andy aka
    Commented Mar 1, 2021 at 15:09
  • \$\begingroup\$ When I asked "Is there a better design method?" that was not a rhetorical question. I'd be grateful if someone could show a better design method in an answer. \$\endgroup\$
    – Edward
    Commented Mar 1, 2021 at 15:12
  • \$\begingroup\$ @Edward Andy's answer points out 90 pF. Add to that the BJT itself, which has its own charge storage to deal with. I figure for 4 MHz you want 10% for rise and similarly for fall (90% in each direction.) This means 25 ns on each edge. Have you worked out the drive currents for this? Without a calculator I'm guessing dozens of mA, both quadrants. I think a minimum of three BJTs plus passives and speed-ups. But that's just my guess for now. \$\endgroup\$
    – jonk
    Commented Mar 2, 2021 at 11:24

1 Answer 1

1
\$\begingroup\$

When I asked "Is there a better design method?" that was not a rhetorical question. I'd be grateful if someone could show a better design method in an answer.

This should be a better (higher speed) driver because you are not forcing the BJT to operate in saturation (it takes vital nanoseconds to come out of saturation): -

enter image description here

If it's still not fast enough you might consider using a faster transistor because the BC817 is unity hFE at 100 MHz (aka \$F_T\$) - go for something like 1 GHz.

Another improvement in speed can be got by not fully turning the transistor off i.e. biasing the base a bit so that the IR LED receives (say) 3 or 4 mA when the logic input is at 0 volts. This is similar to how laser diodes are driven - full light extinction is prevented.

I also see nothing in the IR LED data sheet that tells you how quick it can turn on and off - this would significantly concern me. I see that it has a capacitance of 90 pF and that's OK when turning on the LED but not so great when turning it off.

\$\endgroup\$
2
  • \$\begingroup\$ My simulations show that it doesn't make 4Mbps, but it easily does 1Mbps, which is likely to be fast enough for my purposes. I'll adjust the specs and test thoroughly when I get the boards. Thanks! \$\endgroup\$
    – Edward
    Commented Mar 3, 2021 at 23:11
  • \$\begingroup\$ Try a faster transistor if lock down allows. In my last job I was regularly running at hundreds of Mbaud but I used laser diodes. \$\endgroup\$
    – Andy aka
    Commented Mar 3, 2021 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.