I one of my first designs, I am attempting to simulate a high precision optical transmitter using an LED by varying the brightness in linearly with the incoming signal. The input signal is BFSK, either 30kHz or 50kHz, and ranges from 0V to 5V.
The LED's brightness varies linearly with forward current. For this purpose, my goal is to have 20mA forward current when the input is 0V an 80mA forward current when the input is 5V.
To do this, I've referenced this guide for higher current LED modulation:Linear Current Modulators for high-power LEDs. My circuit implements the same precision current sink. My circuit is shown below:
To get the value of R5, I chose that the resting LED current (2.5V input) should be at 50mA (between 20mA and 80mA). Therefore,
2.5V=(0.050A)R_5 -> R_5= 50 Ohms
This brings me to my first question: At 5V, the forward current, using a 50 Ohm resistor, would be 100mA, not the desired 80mA. How can I properly set the 20mA-80mA range using only R_5?
I believe that, theoretically, the input voltage (green) and forward current through the LED (blue) should both resemble a sine wave since the input is AC. However, the output I get is different as shown below:
This overall operation of this circuit deviates from what I expected since the output gets limited instead of varying linearly. What can I add or change about this design to achieve linearity?