A General-Purpose Photodetector

How fast is that blinking? Sometimes you just need to point a sensor at a light source to get some data. This is a project just for those times. A BPW34 photodiode and op amp transimpedance amplifier form a relatively low-noise, wide bandwidth photodetector with adjustable gain and good sensitivity in visible and near IR wavelengths.

Introduction

A decent photodetector is a useful tool in any electronics lab. It allows for the analysis of changing light sources, capturing of transient phenomenon, or to build extremely sensitive instruments like interferometers. Of course, these can be purchased, but the parts are cheap and it’s a good exercise in op amp design to build one for yourself. At the start of this project I didn’t have any specific performance goals I wanted to hit. Rather, my idea was just to combine commonly available parts, that I would likely be purchasing for other projects anyway, and see how good it could be. I did want the photodetector PCB to be able to interface to the PCB I made for my Laser Displacement Sensor project, which means that it should be able to run off of a 24Vdc power supply and provide a psuedo-differential voltage output compatible with an Analog Discovery 2 (AD2). The “general-purpose” in the description really means that this sensor is intended to be a jack of all trades and a master of none. It won’t be the last word in low noise, wide bandwidth, or any other metric of performance. But it should be decent enough the find every day use in the lab.

The BPW 34 Photodiode

The BPW 34 is an industry-standard silicon PIN photodiode. It’s kind of like the LM324 op amp or the LM317 voltage regulator in a few ways: several manufacturers make them so they’re widely available for good prices, and the performance is good enough for most applications. I chose the BPW 34 S from Osram primarily due to the quality of the datasheet (listen up manufacturers!). The applications section of that datasheet gives credence to the ubiquity of the BPW 34, claiming it can be used for everything from rain sensors to LiDAR (marketing person might be a “bit” optimistic on the LiDAR part).

Some relevant specifications of the BPW 34 from the Osram datasheet:

  • Radiant sensitive area: 7.02 mm2

  • Spectral sensitivity (at 850 nm): 620 mA/W

  • Capacitance (zero reverse bias voltage): 72 pF (yikes, all that area comes at a cost)

  • Dark current (10V reverse bias): 2 nA typical, 30 nA max

A few of the relevant curves from the datasheet are shown in the figures below. Figure 1 is the sensitivity of the photodiode relative to the peak sensitivity at 920 nm. This curve is fairly consistent across all silicon-based photodiodes that don’t have any additional filtering added to them. Figure 2 shows the junction capacitance of the photodiode as the reverse bias voltage is increased. Applying a reverse bias voltage across a P-N junction in a semiconductor widens the depletion region between the two doped regions, reducing the capacitance. You can think of this like the two plates of a capacitor moving apart. Reducing this capacitance is most critical in applications where bandwidth must be maximized. Larger photodiode capacitances require larger amplifier gain-bandwidth products to ensure stability of the circuit, or other circuit techniques to mitigate the effect of the capacitance.

Figure 1: Relative sensitivity vs wavelength for the BPW 34 photodiode. Maximum sensitivity is achieved at 920 nm according do the datasheet. But the photodiode will have some response to light from 400 nm to 1100 nm wavelengths

Figure 2: Junction capacitance of the BPW 34 photodiode vs reverse bias voltage. Applying a reverse bias voltage widens the depletion region of the diode, decreasing the junction capacitance. This can improve the bandwidth of the system at the cost of increased dark current and noise.

Figure 3 shows the downside of applying a reverse bias voltage to the photodiode, an increase in “dark current” or the DC current that flows in the diode with zero light illumination. Dark current produces two major problems in the circuit design. First, if dark current is significantly larger than the light signal that the detector is trying to capture, it may saturate the output of the amplifier. This is generally a problem in very high-gain applications. The wide tolerance on the dark current of the BPW 34 photodiode would make dealing with dark current somewhat challenging in high-gain applications.

Second, but likely more important in this application is that dark current adds noise in the form of a “shot noise” which is a broadband noise. The shot noise equation is given below in equation 1. Noise increases by the square root of dark current ID (q is the charge of an electron, 1.6 x 10^-19 coulombs).

Figure 3: Dark current (labeled IR on the y-axis) vs reverse bias voltage on the photodiode. Increasing the reverse voltage on the diode decreases junction capacitance while increasing dark current.

Eq. 1

Schematic

The schematic for the detector PCB is shown in Figure 4. There’s a lot to unpack here so I’ll break the schematic down piece by piece. Starting at the left side of the schematic, there are two photodiode symbols, PD1 and PD2. I wanted the PCB to be flexible enough to accommodate either a reverse-biased configuration for the photodiode (PD1 location) for wider bandwidth, or a ground-connected configuration with less reverse bias (PD2 location) for lower noise. Connecting the photodiode footprints on the PCB in this way also allows for a differential photodiode setup where the difference in currents between PD1 and PD2 is amplified. Connector J1 is a basic 3 terminal header that allows for other types of photodiodes to be connected, such as ones with through-hole pins or photodiodes in remote locations with wires brought back to the PCB.

Whether this shot noise is significant really depends on the overall system goals. Typically, in systems where maximum bandwidth is the ultimate goal, it is worth trading off additional dark current shot noise for lower photodiode junction capacitance.

Figure 4: Circuit schematic for the general purpose photodetector PCB. The PCB includes multiple photodiode configuration options, a regulated supply for the photodiode bias, an op amp configured as a transimpedance amplifier with switchable gains and the ability to AC-couple the output signal.

Moving to the top right of the schematic, connector J4 is the power supply connection for the PCB and feeds a simple voltage regulator circuit based on a TL431 (U2). Since I was planning on connecting the photodetector PCB to the interface pcb from my laser triangulation sensor project, it needs to be able to accept a 24Vdc power supply. And since that supply is generated by a wall-wart switching power supply, I was not expecting it to be particularly low-noise and “clean”. The TL431 has a reference voltage of about 2.5V, R10 and R11 configure the TL431 to a gain of 8 for this reference voltage (1+ R10/R11), giving a regulated 20V supply (VPD) that can be used for reverse biasing a photodiode installed in the PD1 location. VPD is also used to generate a small voltage (0.5V with values of R2 and R1 shown) at the op amp (U1) non-inverting inputs to keep the op amp outputs from saturating at the negative supply (ground in this case) when there is no photodiode current.

The variable gain transimpedance amplifier circuit is the crux of this project. The circuit is based on a dual op amp and the schematic shows and OPA1656 used for this circuit. I chose the OPA1656 for several of reasons:

  • Offers an excellent combination of input voltage noise (2.9nV/sqrt(Hz) broadband) and input current noise (6 fA/sqrt(Hz) broadband)

  • Low input bias current: 10 pA typical at room temp.

  • Wide bandwidth: 53 MHz gain bandwidth

  • Wide power supply range: 4.5V to 36V

  • Relatively low input capacitance: 9.1 pF differential, 1.9 pF common-mode input capacitance

  • Standard dual-op amp pinout and package (SOIC) allows for swapping in other op amps for different applications

  • Low cost considering the level of performance

  • I helped create it!

The OPA1656 was one of my creations while working as a product definer at Texas Instruments. I challenged the IC designer to make an op amp with the absolute lowest noise and distortion possible on one of TI’s CMOS analog processes. Initially I had extremely high performance audio applications in mind, but I knew the resulting op amp would have useful specifications for a lot of circuits. JFET or CMOS op amps are the most common choices for TIA circuits that will be used in high gains due to their low input bias current and therefore lower input current noise. Extremely low noise JFET-input op amps usually also have very high input capacitances, which is not desired in TIA circuits.

From the schematic, you can see that DIP switch S1 sets the gain of the TIA circuit. I chose to start with decade values from 1k to 1M Ohm for the feedback resistors (R3, R4, R5, R6) and hopefully this would provide a wide enough range of gains for any of my needs. I simulated the circuit in TINA-TI to ensure stability in these gains, and sized the feedback capacitors (C2, C3, C4, C5) according to the simulation results.

Figure 5: TINA-TI simulation schematic to confirm TIA stability. The feedback loop is broken at the op amp output by inductor L1, which still allows for the circuit to maintain it’s DC bias point. A signal is injected through a capacitor and the resulting gain and phase is measured by probe Vf1.

Figure 5 shows the simulation schematic for the circuit, and the loop gain and phase plots are given in Figure 6. The topic of stability is better left for a dedicated article (and many have been written) but essentially the loop is broken by a very large inductor (L1) a signal is injected from an AC-coupled voltage source, and the signal that comes “back around” the loop is measured by the probe Vf1. The 5G Ohm resistor and 48 pF capacitor at the op amp input approximate the BPW 34 with a 500mV reverse bias. Higher reverse bias voltages will reduce this capacitance and improve stability. I admit the stability plots aren’t my best work, but I was trying to minimize the number of different capacitors being purchased while still maximizing bandwidth. The 100k Ohm gain option has the lowest phase margin at 39.53 degrees, and although that’s technically stable, I prefer to build circuits with at least 45 degrees of phase margin. The dips in the phase margin curve are ok as long as they are far enough away from the loop closure point (0 dB loop gain), although they can cause some funky settling in the step response.

The closed loop -3 dB bandwidth of the circuit is >1 MHz for all gains until 1M Ohm where it drops significantly to about 80 kHz. But if I need a wide-bandwidth, very high gain TIA, I likely make it a project of its own.

Figure 6: Loop gain and phase plots for the 4 gains of the TIA. The dips in phase margin are OK as long as they are far enough away from the 0 dB gain point of the loop gain curve. The 100k Ohm gain setting has the lowest phase margin at 39.53 degrees.

PCB Layout

The PCB for this project is a 2-layer board, designed in KiCad., shown in Figure 7. Although the PCB may appear simple, there are a few good practices to keep in mind when doing layouts for transimpedance amplifiers. First, in general it’s good practice to have ground pours on the top and bottom layers of a 2-layer PCB and stitch them together using vias. However, this can add unwanted capacitance to the summing node of the op amp, potentially causing stability problems. That is why the ground pours are removed in those areas on the PCB. I also debated quite a bit about whether the switch, or the feedback components, should be connected to the op amp input. I decided on the switch just because it seemed to have less copper area when routing traces. Good layout practice would also be to limit the area of the feedback loop, but that’s very hard to do in this case with the DIP switch.

The photodiodes were placed on the back side of the PCB to get them as close as possible to the op amp input and DIP switch (minimize loop area, parasitic capacitance) while also not being shaded by the surrounding components.

Figure 7: PCB layout of the general purpose photodetector. The top and bottom ground pours are removed at the op amp summing node (inverting input) to reduce parasitic capacitance.

Figure 8: Top side view of the assembled PCB. The standoffs are install so that this side of the PCB faces down to the lab bench with the board is in use (photodiode side up).

Figure 9: Bottom side of the PCB with the photodiode installed.

The majority of the passive components on the PCB are 0603 size, except for the 10uF capacitors on the power supply connect and the TL431 circuit. The assembled PCB is shown in Figure 8 and Figure 9. Note that the stand-offs are installed so the “top” of the board faces down to the tabletop / lab bench, and the photodiode on the back side of the PCB faces up.

Testing

To date, I haven’t done much rigorous testing to confirm the simulated performance of the system. Rather, I’ve just played around with it, pointing various light sources at it and capturing the output in the Waveforms software from Digilent. First, I threw together a basic circuit to pulse an LED with a BJT on a breadboard (Figure 10). This worked well and I moved on to examining the light output from my fitness band when measuring heart rate or blood oxygenation (Figure 11 / 12). I noticed there were two distinct pulses of light coming from the fitness band (Figure 12). There is most likely an IR LED in addition to the green LED that is visibly flashing. The BPW 34 has substantially higher responsivity at longer wavelengths, so the green light is probably the lower amplitude pulse. Finally, I pointed a TV remote control at it and got a very long train of pulses, I’ll have to look more into the different signals for different buttons later.

Figure 10: Pulsing the light from an LED to confirm basic functionality of the circuit

Figure 11: Examining the light output from my fitness band when it’s measuring heart rate and blood oxygenation.

Figure 12: Light pulses from my fitness band. I believe the two pulses are actually from two separate LEDs. The difference in amplitude may be from the BPW 34 photodiode’s different responsivity at different wavelengths. Likely, the higher amplitude pulse if from a 900 nm near-IR LED.

Figure 13: Light pulses from a television remote control

You may notice some noise on the signals in the images. That is mostly coming from ambient light in the room, you can tell it was not very dark when I performed these tests. Light from my ceiling fan, monitor, window, etc. all will add to the output signal.

Closing Thoughts

The purpose of this project was really to add a useful sensor to my toolbox and I’ve definitely achieved that. I hope that this sensor will let me build some of the projects I have in mind in the future, such as optical interferometers, and also look at the random optical phenomenon that catch my curiosity. The only issue I have found to-date is 60 Hz noise when the circuit is used in its highest gain setting (1M Ohm). I think the most likely culprit is the 24V wall-wart power supply I’m using but really with gain that high, even extremely small sources of noise will cause problems. In the future, I’ll likely make a version of this project with a low-noise supply or battery powered, and put it in a shielded enclosure. But for now, this works!

Previous
Previous

Laser Triangulation Sensors

Next
Next

Low-Noise Accelerometer and Preamplifier