Gas station without pumps

2012 July 14

Synchronous demodulator

In Phototransistor, I suggested modulating and LED with a  a 1kHz square wave, passing the light through an earlobe, detecting the light with a phototransistor (or photodiode) then demodulating the signal with a synchronous detector.  I spent a little time looking at synchronous demodulators on the web.  Most of them have a more difficult problem to solve, as they are dealing with higher speeds, with more complicated carrier waveforms than a simple square wave (Barker codes, for example, are popular for rejecting interference), and with no access to the originally sent carrier.  I found a nice hobbyist-accessible design and explanation for a Barker code demodulator that might be useful for the mechatronics class, as they almost always have trouble with interference in their detection of infrared beacons.

But the problem I’m looking at is much simpler, as I have direct access to the signal I’m putting into the LED, so I don’t need the complexity of phase-locked loops to try to recover that signal.

If I were to use a photodiode, I might be able to get away with a circuit as simple as the following one:

Synchronous demodulator using a photodiode. Four op amps are used: MCP6002_1 to provide a virtual ground half way between the power rails, MCP6002_2 to switch between having a gain of +1 and -1,  MCP6002_3 to convert the photodiode current into a voltage, and MCP6002_4 to provide final low-pass filtering to get rid of the carrier.

Resistance R5 determines the V/I ratio for the conversion.  If we get saturation problems, we can extend the range of the detector by changing the bias voltage on the photodiode, connecting the anode to ground rather than to Vbias, for example. For a phototransistor, a similar circuit could be used, but with a smaller R5, since the currents are much higher, and a bias voltage is definitely needed to get enough speed.

C1 and R4 act as a high-pass filter, with a time constant of C1 R4 (here 47 msec), to get rid of any DC bias or low-frequency fluctuation.  If the synchronous demodulator does not do a good enough job of removing 60 Hz and 120 Hz noise, then we could raise the cutoff frequency of this filter to try to remove them.  We want to make sure that the carrier frequency (which I’m assuming is around 1 kHz) is well within the passband.

MCP6002_3 uses an analog switch (like the HEF4053B) to switch between a gain of +1 and a gain of -1.  The resistors R3 and R4 should be well matched to get symmetry between the gains.  The switch is controlled by the same signal that turns the LED on and off.

MCP6002_4 is a low-pass filter (with time constant C3 R6, here 10 msec) to remove the carrier and any switching artifacts, leaving just the modulation of the carrier.  R6/R7 sets the DC gain of the last stage, and may need to be tweaked to get a clean signal.

Note: I’ve not tried out this circuit yet, because I don’t have an analog switch.  I should order some this weekend (and some photodiodes), so that I can test the circuit.



  1. […] Synchronous demodulator […]

    Pingback by Order and topics for labs « Gas station without pumps — 2012 August 16 @ 23:39 | Reply

  2. Also note that this circuit will work only for 50% duty cycle square wave.

    Comment by ccik — 2016 September 27 @ 17:27 | Reply

    • Yes, and I no longer like this idea for a lot of reasons. If I were to do synchronous demodulation now, I would almost certainly do it in the microcontroller, taking the difference between readings with and without out the LED light. I’d probably do something that usually had the LED off, measured the light level, turned the LED on, waited for the sensor delay, then measuring again.

      I’d also use a logarithmic transimpedance amplifier, to be less sensitive to the exact gain used. (See Using 4¢ diode for log-transimpedance
      and Pulse monitor with log-transimpedance amplifier, for example.)

      Comment by gasstationwithoutpumps — 2016 September 27 @ 17:45 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: