Introduction: LCS-1M - a Full-Featured, Low-Cost Hobby Oscilloscope
This instructable will show you how I developed a simple yet full-featured digital sampling oscilloscope that I hope will enable you to get a successful start in this domain. The main goals in this development were:
Create something that is really usable in practice - i.e. it must have sufficient sample rate to at least cover the audio range (DC up to well over 20 kHz), and a wide input range (from Millivolts up to several Volts). The present design actually is usable up to about 150 kHz (sample rate is 1 MHz = 1 million samples per second). The maximum voltage range is -15 to +20 Volts, but can also go down into the low mV range.
Use only readily available, inexpensive parts which don't need special skills to assemble - e.g. no tiny surface mount components. The whole scope can be put together with a cheap soldering iron, a small wire cutter and flat-nosed pliers.
Keep down cost as much as possible and design it in a way that all the components are easy to procure and assemble, so any moderately skilled hobbyist can build his/her own (see circuit description later).
Make it easy to use so even a user without much experience with oscilloscope gets a quick start, and make it compact so it doesn't use much desk space.
Last but not least, make it an open design so anyone can improve upon it. Note that the design may be used without any restrictions for personal, non-commercial use only. Any other use is strictly prohibited without explicit, written permission by the author.
You can get additional information as well as download the original design files (schematic, layout) and scope software from my oscilloscope homepage. From this site you can also obtain the bare printed circuit board and (as long as I have some left) the fully assembled scope and accessories.
In case you wonder what LCS-1M stands for, it's Low Cost Scope, 1Megasample/sec.
Disclaimer (yes, this is a litigious world :-):
The author of these pages does not assume any responsibility whatsoever regarding the design, construction or use of the described circuit. The author cannot be held responsible for any damage to persons or property connected with the described design. This includes (but is not limited to) damage to your computer, fitness for a specific task, and specified performance. If you decide to build the oscilloscope and use it, you do so at your own risk. Observe safety guidelines when soldering, as well as when using the oscilloscope. Never apply any voltage exceeding 20V to the oscilloscope inputs.
Step 1: Filling a Niche
An oscilloscope is an invaluable tool for anyone working in electronics. It allows studying electrical signals that are changing over time. Perfect for troubleshooting, monitoring, or simply observing one's electronic creations in more detail.
Unfortunately, even with significant reductions in cost in recent years, a usable oscilloscope remains out of reach for many people who could benefit from it - especially young students just starting out, and many hobbyists on a limited budget. A good low-end standalone scope easily comes in at over US$1000, and even PC-based scopes (which connect to a computer for display and control) usually cost US$300 and above.
On the other hand, most "hobby" solutions (sound-card based or purely microcontroller based) lack sufficient performance and usually are not much more than toys without much practical use. Most of the time they are more like "proof of concepts" that lack any decent frontend (to amplify small signals or attenuate signals) and have bandwidths much too low even for audio.
Of course it is often possible to pick up a decent used analog scope on Ebay for a good price, but most such scopes (cathode ray type) are rather bulky and bothersome, especially for someone without the luxury of a spacious electronics lab, and they often are difficult to use without a good dose of prior experience.
Step 2: Main Features
- Two independent input channels
- Sample rate up to 1 MSample/sec (good enough for signals up to approx. 150 kHz)
- Analog bandwidth approx. 400 kHz
- Input impedance > 100 kOhm
- Sensitivity from 20mV/div to 1V/div (20 vertical divisions).
- Vertical offset 0 - 20 divisions (except for 0 - 12 divisions in 1V/div range)
- Record length 256 samples per channel
- Trigger on CH1 (rising or falling edge, selectable) or autotrigger
- Connects to PC through serial port (RS-232) or USB
- Power supply from a generic wall-wart type supply (9 - 15 V DC)
- Compact and lightweight (about the size of a DVD box)
- Runs on Windows 95, 98, 2000, XP, Vista
- Fully graphical interface.
- All settings (timebase, vertical resolution, trigger) are controlled from the PC.
- Screen update rate up to 7 frames/sec (mostly limited by scope hardware; will improve with future
- Real-time Fourier transform (frequency spectrum display)
- Real-time averaging
- Waveform measurements using cursors
- Waveform export to Excel etc. (.CSV file format)
- All components easily available and inexpensive. About half of the chips can be obtained as free
- Total parts cost approx. US$60 for minimal version (bare board, i.e. no enclosure).
- Through-hole and DIP packages only - easy to assemble and solder.
- Can be built up on a breadboard or a protoboard (but I'd recommend the "real" printed circuit board
- No adjustments or trimmings necessary whatsoever - put it together and use it right away! Thus
- No separate programmer needed for the microcontroller (Picaxe 28X1) - the cable already used for
- Fits in a robust standard enclosure
- Accepts standard 1:1 probes, BNC cables, or grabber cables.
Step 3: Design
The next pages will show the following:
- The overview page gives a short introduction into to overall design. That should help getting the big picture.
- The next pages each explain one page of the circuit schematic - what the circuit does, some
- The firmware page gives a high-level overview of the firmware that gets burned into the
- The PC Software pages gives an overview over the scope program that runs on the PC, including some screenshots.
Step 4: Design Overview
The oscilloscope hardware has several main sections, described in the following pages.
First, there is the controller. It is the heart of the scope and is based on a industry-standard 8-bit microcontroller. It sets up the scope's sample logic, sets the input amplifiers' gain and offset, reads the captured samples from the capture memory, and communicates with the PC which tells it how to set up the hardware and then waits for it to send back the acquired data.
The input signals are conditioned in the analog frontend, which depending on the signal levels either attenuates them or amplifies them, and can also add offset. All this is necessary to make optimum use of the fixed voltage range that the analog-to-digital converters can convert into digital information.
Third, the analog-to-digital converters (ADCs) take the analog signals and convert them into digital
numbers which then get stored in memory (static RAM = SRAM).
The sample process and sample storage is controlled the sample logic. It consists of a few generic CMOS logic chips, controlled by the microcontroller, and are also used to read out the data from the capture memory.
The PC interface is standard RS-232. The cable connecting the PC can either be a normal serial cable, which is the cheapest solution (in this case the scope is connected to the computer's serial port, e.g. COM1) or can contain an integrated serial-to-USB converter, allowing to connect it to the computer's serial port. The change is transparent to both the scope and the PC software and has no impact on performance, but is helpful because the old serial port is slowly disappearing from new computers.
Finally, the power supply circuitry converts the voltage coming from the external power supply - which can vary anywhere between 7 and 15 V - into a stable and well defined voltage suitable for the circuit. This voltage is also the reference against which the input voltage gets measured.
Step 5: Circuit Description - Microcontroller
The Microcontroller is the heart of the oscilloscope. It controls all the other parts of the circuitry. I chose the Picaxe 28X1 (from www.picaxe.com), which basically is a Microchip PIC16F886 with built-in bootloader and Basic interpreter. While this makes it a bit more expensive than the raw PIC it is based on, the advantage is that you don't need to buy or build a separate programmer to burn the scope firmware - which makes it much more beginner friendly and also saves money overall.
The firmware download circuit consists of just three resistors (R2, R3, and R4). The download cable, a simple RS-232 serial cable (also available from the Picaxe vendor) ending in a stereo phono plug, which gets re-used during normal operation as the connection between scope and PC - again reducing overall cost.
Because the microcontroller itself doesn't have enough I/O's, I added a Maxim I/O expander (MAX6956 or the pin-compatible MAX7300), which gives 20 additional I/Os. These are mostly used to transfer the sample data from the scope's SRAM memory, as well as for chip enables for the DACs and programmable gain amplifiers that the microcontroller talks to via an SPI bus. The communication between the microcontroller and the I/O-Expander is through an I2C bus (the Picaxe's program execution is relatively slow, and the I2C version of the expander results in less commands to send compared to the SPI version).
There is a jumper to switch between firmware download and regular connection. In principle we could use the download connection to transfer commands and data during normal operation as well, but this connection is a "software UART", i.e. the microcontroller has to bit-bang the data, and in addition it uses CMOS levels (0 to 5V) instead of standard RS-232 levels (-15 to +15V).
On the other hand, switching to the other jumper setting connects the microcontrollers to the hardware USART port, which can run in the background, i.e. the data byte gets transferred in the
background while the microcontroller can already perform the next operation. This speeds up the
frame rate (maximum number of scope screen refreshs per second) by more than half. In addition it uses a MAX232 level converter that converts between the CMOS levels to/from the Microcontroller and the RS-232 levels to/from the PC, and also adds a layer of protection between scope and PC (after all, you may accidentally connect your scope to a high voltage, and that shouldn't fry your PC as well!).
Step 6: Circuit Description - Power Supply, PC Interface
The connection between the scope and the PC is a standard RS-232 serial connection. A Maxim MAX232 level converter converts between the CMOS levels to/from the Microcontroller
and the RS-232 levels to/from the PC, and also adds a layer of protection between scope and PC. The data is sent at 19200 baud, which according to my tests is about as fast as the microcontroller can read the data from the memory, meaning an increase in baud rate does not translate into an increase in screen update rate.
As for the power supply, the scope runs from any generic DC power supply capable of supplying at
least 300mA (the scope really only uses about 150mA, but it is better to have at least some headroom) at a voltage between 9V and 15V). This voltage is regulated down to a very constant 5V with the venerable (and easy-to-obtain and inexpensive) 7805 linear regulator.
You may wonder why there are two identical regulators in the circuit. The reason is that digital logic
chips (like the microcontroller or the sample logic) cause large spikes in current whenever they are
switching (basically whenever the clock toggles). This in turn produces sudden drops in the supply
current. While this is usually of little consequence for the digital circuits as long as it doesn't get too
excessive, it impacts the accuracy of the analog circuits in the scope and would introduce noise in the measured signal.
To avoid this situation, I chose a very common supply arrangement where one regulator supplies all digital logic, while the second regulator supplies the analog portion of the circuit (op-amps,
digital-to-analog converters supplying offset voltages, analog section of the digital-to-analog converters). That way compared to my original breadboard version of the scope I was able to reduce the noise on the analog power supply by about a factor of three, to less than one LSB of the 8-bit sampler. The analog supply voltage also doubles as reference voltage (against which the signal level gets measured), which again asks for a very stable supply because any changes or noise would show up as changes or noise in the measured signal.
Four 100uF electrolytic capacitors (one before each of the regulators, and one after each one) buffer supply current changes. In addition, a 0.1uF ceramic capacitor close to each IC (distributed over the rest of the schematic pages) buffers fast current spikes caused by digital switching.
Step 7: Circuit Description - Sample Logic
There are quite a few simple oscilloscope designs out there that try to implement the full sample logic in software on the microcontroller. Unfortunately typical inexpensive and simple-to-use 8-bit microcontrollers lack sufficient speed, so achievable sample rates are low. That's why I decided to use external digital logic instead. In the current design the limit for the sample rate (1 MS/sec) is given by the analog-to-digital converter that I used (MAX153) rather than by the sample logic - it would be easy to have it run to 10 MS/sec and beyond.
Originally I designed the scope using a Xilinx CPLD (programmable logic device), but in the end
decided to employ standard CMOS logic chips (74HCxx series) instead - a CPLD again needs special programming hardware and software and I figured that would probably put off everybody except a few experts. It also knocked a little bit off the component cost. This forced me to really reduce the logic content to an absolute minimum, so thats why there is e.g. no pre-trigger option (i.e. a possibility to capture the signal before the trigger). Maybe I'll make such a scope in the future.
The microcontroller supplies a clock signal (produced in the background through its PWM output)
which is gated (blocked) until a trigger impulse arrives through flip-flop DFF1. The XOR in front of
DFF1 acts as a programmable inverter to select triggering on either rising or falling edge. In front of it is a Schmitt-trigger logic gate that adds some hysteresis to minimize the chance of false triggering due to noise.
The clock signal drives a 8-bit binary counter (CTR1) which increments the address for the data
storage in the SRAM (see next page). When the counter wraps around (i.e. after reaching its
maximum, and the most significant bit goes again from 1 to 0) this triggers another flip-flop (the
second half of DFF1) which in turn gates off the clock signal. The other output (Q) of the flip-flop
produces the "DONE" signal which indicates to the microcontroller that the data acquisition has ended and the data can now be read from the sample memory and transferred to the PC.
For this readout, the microcontroller re-enables the clock path and alternately pulses the clock signal and reads out one bye of sample data, which it transfers to the PC through the serial connection.
Step 8: Circuit Description - Analog-to-Digital Converter; Sample Memory
The analog-to-digital converter (ADC) is a central part of the oscilloscope; it samples the analog signal and transforms it into a digital number which then gets stored on the sample memory. For this design I chose the Maxim MAX153 ADC, which is a half-flash ADC capable to acquire up to 1 million samples per second with a resolution on 8 bits (i.e. values of 0 to 255). This was the fastest ADC I could find that is available in DIP package (beginner-friendly!) as a free sample.
That sample rate means the scope can produce meaningful displays of signal up to about 150kHz (in that case, there are about 7 samples per period). The ADC is driven by the same clock as the counter, and it provides the sampled data in parallel format (8 data lines).
The sample memory is a legacy SRAM chip with a size of 2K x 8 (i.e. 2 KBytes), of which only the first 256 bytes get used. One could easily put in a larger counter (just cascade another counter IC), but I chose to keep it down to an 8-bit address out of two reasons - first, it cuts down on components and cost, second, a record length of 256 samples is sufficient for a very decent waveform display while at the same time the screen update rate is relatively fluent (I measured close to 7 frames/sec with a single channel turned on). Doubling the record length would cut the update rate roughly in half.
The acquisition circuit (ADC + SRAM) is doubled, i.e. one set for each of the scope's two channels.
The overall design would allow for an easy extension to more than two channels - just add more sets of ADCs and SRAMs in parallel, as well as more I/O expanders to read back the SRAM content.
One little hitch that took me a while to debug is the following: The counter is a ripple counter, i.e. not all output signals toggle at exactly the same time. This means that for a short while the address going to the SRAM changes more or less randomly. If you keep the SRAM's write enable on during that time, the data at those random addresses will get overwritten with the current sample. I got waveforms that were recognizable but had sudden abrupt changes every few cycles. The solution was to hook up the /WE input to a copy of the clock signal of appropriate phase so the write gets disabled whenever the address from the counter changes.
Step 9: Circuit Description - 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 an input circuit with too high an impedance (i.e. too little drive strength) - wild oscillations would be the result (of course I had to try this out experimentally, and indeed quite "interesting" but not really usable behavior was 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!). At least you can still use a standard 1:1 probe, and in any case I would not recommend applying voltages larger than 20V to this design. (Note: I recently designed a simple compensation circuit that enables 1 MOhm impedance as well as higher bandwidth (1 MHz) - see next step for more details).
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 selectable 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's why my design only uses gains up to 10. Together with the pre-amplifier and the attenuator that gives a total gain range from 0.25 up to 25, sufficient for most applications. Best of all, there are no moving parts (like relays)! 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.
Step 10: Upgrade to 1 MOhm Impedance and Higher Bandwidth
The signal input of the original LCS-1M design has an impedance of 133 kOhm. This is usually
sufficiently high to make signal aberrations due to the additional load negligible (e.g. with a 600 Ohm audio source the 133 kOhm load introduces a level error of well under 1%; errors due to resistor tolerances, power supply tolerances etc. add up to much more). But it precludes the usage of standard 1:10 scope probes, because these probes assume a scope impedance of 1 MOhm (they are basically just 9 MOhm resistors, which then forms a 1:10 voltage divider with the scope input).
As already outlined in the previous step the reason I had to choose a lower resistance is the input capacitance of the op-amp (OP1 for scope channel 1). It is parallel to lower resistor (R12) of the input divider, and at higher frequencies it shunts R12 and thus increases the division ratio (refer to
schematic page 5). That means higher frequencies get attenuated more - we got ourselves a low-pass filter without even asking for one. Use a higher resistance divider and the problem only gets worse. With a 1 MOhm divider I got a measly 60 kHz of bandwidth - too little to match the scopes 1 MS/s sample rate. I needed to go down to these 133 kOhm to achieve around 400 kHz.
There is no way to get rid of this input capacitance. So "if you can't beat them, join them". If you add a discrete capacitor C1 in parallel to R10 (the 100 kOhm resistor) you get a capacitive divider in parallel to the resistive divider. If you choose C1 so that
R10 / R12 = Cin / C1 (Cin is OP1's input capacitance)
then the division ratios of capacitive and resistive divider are equal, and the division ratio is constant over frequency - no more low-pass filter effect even though Cin is still there. (Actually the input impedance decreases with frequency, but that's much less of a concern; the divider ratio does not change).
Cin is usually not known very precisely (and will vary from device to device, even of the same type), so scopes normally make C1 adjustable so you can trim it to optimum setting. Since I did not want
anything that need adjustment (because that tends to scare beginners off), I chose instead to also add a large-ish capacitor (C4) in parallel to Cin - that way variations in Cin have much less effect.
Standard low-end scopes typically have an input capacitance of around 15pF, so was shooting for a similar value. To get a 1 MOhm resistive with a ratio of 1:4, the resistors need to be 750 kOhm and 250 kOhm. As for the capacitors, after choosing C1 to be 18pF I varied C4 until I got the flattest frequency response with a choice of 43pF. With that, the bandwidth doubles to around 1 MHz (not very important given the scope's maximum sample rate), and the input impedance at DC is 1 MOhm, so you can now use 1:10 probes to measure voltages higher than 20V!
To modify the LCS-1M with the new input stage you'll need to hack the board a bit - but it's pretty easy. If you can't easly get the component value (750 kOhm, 250 kOhm, 43 pF and 18 pF) you can put them together from two components each, combining them either in parallel or in series. Remember that for resistors, the total resistance R_tot is
R_tot = R1 + R2 (series connection) or R_tot = (R1 * R2) / (R1 + R2) (parallel connection),
while for capacitors, the total capacitance C_tot is
C_tot = (C1 * C2) / (C1 + C2) (series connection) or C_tot = C1 + C2 (parallel connection).
For the resistors, as long as you get within about 1 - 2% of the goal, you are fine. The E24 series (1% tolerance) has 750 kOhm and 249 kOhm available. Or with easier-to-obtain E12 series resistors (5% tolerance) you can use 130+620 = 750, 270+470 = 740, or 330+430 = 760 (all series connected), or two 1.5 MOhm resistors in parallel. For the 250 kOhm resistor use series combinations of 100K+150K, 30K+220K or 51K+200K.
The capacitors usually have larger tolerances anyway (5% or 10%), so don't get overly fussy here. If
43pF and 18pF aren't easily available, use 44pF (= two 22pF in parallel) and 20pF (= two 10pF in
parallel), or 47pF and 22pF. Alternatively, replace the 18 pF capacitor with a ~5 - 50pF trim capacitor, measure a square wave and adjust it until it looks really square (no rounded edges and no overshoot either).
Attached below is the updated schematics for the two channels.
1. Unsolder R10 and R12.
2. Replace R10 with a 750K resistor (R10 and R31 in the updated schematic) and 18pF capacitor in parallel. Keep lead lengths short to reduce parasitic inductance.
3. Replace R12 with a 250K resistor and 43pF capacitor in parallel.
Channel 2: same, only the part numbers change.
1. Unsolder R18 and R19.
2. Replace R18 with a 750K resistor (R18 and R32 in the updated schematic) and 18pF capacitor in parallel.
3. Replace R19 with a 250K resistor and 43pF capacitor in parallel.
Step 11: Circuit Description - Level Offset; Trigger Circuitry
The last part that the microcontroller is repsonsible for are some analog voltages. First, there are the channel offset voltages which move the measured waveforms and also allow for negative signals to be displayed. These voltages are generated by a two-channel 12-bit digital-to-analog converter (DAC, Microchip MPC4822) that is connected to the SPI bus.
A DAC of same type also sets the adjustable trigger level. Since the DAC can only produce voltages from 0V to 4.096V, one half of OP3 scales this up to the full necessary range of 0 to 5V. The second half is configured as an open-loop comparator, i.e. an op-amp without any feedback circuitry and as a consequence very high gain. It is fed by the trigger level on one side and the ADC1 input voltage on the other. This circuit will rail to the positive supply voltage whenever the input signal exceeds the trigger threshold ever so slightly, and rail to ground whenever the input signal is only sightly lower than the threshold. In other words, it provides a digital trigger signal that feeds the trigger input of the sample logic.
In the present circuit the scope can only trigger on channel 1. This is not really a serious limitation, the user simply must decide which signal he/she wants to trigger on before hooking up the scope to his/her circuit. At the same time, it cuts down on components, board size, and cost (at least two more ICs and some discrete elements).
Step 12: Breadboard Version
Initially I built up the scope on a standard breadboard. This allows for easy troubleshooting, adding and removal of components, trying out new ideas and alternative solutions, etc. Plus it looks really nerdy. I would have never succeeded in getting the scope to work with any other approach. I simulated the sample logic on the computer first, but reality always has a few surprises. Also I love being able to tweak the analog section until the signal path is clean and has the required performance.
The picture below is a fully functional single-channel development version. Looks messy but worked perfectly fine, apart from somewhat higher noise on the signals, and slightly less reliable trigger (because the power supply lines are quite inductive, so the trigger created transients on them). Creating the final schematic was then simply a question of copying the existing circuit piece by piece.
Step 13: Circuit Board Layout
I did schematic capture as well as the layout with the free design tools from ExpressPCB. I find their software easy to use and quite capable (but of course no match for really professional tools in terms of performance); also you get one-stop shopping, no complicated layout file set generation etc. The only hitch is that you can't send the files to any other fab house because they get encoded. Still, for moderate quantities their pricing is reasonable.
To obtain the design files, go to the oscilloscope homepage.
I made the board a two-layer board. A four-layer board would have been much easier to route but
would also be much more expensive. I would not recommend etching and drilling this board yourself, it really isn't worth the effort and would require quite advanced PCB skills - the lines are quite narrow (most are 10mils/0.25mm), there are hundreds of holes and vias, and the two sides would need to be aligned very precisely. I offer the board for sale on my oscilloscope homepage very close to my own cost, in volume pricing this is a much better solution.
The bottom has a flood-filled ground plane for optimum grounding. Still, because there are so
many lines closely together, one must take care to avoid "islands", i.e. patches of supposed
ground fill that in reality do not have any connection to the surrounding ground.
The routing is done in classic fashion, with the top layer carrying all the vertical traces, the bottom
layer all the horizontal traces, with very few exceptions. The power rails are routed using wider
traces to minimize inductance and ohmic drop.
Without exception all the components are through-hole, and all the chips are DIP packaged
(mounted in sockets for easy replacement). This makes the design very easy to assemble even
with moderate soldering skills. It will also allow for inexpensive assembly and wave soldering
should I find a vendor willing to offer it as a completely assembled unit.
The components placement follows largely the logical structure of the design. On the left is the
interface (power and serial) and the power supply regulators. Left in the middle is the sample logic
(four chips), below are the microcontroller and the RS-232 level converter.
The very right side is taken up by the analog frontend (probe connectors, amplifiers, bias DACs,
discrete elements), one channel on the top and one at the bottom.
Left to the frontend is the conversion (ADC) and storage (SRAM) section, with the I/O expander
needed for data readback from the memory chips in the center.
Step 14: Getting Chips for Free
To keep costs to a minimum, you can obtain about half of the chips without paying anything (legally, I'm not talking about robbing your local Radio Shack :-).
How to get free samples: Most semiconductor companies have sample programs - meaning they will send you small quantities of their chips for free! (often you don't even pay for shipping). The exact conditions are different from one vendor to the next, but for a hobbyist it means that you can get most of your chips you need without having to pay for them. The LCS-1M design relies heavily on that to keep costs down. For Microchip, you need a non-generic email address (e.g. not Hotmail) - use your work address or similar, then you can order 4 different types chips (between 3 and 5 of each) twice in each 40-day period - quite generous I think. Maxim has no specific limit on the email address or the number of orders per time span (although they do restrict the number of chips of a single type).
Step 15: Build Your Own - Step by Step
Please look at the design pages for the bill of materials (on the oscilloscope homepage). You will need to obtain free samples from Maxim and Microchip, all the other components are from Jameco (usually have much better prices than other web retailers); if you are living outside the USA and don't want to pay for international shipping, you'll need to find compatible parts from a local retailer; still the Jameco links are useful because they have a downloadable data sheet for each component.
Based on the schematic you could build up the scope on a protoboard, stripboard or veroboard, but it's going to be a lot of wiring work and it is easy to make mistakes - and unless you are an experienced electronics person, troubleshooting a non-working circuit designed by somebody else can be difficult (and no, I can't do the troubleshooting for you :-) Etching your own board based on the published layout may be possible, but line widths are quite narrow (mostly 10 mil / 0.25 mm) and there are hundreds of holes to drill and vias to connect. So in essence, I recommend getting a blank scope board (from the oscilloscope homepage) - after a few repeats I can now put together the full scope in less than two hours and so far every single one worked right away.
In addition you will need:
- A soldering iron (approx. 20 Watts) with reasonably fine tip
- Solder wire
- Flat-nosed pliers (to bend component leads)
- A wire cutter (to cut of component legs)
- A screwdriver
Step 16: Build Your Own Step 1 - Bare Board
Start out with the bare printed circuit board. All components will be mounted on the top side (the side which has the wide silkscreen). The component outlines are labeled with the component designators (like R10, C17, etc.) which correspond to the schematic and the bill of materials. Use those labels to find out which component goes where (alternatively, you could open the layout in ExpressPCB and the schematic in ExpressSCH and double-click on each component to find out its properties).
Make sure the board is clean and free from any dirt or grease (if needed, wipe it with a clean cloth lightly soaked with cleaning alcohol).
Step 17: Build Your Own Step 2 - IC Sockets
Now put in the IC sockets and solder them. I'd recommend first soldering only two pins on diagonally opposed corners of each socket, then check that the socket is still firmly lying flat on the board, and correct if necessary. Once you have soldered more than two pins it is virtually impossible to make changes without specialized desoldering equipment. Also, make sure the notch (indicating pin 1 of the IC) is on the correct side (right side in the picture for all sockets) - the silkscreen outline shows the notch as well.
You may be tempted to omit the sockets and solder the chips directly onto the board to save some money. This is not a really good idea. First, unless you are very careful it is easy to damage the sensitive chips through electrostatic discharges during soldering, or overheat them when you keep the soldering iron on the same location for too long. Using sockets allows you to insert the chips after all the soldering work is done. Second, it is nearly impossible to replace a damaged chip once it is soldered down on its many legs. And after all, nothing says you will never kill the input amplifier by applying too high a voltage, making a repair necessary. (That said, the 100 kOhm resistor at the input in combination with the clamp diodes should provide protection of the several 100 Volts). And after all, those sockets cost very little if you look around a bit, typically 10 - 15 cents per piece.
Step 18: Build Your Own Step 3 - Capacitors
Next are the capacitors. The ceramic capacitors (brown discs in the picture) are easy - they are unpolarized (meaning you can put them in either way) and all have the same value (0.1uF).
More caution is required for the electrolytic capacitors (black cylinders in the pictures). First, there are two different values - 1uF (the group of four placed around the socket on the bottom left side), and 100uF (the other four). Second, those capacitors are polarized - inserting them the wrong way around will destroy them when you power up the scope. The silkscreen indicates the positive side (with a "+"), as is usual practice. Strangely enough, the capacitors themselves have the negative side labeled (with a "-", the vertical gray stripe on the capacitors), so make sure you put them in the right way.
Step 19: Build Your Own Step 4 - Securing Components Before Soldering
We need to avoid having the capacitors fall out again when you flip the board over for soldering. Thus before turning the board over, spread all the component legs apart with your finger, as shown in the picture below. The same technique applies to resistors and other components.
Step 20: Build Your Own Step 5 - Connectors, Voltage Regulators
Now come the connectors - power (left bottom), PC link (left top), and probe (right), as well as the two voltage regulators. Not all of the connectors shown are mandatory:
If you plan to put the board in an enclosure, you can safely omit the black power connector (keeping only the blue power terminal), the phono socket, and the board-mount BNC connectors (not installed in the picture above). Installing the through-hole BNC connectors will prevent you from fitting the board into the intended enclosure, and those connectors are very hard to remove once soldered on.
On the other hand, to keep the scope as a bare unit, you may not need the blue power connector (if you are using a power supply with coaxial plug), and can also omit the three-pin serial header (J_SERIAL).
Step 21: Build Your Own Step 6 - Diodes and LED
Now insert the diodes. Make sure you put them in in the right directions - diodes are polarized, and the circuit won't work if you put them in backwards (see picture for reference - the black ring indicates the negative end). Diodes are also sensitive to excessive heat, so try to solder them quickly and then immediately remove the soldering iron again.
The power indicator LED (light emitting diode) - between the two blue screw terminals - should be placed if you plan to use the scope without enclosure. Otherwise leave this connector open or put in a jumper header (like shown in the picture) so you can later hook up a panel-mounted LED. Again, the LED is polarized so you'll have to insert it the right way around (see "+" label; the LED's "+" pin is the longer one).
Step 22: Build Your Own Step 7 - Resistors
Last but not least, we add the resistors. This is about the most time-consuming task because there are several different values - be careful not to mistake one for another. Each resistor's value is encoded as three rings of different color, plus one ring for tolerance (gold = +/-5%). If you are not familiar with this color coding, have a look at the bill of materials, which shows the color sequence for each value. Alternatively, you can use a multimeter in resistance mode (Ohmmeter) to find out which resistor is which. Resistors are unpolarized, so it does not matter in which orientation you put them in.
Step 23: Build Your Own Step 8 - Component Leads
If you haven't done so, once you are done soldering, clip all the component leads with the wire cutter. Be careful - wear glasses or at least close your eyes when cutting - sometimes those leads can shoot away with quite some force and you don't want them to land in your eyes!
This step is also a good occasion to check every single solder joint and make sure you actually soldered each and every component lead. Double-check all the chip socket leads as well - it is very easy to forget to solder some, which best case makes for an extended troubleshooting session, and worst case could cause damage to the chip when powered up. Also make sure all the solder joints look "good" (shiny and smooth surface - anything else could indicate a "cold" solder joint that does not really make good contact and/or will break open and lose contact in the future). If necessary, re-heat suspicious joints to re-flow the solder.
Step 24: Build Your Own Step 9 - Bare Board Version
Here is the finished scope as a "bare board" version. I added standoffs and board-mount BNC connectors.
The BNC connectors allow to connect standard 1:1 scope probes or coaxial grabber cable (see next page), while alternatively we can connect wires using the screw terminals. Similar for the power connector, here you can choose between a standard 2.1mm power plug (common on many wall-wart type power supplies) and a wire connection (e.g. if you get the power from a breadboard setup).
Step 25: Build Your Own Step 10 - Enclosure
Below we see the scope mounted in a plastic enclosure (top cover removed). Refer to the bill of material for the references of the enclosure. Note that I left out the board-mount BNC connectors and used panel-mount connectors instead. The board-mount BNCs would prevent us from assembling the unit. I also added a panel-mount power indicator LED in front, and power and serial data connectors on the back panel.
To avoid board warping, you either need to file or back-drill the two unused standoffs in the center of the enclosure (approx. below the two MAX153 ADCs) or add washers to the four used standoffs.
Step 26: Build Your Own Step 11 - Firmware Download
Now it is time to burn the scope firmware into the microcontroller. Fortunately the Picaxe microcontroller does not need any fancy programmer - it has a serial bootloader already installed, so we can download the firmware through the serial cable.
First, set the jumper (JP7, see picture) to the download connection, which is marked with "DL". Note that in the picture above it is not in the "DL" position, but at "TX", which is used for normal operation. Simply move it over from there so it bridges the first and second pin.
Connect the power supply to your oscilloscope.
Then connect the serial cable between the oscilloscope and the PC.
If you haven't done so yet, go to the download page on the oscilloscope homepage and download the scope firmware as well as the programming editor. Open the latter and load the firmware file. In the "Option" menu, select "Picaxe 28X1" as the microcontroller type. Also select the correct COM port (usually COM1 if you are using the real serial port, but can be anything if you use the USB-to-serial converter cable). You can check if the software recognizes the scopes microcontroller by pressing the "check firmware" button.
Now download the firmare by choosing "Run" from the menu bar (or press the "Run" button). A download status window should pop up and inform about progress. Download takes less than a minute.
Shortly after the download finished, the scope's power indicator LED should turn on. This is the sign that the microcontroller is now running the scope firmware and is waiting for commands sent through the serial cable from the PC.
After that, move JP7 back to the "TX" (Transmit) position. The scope is now ready for use.
On the PC, launch the scope software. It will auto-detect the scope (as long as the serial port number is between COM1 and COM20).
Step 27: The Complete Deal
Here is the complete setup - scope in the enclosure, with power supply, probes, and data cable.
As for the power supply, anything that produces 9 - 15V DC and can deliver at least 300 mA will do (the scope takes 170 mA, but some headroom never hurts).
The probes are inexpensive coaxial cables with BNC connectors at one end and miniature grabbers on the other. For 150 kHz analog bandwidth you really don't need anything more fancy, and the coaxial cables provide good shielding and low inductance. You could also use standard passive oscilloscope probes, just make sure you set them to 1:1 mode, not 1:10.
The scope in the picture uses a cable that has a built-in USB-to-serial converter - that way I can hook it up to computers that don't have the classic serial (RS-232) port. Those converters come with drivers that make them look like a normal COM port (albeit a virtual one) for the software, so no changes to the scope software are necessary. Still, that solution costs more and does not improve performance otherwise, so I wouldn't go for it unless necessary.
Step 28: PC Software
Shown below is the PC based scope GUI, displaying both scope channels. The software is available for free download from the oscilloscope homepage
You control all functions of the scope from this software: Channel level scaling and offset, timebase, trigger, averaging, etc. I made an effort to keep the layout simple and user friendly, and at the same time fast to operate. You be the judge if I succeeded - different people have different preferences of course. Good suggestions for improvements are always welcome.
You can make measurements on the traces using the cursors (here: amplitude and frequency - see green cursors in the display and status bar at the bottom).
The screen refresh rate is quite acceptable, I get about 7 frames/sec with a single channel turned on, and 4.5 frames/sec with both channels turned on (record length 250 points in both cases). There is a new version of the Picaxe microcontroller announced to be released some time in the future (but not sure when exactly) which will roughly double those numbers - then the display will become really fluent.
Step 29: Spectrum Analyzer Mode & X-Y-Mode
The picture here shows the same waveform as the previous slide (CH1, square wave), but now in real-time frequency display. Great to find resonances and oscillations and to analyze periodic signals. Basically the scope works as a spectrum analyzer, with no extra hardware. The refresh rate is somewhat slower than in normal mode because of the real-time FFT (Fast Fourier Transformation) the computer has to perform after each acquisition. You can display power or voltage, linear or logarithmic scale, and use several different filter methods (e.g. Hamming).
Based on user suggestions I recently also implemented a X-Y display mode. In this mode, channel 1 provides the horizontal deflection, and channel 2 the vertical deflection. This display mode - well known from classic cathode ray oscilloscopes - provides a good way to e.g. check out
reactive components like capacitors and inductors - one channel looking at the voltage across the component, the other one looking at the current. Or feed in two waves of different frequency and enjoy the resulting Lissajous plots. It is usually easiest to set up levels, trigger etc. in normal mode and then switch into X-Y mode. The sample record should comprise at least one full period of the slower signal, a bit more is even better. A screenshot of this mode is shown below (Lissajous plot of two sine wave, one having twice the frequency of the other).
Step 30: Conclusion
Thanks for staying with my explanations through all those many slides! Maybe you are now motivated to try and build your own scope? Even if not, I hope you enjoyed it. Below is my contact address if you have questions, want to give me feedback, have suggestions for improvements, etc.
I also invite you to visit the oscilloscope homepage where you can get all the design files, bill of materials, PC software, scope firmware, etc.
There is also a page where you can order the printed circuit board and/or the pre-programmed microcontroller, a complete self-assembly kit with all components, or even the fully assembled and tested oscilloscope. I really try to keep it hobbyist- and student-friendly, so I'm selling those things pretty much at cost.
We have a be nice policy.
Please be positive and constructive.