# What causes the trough of a sine wave to become sharp?

I am using a white LED to send a 5 V p-p: +2.5 V to +7.5 V, DC offset of 5 V, sine wave of frequency 1 kHz as shown in the transmitter circuit. The current generated by the photodiode is converted to voltage using the load resistor. The receiver circuit is shown. My question is why the output sine wave is weirdly shaped.

• that may not be the trough of the sine wave ... compare the waveform to the source waveform Apr 20, 2023 at 18:40
• Do you have a bias voltage on top of the 5V sine wave? (or maybe the 5V sine wave is on top of a bias voltage, which is the same thing). Apr 20, 2023 at 19:01
• I expect that you are using a full-wave rectifier on the transmit side. Apr 20, 2023 at 19:18
• Can you show us the actual circuit you're using instead of a simplified version? What exactly is the LED being driven by? Apr 20, 2023 at 19:36
• @rockky007 - Hi, Please stop removing the images from your question. Thanks. May 3, 2023 at 20:38

The output you're observing makes perfect sense. Remember that a photodiode is still a semiconductor diode. The DC voltage across the diode is similar as the amplitude of the sinewave, and you're observing the logarithmic behavior of the diode.

This can be modeled by the circuit below:

simulate this circuit – Schematic created using CircuitLab

The photodiode's N factor is 1.40. The I1 source on the left is a photocurrent source - the photocurrent is sinusoidal, in this case with the amplitude of about 15μA, and DC offset of 16μA. C1 represents the capacitive impedance of a 10MΩ oscilloscope probe, and is dominating over the 10MΩ purely resistive component which we can ignore for the purpose of this simulation.

The photocurrent source I1 in parallel with the semiconductor junction D1 models the behavior of the photodiode. The photocurrent is proportional to the number of photons hitting the diode, and the junction is there just as in a photodiode. If we were to shield the photodiode from light, it would just be a more expensive, leakier, higher capacitance diode, compared to e.g. 1N4148.

The photodiode voltage:

Looks familiar, right? :)

Given the exponential current-to-voltage relationship, and the relatively huge amplitude of the sine wave relative to its DC bias, the voltage you're seeing is similar to what you'd get by feeding a high impedance sinewave source with a few dozen mV of DC offset added into just about any PN junction.

The voltage you observe is the logarithm of an offset sine wave.

To reproduce a similar plot without using Spice, we can use Matlab/Octave:

T=1/1000;
t=[0:(T/100):(8*T)];
offset=1.05
y=log(sin(t*2*pi/T)+offset);
plot(t,y)


In both the model circuit, and the simplified $$\\log(\sin)\$$ simulation, the offset is a bit larger than the amplitude - by about 5% or so. My guess is that there's a bit of ambient light falling on the diode, or it has significant dark current in spite of photovoltaic operation.

To get a clean sinewave signal:

1. With a resistor-loaded diode, increase the ratio of DC bias to the sinewave amplitude. Say, try with a 0.2Vpp sine wave with 7V offset.

There is distortion, it just gets relatively smaller as the sine amplitude gets smaller relative to the DC offset. Eventually the distortion may be acceptable, although we're trading off noise for it (small amplitude - more relative noise). When looking at THD+N - total harmonic distortion + noise, there will be a "sweet spot" for a photodiode with a parallel resistor, and for a 1MΩ resistor it won't be particularly good. The higher the resistance, the higher the noise voltage.

Logarithm - like most well behaved functions - is a straight line when zoomed in enough, and that's what having small amplitude of the sine wave does. The amplitude is the height of the window we look at the logarithm through.

2. Or, use a transimpedance amplifier that maintains the junction voltage at 0V or a negative voltage.

The voltage output of such amplifier will be linearly proportional to photocurrent, and the vast majority of any left-over distortion is due to non-idealities of the op-amp, and the voltage coefficient of the feedback resistor and capacitor.

We can take the same photocurrent source and diode model as above, and add a transimpedance amplifier:

simulate this circuit

And the output is what you'd expect:

Final note: once you've seen a logged sine wave, it sticks with you. It's worth remembering this shape :) It is different from a squared sine - so it's good actually plotting both and comparing them.

I was lucky enough to have seen it many times, and it took me a good couple of days in middle school to figure out what on Earth was going on. That's about when my photodiode adventures began. I remember how long it took because it was infuriating. I think Encyclopaedia Britannica had the Shockley equation in the diode article, or at least led me to it, and I eventually connected the dots as they say. At that time, I didn't think to look things up in electronics textbooks. The shiny new encyclopaedia was all the rage :)

• This answer is perfect. A minor quibble: it may not be immediately apparent to a beginner that your reference circuits employ a sinusoidal CURRENT source (OPs circuit has a sinusoidal voltage source). Secondly, it may also not be clear that a PD provides a CURRENT proportional to the number of incoming photons. An interested reader is encouraged to go through the excellent textbook "Optical Communication Receiver Design" by Stephen B. Alexander, SPIE Opt. Engg. Press, for details. The importance of TIA in PD circuits is also very clear from the answer. (Edits: minor editorial changes + TIA.) Apr 21, 2023 at 4:57

You are basically rectifying the sine wave to some degree. You need to bias the LED and photodiode into their linear regions if you want to pass an AC signal without distortion.

Here's a simulation of the current through an LED driven with a sine wave with and without a DC bias voltage.

Based on your comments it looks like you are biasing the LED but are still getting some distortion. More bias may make it better but take a look at LordTeddy's suggestion to use current drive instead of voltage drive.

Another option is to use pulse width modulation, then the LED is either on or off and you don't have to worry about it's non-linearity.

• The input signal is not AC. It is all positive so I am expecting a full wave as the output not a rectified wave Apr 20, 2023 at 19:48
• @rockky007 Yes, but you're not taking into account the voltage drop of the LED. Change your offset to 10V and see what happens. Apr 21, 2023 at 22:01
• @SteKulov the voltage drop is around 2V which is why I chose lowest voltage to be 2.5V Apr 22, 2023 at 8:40
• @rockky007 I've never seen a white LED with 2V drop. Can you show me the datasheet? I've very interested. Apr 22, 2023 at 15:18

It looks to me like a compressed sine wave. It's not that the bottoms are "sharp" but the tops are squashed and should be much higher. This happens due to some kind of non-linearity in the system. You can tell this by looking at the halfway point between the peak and the trough, this is much closer to the trough, so for a perfect sine wave the trough needs to be higher.

Without part numbers for your photodiode/LED, and without confirmation of exactly how you're driving the circuit it's a bit hard to say exactly but my first thought is the problem is more likely to be in how you're driving the LED. I'm assuming that you're 5V sine wave is from 0-5V, rather than -+2.5V, else I need to revise my answer.

LEDs' output power is current-driven, not voltage driven. Because they're diodes, the relationship between current and voltage itself is non-linear, so driving an LED with a sinusoidal voltage is unlikely to actually create a sinusoidal output power. It looks to me like what you're getting is compression where an increase in voltage no longer produces an equivalent increase in current, and hence power.

You'd need to drive the LED with a current source, something like a howland current pump is a simple circuit that will produce a current from a voltage input.

You could test my hypothesis if you have a varible PSU from 0-5V. Supply the LED with this varying voltage, and plot the output voltage from your detector. If you see a non-linear relationship then I'm at least partially right.

• The sine wave is from +2.5 to +7.5. DC offset of 5V Apr 20, 2023 at 20:07
• If you look at the current (or the voltage on the resistor), you may see a similar waveform. At 2.5 volts the forward voltage drop of the LED becomes more significant. Apr 20, 2023 at 20:12
• You have a good hunch. The nonlinearity is just the Shockley diode model in action. A photodiode is still a diode. Feed it with a high amplitude high impedance voltage source (the 1Mohm resistor in this case), and you get a logged sine wave :) Apr 20, 2023 at 21:41
• The OP has revealed that they are using a white LED, which may have a forward voltage of about 3 V. So with a 2.5 V offset it will not be conducting for a significant time, and current will be very non-linear. Apr 20, 2023 at 21:49