-
Lots of tiny PCBs
03/27/2018 at 16:33 • 5 commentsMy breakouts for the various sensors arrived from OSH Park last night, and I got a chance to assemble some of them this morning. Now, there's a bunch of testing to do. Those things that looks like buttons are actually IR sensors. Buttons don't work for detecting IR.
I also had a deeper look into some datasheets this weekend to see if I could make sense of the level of modulated IR that commercial sensors are capable of detecting, and the implications for this system.
TSOP38138
I first considered the TSOP38138 as a reference for comparison. This is a traditional 3-legged through-hole remote control receiver that claims 45m range, the longest I could find. The datasheet says that the minimum irradiance (typ) is 0.12 mW/m^2 (maximum is 0.25 mW/m^2). It also lists the maximum irradiance (which presumably saturates the photodiode) as 30 W/m^2 (minimum). That's a respectable 54 dB dynamic range. This is a narrow-band sensor that receives 38 kHz modulated IR.
This datasheet also lists correlations between ambient light levels and irradiance on the sensor. They equate 10W/m^2 on the sensor to 1.4 klx at a color temperature of 2856T and 8.2 klx at T=5900 (daylight).
TSMP77000T
Next up is the TSMP77000T, which is one of the parts I'm evaluating for the front-end. This is a wide-band receiver (20 kHz - 60 kHz) intended for learning remotes. Since learning remotes are typically trained while close to the original remote, the sensitivity is not very high. The datasheet claims a 5m transmission distance, which although much less than the 45m of the reference sensor, would still be more than adequate for my purposes. The sensitivity is listed as 12 mW/m^2 (typ) and 25 mW/m^2 (max). This is 1/100 (-20 dB) of the sensitivity of the reference part. Since light drops off with 1/r^2, you lose half the range for every 6 dB of sensitivity, so you would expect about 1/10 the range (1/ (2^(20/6))), which is close enough to 45/5, so that checks out.
Overall, his receiver is probably sensitive enough but the aggressive AGC and limiting digital output isn't ideal for my purposes.
VBPW34FAS
This is a surface-mount version of the ever-popular BPW34 diode. I wanted to see what these irradiance levels would produce for current in a large-area diode like the BPW34. The datasheet lists the dark current as 2-30nA. This is the reverse current through the diode you get with no light incident on it. It further lists the reverse current as 45-55uA at 1mW/cm^2. This is equivalent to 4.5-5.5 nA at 1 mw/m^2. At the 0.12 mW/m^2 reference irradiance, this would produce about 0.6 nA of current, which is much less than the diode's dark current. You can operate the diode in the photovoltaic mode to avoid the dark current issue, but this slows the response dramatically.
Looking back a few logs at the charge injection estimates for CMOS switches in a direct-mixing receiver, it's clear that you won't be able to obtain good sensitivity with that design.
ADPD2211
Finally, I looked at the ADPD2211 from Analog Devices. This is an interesting photodiode with integrated 24x current amplifier, with a wide bandwidth of 400 kHz. The datasheet says that 200 nW/cm^2 is required to produce an output with and SNR of 10000:1 (40 dB). This is 2 mW/m^2, about 0.6x as sensitive as the reference detector, which is pretty good considering the bandwidth, and assuming the reference sensor also achieves 40 dB SNR at the reference irradiance. The sensitivity certainly seems on par.
One concern I've had looking at the ADPD2211 is the saturation level, which seems low at 2200uW/cm^2. This is equivalent to 22W/m^2, which is only a little less than the guaranteed saturation level of the reference sensor. This is roughly equivalent to 18 klx of daylight illuminant (T=5900K). Daylight ranges from 10,000-25,000 lx, according to Wikipedia, so this seems like a reasonable level. Adding a narrow-band IR optical filter could improve this even more.
The output of this sensor is a current, so it is typically converted to a voltage by either a resistor or a transimpedance amplifier. But, I am wondering if the 24x current amplification is enough to bring the signal level to where a CMOS switch mixer makes sense. I'll have to think about it some more.
-
Charge injection concerns / Shot-noise-limited is good
03/24/2018 at 03:03 • 0 commentsSo I thought about a different CMOS-switch mixing front-end, this one using the photodiode in reverse-bias to speed the response (the previous idea used photovoltaic mode):
In this version, switches {A, B, C, D} steer the photocurrent into C1 in forward or reverse polarity to mix the incoming optical signal with the local oscillator (or pseudo-noise). To read out the result, switches {D, E} are closed, allowing the voltage on C1 to be sampled at Vout. Now that I look at it, the diagram should really be turned on its side.
After drawing this up, I started to think about the currents involved. Let's assume the photocurrent is on the order of 10 nA at a low signal level (for lack of a better guess), and that the local oscillator is running at 40 kHz (square wave). This means that the switches are closed for 12.5us in each polarity. A current of 10 nA transfers 0.125 pC in 12.5us. CMOS switches charge injection specs less than this are available, but just barely, and they're not cheap. You can even find them down in the 0.05 pC range, which seems like it might work OK, but they will drive up the cost considerably. And that's assuming a 10 nA photocurrent. Drop that to 1 nA, and all bets are off.
EDIT 20180324: I missed a decimal place the first time I did these calculations. It's much worse now!
Another Commercial Front End
I happened to stumble across the ADPD2211 photodiode optical sensor. This sensor offers a bandwidth of 400kHz with shot-noise-limited performance. Basically, any noise you see on the output is due to the Poisson noise of individual photons hitting the sensor. That's good. The IC is a clever 24x current amplifier using current mirrors. There are two drawbacks I see. First is the price, $6.61 in single quantities. That's bad. I think I'll get one just to see what it can do and for a performance benchmark, even if the price keeps it out of the running for the ultimate design.
The second concern is with the saturation irradiance level. The datasheet lists the saturation level at 2200 uw/cm^2. Assuming a wavelength of 555nm, this equates to around 1500 lux, a little more than the brightness of an overcast day (according to Wikipedia). At first, I thought that this meant the device would have a problem with ambient light levels, but I think this can be fixed by adding an IR filter in front of the photodiode to cut visible light. This should eliminate most artificial sources of light in indoor environments, since LEDs and CCFLs emit no appreciable IR. Unfortunately, sunlight has very strong IR components which may still be an issue.
I think this is close to the ideal front-end for a spread-spectrum IR communications channel, if that tangent to this project should materialize. There is also the possibility of feeding the output of the ADPD2211 directly to a CMOS switch mixer, since the output is a current.
The other parts I ordered have arrived, so I can start some experiments, although I'm still waiting on a few breakout PCBs I had to design to work with the smaller parts.
-
Guess what? Front end.
03/15/2018 at 23:00 • 0 commentsI had a chance to prototype a quick test of the mixer-right-at-the-photodiode idea. It's a mess both aesthetically and electrically, but it'll do as a PoC.
The prototype implements this idea for the mixer using a 74HC4066 quad analog switch and 1 uF integrating capacitor (C1):
It's the same image from the last log, just here for convenience. On the breadboard, A and C are connected to the input of a signal generator, while B and D are see an inverted copy of the input waveform created by a simple transistor inverter. A second transistor drives the LED either 0% of the time, 100% of the time, or in or out of phase with the input signal. I used a BPW34 photodiode and a somewhat random IR LED I had around.
Here's the output with the LED off:
The yellow trace is the input from the signal generator, in this case a 11 kHz square wave. The cyan trace is the voltage across the integrating capacitor. In this case, the output voltage is very near zero. This is despite the fact that the shop lights are very bright, and the BPW34 generates 6.4 uA of short-circuit current when tested with an ammeter.
With the LED on constantly, the output is the same, very close to zero:
When the LED is driven in-phase with the mixer, the output jumps to around 130 mV:
and with the LED driven out-of-phase, the output is -150 mV.
I didn't have a LFSR generator handy for these tests, so this simple prototype would cause all sorts of interference, but it shows that the mixer idea is sound. It already seems pretty immune to interference from other sources, though. An IR TV remote right next to the BPW34 just produces a little jumpiness on the output, but no appreciable DC shift.
I still don't know about the small-signal performance, which I can't really evaluate with the lousy layout of the prototype. Way too much noise and crosstalk.
Parts Search
I'm experimenting with this front-end design, but I still intend to start with Vishay's VSOP98260 amplifier. I also found that they have receivers with photodiodes and this receiver circuit integrated into a single package. I'm going to evaluate the TSMP6000TT and TSMP77000TT modules.
I also found a part made by Broadcom, the HSDL-9100-021, that integrates a matched IR LED and photodiode and includes shielding to reduce crosstalk between them. This sounds like it might work well with either the CMOS switch mixer idea or the VSOP98260 amplifier.
Now, I have a few small PCBs to design to get these things mounted on something for testing.
-
More Front End Stuff
03/15/2018 at 15:33 • 0 commentsI couldn't sleep last night. At least I came up with an idea (it might be lousy). I wondered how far forward you could push the mixer (correlator) in this system. Maybe it could be moved all the way up to the photodiode, analogous to direct-conversion RF receivers?
In this circuit, two SPDT CMOS switches flip the diode from one polarity across RC to the other, synchronous with the transmitted signal. Any DC light component will cancel out since the photodiode will alternately charge the capacitor one way, then the other. In contrast, modulated IR received from the transmitter will be in phase with the switching, and add constructively to charge the capacitor to a DC voltage. This DC voltage can more easily be amplified using precision op-amps, or even chopper amps, since the detected voltage may be very small in some cases. The operation is similar to direct-conversion RF receivers, where the gain takes place at baseband after down-conversion.
There could be any number of issues with this circuit, including limitations of the CMOS switches. Two possible problems come to mind: charge injection and switch leakage currents. Charge injection is when operation of the switch causes a small of amount of charge to be injected (through the MOSFET gates) into the switch contacts. I will have to look into how well-matched typical switches (on the same device) are in their charge-injection characteristics. If the switches are very well matched, the symmetry of the balanced circuit above should mitigate the effect. There is also typically a trade-off between switch on-resistance and charge injection, so I may be able to optimize the design by choosing the correct switch. This Maxim application note discusses these issues and how to select a switch.
The second problem with CMOS switches is leakage current. In this case, current leaks through the internal parasitic diodes of the MOSFETs comprising the switch and into the switch nodes. Again, I can select low-leakage switches and try to find ones with matched leakage currents that will cancel in the balanced circuit.
After a little thought, I've come up with this alternative, which requires a few more driving lines from the MCU, but should be more versatile:
In this case, the SPDT switches have been replaced with four SPSTs, controlled with four digital lines {A,B,C,D}. The capacitor in this case is used to integrate the photo current from the diode. Four modes are possible. By closing either {A, B} or {C, D}, the capacitor can be discharged, resetting the integrator. You do this periodically or at the beginning of a measurement. With all switches open, the capacitor is disconnected from the diode. This mode is useful for holding the output constant for readout: it's a built-in sample and hold. Finally with either pairs {A, C} or {B, D} high, the circuit performs as a mixer in one or the other phase (correlating with a transmitted zero or one).
Although I probably have to use something a little more exotic for good performance, I have a tube of 74HC4066s around here somewhere that I could breadboard up pretty quick to see if this works at all. I can use a large-area diode and hit it with a lot of light, too :-)
References
http://www.analog.com/media/en/training-seminars/tutorials/MT-088.pdf
http://www.ti.com/lit/sg/slyb125d/slyb125d.pdf
https://www.maximintegrated.com/en/app-notes/index.mvp/id/5299
-
Front End Thoughts
03/15/2018 at 02:56 • 2 commentsMy original plan for a front-end was something like this:
The photodiode is connected to an op-amp in transimpedance amplifier (TIA) mode - this converts an input current into an output voltage. I've done this before for light meters and such, and it works well, at least at DC. At higher frequencies, it becomes a bit more complex, although it's well explained in the literature. The output of the TIA is AC-coupled to a mixer, where it gets multiplied by the locally generated (transmit) signal. The original thought for this was a pair of CMOS switches, maybe 4066's (or something with lower resistance).
The upside to this approach is that the amplifier is still linear, unlike the Vishay learning-remote amplifier. The saturating behavior of that amplifier will degrade the mixing performance and limit the sensitivity of the receiver.
The mixing approach (synchronous detection) is used in lock-in amplifier designs to ignore background, as described in a technical report by Analog Devices. Their example shows CMOS switches in the mixing role:
The mixer idea seems sound, but there are several downsides to the transimpedance amplifier as a front-end. Speed may be an issue, but that can be solved by using a high GBW-product amplifier. The TIA can also experience gain peaking, which causes ringing on the output, but that can be tamed with a feedback capacitor as shown. These issues are described in the Hamamatsu photonics handbook.
The biggest problem with receivers like this is the wide dynamic range of the input signal, which can range over many orders of magnitude. The DC level (ambient light) in the environment many be much greater than the signal. In Photonics Rules of Thumb, they liken this to watching grass grow on top of the Empire State Building.
The Hamamatsu handbook has a partial solution: the use of a non-linear feedback element instead of a resistor in the TIA:
Due to the diode in the feedback path, the circuit yields a logarithmic response over several decades or more. Of course, the output varies wildly with temperature, so this simple circuit doesn't produce a very accurate log conversion without some kind of temperature compensation. But for purposes of ignoring the Empire State Building, accurate logarithmic output doesn't matter. The downside of this conversion is that AC signals are also log-transformed. A 1 nA AC signal on a 1 mA DC pedestal is going to look vanishingly small on a log scale (log(1e-3) ~ log(1.000001e-3)).
Another clue comes from a presentation from National Semiconductor, which shows a second amplifier being used as a DC servo to zero out DC bias errors:
This is a way to remove DC signals from the input, but it still suffers from limited dynamic range, due to the resistor in the feedback path.
I have wondered for a while if you could combine these two ideas - a logarithmic DC servo. So, I fired up LTspice XVII and gave it a try tonight. Here's what I came up with after a little experimentation (these particular op-amps are just placeholders until I figure out what I really need):
I1 and I2 represent the photo current through the detector, I2 is a sine wave of 1 nA amplitude, and I1 is the DC component (from lighting in the room). The DC value varies from 1 nA to 1 mA over the simulation run, 5 orders of magnitude). U1 is in a transimpedance amplifier role, with U2 servoing out the DC component, except with the inclusion of diode-connected transistor Q1 in the feedback loop. Transistors like this seem to obey a logarithmic response over a wider range than common diodes. The simulation looks like this:
The top plot is the simulated DC photodiode current, while the bottom shows the detected signal output. The output result is essentially unaffected by the huge range of DC offset. So far it looks pretty good. (There must be something horribly wrong!)
EDIT:
I found out what was horribly wrong: the output is actually the circuit oscillating, not the detected signal. It gave me a good laugh - at least for a minute. Now it sucks. Time to try again. I knew it was too easy.
There are a few things to think about and work on. First, the two current sources are a poor model of a true photodiode. Good models exist, and it would be helpful to try this circuit with a more accurate model. I may consult the datasheets and have a look.
I don't know how to evaluate the stability of a system like this with a nonlinear element in the feedback loop. I may have to be satisfied if it just "works" on the bench.
Depending on the sources of interference that might be encountered, it might be useful to tune the RC filter in the servo loop. Many modern lights emit almost zero IR (LEDs, CCFLs), so even though they have fast switching edges, they may not produce significant interference. Again, some measurements are in order.
Finally, a more subtle issue is that of amplifier saturation with no input. This paper from TI explains the issue: with no input, the op-amp will saturate at the ground rail. In the saturated state, the amplifier may take a long (relatively) time to respond to an input signal. Their solution is to bias the virtual ground above the negative rail:
I will have to try integrating this into the front-end circuit.
So far, this approach looks promising. But I've been burned by SPICE simulation before: there's no substitute for actually building the thing.