LCS-1M - A Low-Cost Hobby Oscilloscope
Click on the image for a larger view
|
Analog Frontend
The ADC has a fixed input range of 0 to 5V. Signals smaller
than that range will have reduced resolution, and larger
signals will get clipped. Since the input signal that the scope
is supposed to measure can span a wide range from quite
small to quite large, we need an input stage that can attenuate
and/or amplify the incoming signal to make it suitable for the
ADC. The circuit shown here is for channel 1, but channel 2
looks identical.
First, the incoming signal is attenuated by a factor of 4. This increases the maximum voltage range to
20V. Since the subsequent circuits cannot deal with negative voltage (to keep the circuit simple, the
scope has only a single +5V supply and no negative supply), the only way to measure negative
signals is to shift them up with a programmable offset voltage provided by a digital-to-analog converter
(see next page). This way the scope can display voltages between -12V and +20V max.
The two diodes act as input protection, clipping any signals to the preamplifier that exceed either +5V
or 0V by more than one diode drop.
The preamplifier OP1, a Microchip MCP6022, produces two buffered copies of the input signal, one
with gain 1, one with gain 10, which can be selected by the subsequent stage. Apart from amplification
(the gain=10 version), this buffering is also necessary because the following stage does not react
kindly to input circuit with too high an impedance - wild oscillations would be the result. The MCP6022
has a gain-bandwidth product of 10 MHz, so at a gain of 10 we can expect about 1 MHz of bandwidth -
more than sufficient because our sample rate already limits us to less.
The input impedance of our oscilloscope - determined by the input attenuator - is 133 kOhm. I would
have loved to make it 1 MOhm so one could use standard 1:10 probes which need this impedance to
work, but the input capacitance of OP1 is too high - making the input attenuator resistance too large
limits the bandwidth too much. In my experiments a 1 MOhm divider resulted in a measly 60 kHz of
overall bandwidth, while the present design provides around 400 kHz (which nicely matches the
sample rate limitation - see Nyquist theorem!). You can still use at least a standard 1:1 probe, and in
any case I would not recommend voltages larger than 20V to this design.
The second stage in our signal chain is a programmable gain amplifier (PGA). I chose the Microchip
MCP6S22, which offers a gain-bandwidth product of up to 12 MHz (again, more than enough) and has
gain settings of 1, 2, 4, 5, 8, 10, 16, and 32. The higher gain settings turned out quite prone to
oscillations (the datasheet already warns about that, but I still had to try :-), so that my design only
uses gains up to 10. Together with the pre-amplifier and the attenuator that gives total gains of
between 0.25 and 25, sufficient for most applications. Best of all, there are no moving parts (like
realays)! The PGA has two selectable inputs that I use to switch between the two copies of the
pre-amplified signal, and it communicates with the microcontroller through the SPI bus.
