I present a "BEST OF CLASS", "Full-Featured" DIY-USB OSCILLOSCOPE which is "Truly DIY".

My aim is to provide a cheap Digital-Storage-Oscilloscope for Students, Budding Engineers and the Hobbyist.

This USB-Oscilloscope could be part of the laboratory equipment in educational establishments.

Build this DIY-Oscilloscope for just $15


Today 21 Nov 2014, my Instructable crossed 100000 Views!

At this Milestone I am happy to share all the source files (C, .Net & Python) at:


I wish to acknowledge the inputs from the following designs which have led to this optimized solution:

DPScope SE - the simplest real oscilloscope/logic analyzer on the planet, by womai, https://www.instructables.com/id/DPScope-SE-the-si...

DPScope - Build Your Own USB/PC-Based Oscilloscope,by womai

LCS-1M - A Full-Featured, Low-Cost Hobby Oscilloscope,by womai


Universal Analog Hardware Testbench, by me

Analog Experiments Anywhere,by me

Two-Channel PC Based Oscilloscope USB, by Gaurav Chaudhary

Responding to comments and suggestions from many members :

I am sharing the micro-controller fuse .Hex file for the dsPIC30F2020.

The Host PC software has been written in both 'Visual Basic.Net' and open source 'Python' providing a cross-platform GUI based solution for both Windows and Linux platforms.

Step 1: Specifications

No of Channels Two
Analog bandwidth (Large Signal), 0.30/0.30/0.70 MHz ,For Gain 1/2/5
Analog bandwidth (Small Signal), 12/6/7 MHz ,For Gain 1/2/5
Input impedance 1 Meg Ohm
Input connection  3 mm Audio Jack
Vertical Scale 
+12.5V to -12.5V , Gain 1
+6.25V to - 6.25V, Gain 2
+2.50V to -2.50V,  Gain 5
 -12.5V to +7.50V ,  Gain 1
 -6.25V to +13.75V, Gain 2
-2.50V to +17.50V,  Gain 5
Sampling Rate  
1 Mbps to 20  Mbps ,1 uses/sample to 0.05usec/sample ,ETS  Mode (repetitive signals)
10bps to 500 kbps, 100ms/sample to 2uses/sample , Normal Mode
Ch1 / Ch2 / Auto

Trigger Polarity
Rising / Falling edge

Trigger Range
+12.5V to -12.5V, Gain 1
+6.25V to - 6.25V, Gain 2
+2.50V to -2.50V,  Gain 5
Display Modes
Ch1 + Ch2  vs. time 200 Samples each
Ch1 vs. time 200 Samples
Ch2 vs. time 200 Samples
XY Ch1 + Ch2 vs. time 200 Samples each
DFT Ch1 400 Samples
DFT Ch2  400 Samples
Capture Modes 
Single / Repeat / Store
Save Modes
Data to CSV Fig to multiple formats
PC Software
VB.Net 2.0  / Python 2.6/2.7 Virtual Com Port 115200 bps
Power Supply
USB +5V , 150 mA
<p>Finally got around to migrating the scope from the breadboard to a protoboard in advance of getting it into an enclosure. I have not done much testing since I do not have a signal generator, but one is on the way. I hacked up a square wave generator on an Arduino for square wave test. This is a great project and I recommend it to anyone wanting to try out PIC programming.</p><p>I used the FTDI cable option that ajoraman recommends.</p><p>Thanks AJ for the great project!<br></p>
<p>Hi all, I recently completed this nifty Scope project and am very satisfied with the outcome.</p><p>With the blessing of Mr Ajoy Raman, I would like to share two &quot;mods&quot; or changes I made, with the hope that others may benefit.</p><p>1. For the FTDI 232 USB , I used a commercial FTDI break-out board. These are nifty little units and very inexpensive on the net..&pound;3.00 or so. (E-bay, Sparkfun etc)</p><p>I have included a stock photo, showing the connections. For our application we only need four pins, +5v, 0V (Gnd), RX and TX. </p><p>It is now very easy to incorporate this little board as a &quot;component&quot; on your PCB layout. (JPG is attached of my PCB layout, from which you can see the general idea.) This then solves the difficulty of soldering directly on a SM chip.</p><p>(Please note here that the photos of my actual board do NOT match the PCB layout 100%...I made changes to the layout afterwards -- once I saw where I could improve the layout. Never happy are we?)</p><p>2. The second &quot;change&quot; I made was to use MCP6S21, instead of MCP6S22 as used by Ajoy....The xxx6S21 is a single channel version, and the xxx6S22 a dual channel version.</p><p>The reason for this is simply because of difficulty I had in sourcing the dual channel in<em> DIP package</em>. The single channel in DIP package I found readily available. No other reason.</p><p><em>BUT please take note:</em> When using MCP6S21 (single channel), that Pin 3 on this chip is a V ref input, and for our application needs to be tied to GND. On my PCB layout you will observe pin 3 and 4 joined together to GND respectively.</p><p>(On the MCP6S22, Pin 3, is isolated and not connected to anything).</p><p>Don't forget the heatsink..On my PCB layout I have allowed for two mounting holes on the ends of the PIC, offset a little bit toward the MCP's. This allows the heatsink to &quot;pull down&quot; on the MCP's <em>a little</em>, so that the heatsink don't rock on the PIC....</p><p>I tested the working of my unit on a simple 555 astable, adjustable over a wide range by trimpot. Brilliant results..</p><p>Finally I built the whole unit into a plastic case, job done.</p><p>Hope this is of some insight to others..</p><p>Jan</p><p> </p><p> </p><p> </p>
<p>Dear JanRose!</p><p>Do you made this board with eagle?</p><p>Do you have the pcb and sch file?</p><p>Can you share with me?</p><p>Thanks:</p><p>Norbert </p>
<p>Thank You JanRose for this extremely simple implementation of the USB Scope!</p>
<p>I made another version with the TMSF28027 which is also a good chip to use. It has the advantage of not needing a dedicated programmer and can be programmed using a freeware using the serial port. Also we can go to 2Mbps simultaneous sampling.</p><p>Check out: <a href="http://e2e.ti.com/group/launchyourdesign/m/c2000microcontrollerprojects/665559">http://e2e.ti.com/group/launchyourdesign/m/c2000mi...</a></p><p>and <a href="http://ajoyraman.in/My_USB_Student_Scope.html">http://ajoyraman.in/My_USB_Student_Scope.html</a></p>
<p>Hello again!</p><p>It happens, that I have Ti Launchpad Stellaris on my hands. You have project version that is addon for Launchpad Piccolo. What would be Your verdict, can Your addon be used on Stellaris Launchpad easily? Thank You!</p>
<p>The add-on is basically two spi controlled pga's and as the booster-pack configurations are usually the same it should work. However, I do not recommend working with the Stellaris Launchpad as it is not supported by TI now. Also the C2000 had a 2Msps Simultaneous sampling ADC which is not seen on the Stellaris LM4F120 (Tiva TM4C1233H6PM) datasheet. If you plan to experiment I could share the c and vb code.</p>
<p>Thank You for answering! No need for source codes for me, I am kinda bad at programming (but I am educated electronics engineer, and hobbyist :) ). I will probably buy C2000 Piccolo at some point. Or... maybe I should ask, is there any plans for new iteration of Your scopes? If I was smarter than I actually am, I would make scope out of &quot;LPC-Link 2&quot; (LPC4370 tripple core, ADC, 80Msample/sec), it is not expensive. But, suggested scope add-on &quot;LabTool&quot; is complicated and expensive. Someone should make simpler alternative :)</p>
<p>Hello! Thanks for sharing Your projects! Does &quot;Student Scope&quot; work with the same GUI software?<br>Also, link to RS Online Design Spark is dead, so it seems.<br>Best wishes! :)</p>
<p>I have built the circuit and when i program the pic with my Pickit 2 i receive a warning, </p><p>&quot;Some configurations words not in hex file. Ensure defaults values above right are acceptable&quot;</p><p>Do i have to do something?</p><p>I continue and program the pic with success. </p><p>Also when i power it on, i connect both BNC cables signal to ground and i am getting a measure +1.57V in both channels. Otherwise (not connected) the measure is +4V. Is that correct? Do i have to remove it from the offset? Is there any calibration method?</p><p>I haven't test it yet.</p><p>Thank you!</p>
If you are getting the trace on the GUI your programming should be good.<br><br>With the probe grounded we should get Zero and ~3 V when open.<br><br>Change R6 150 Ohms to something between 15 to 47 Ohms (5V to Pin 28 AVDD Resistor) and check<br><br>
<p>From Pickit 2, the hex's configuration bits are</p><p>FBS 000F</p><p>FSS 0000</p><p>FGS 0007</p><p>FOSCSEL 0003</p><p>FOSC 00E2</p><p>FWDT 005F</p><p>FPOR 0000</p><p>FICD 0083</p><p>Are they correct?</p>
<p>I bread boarded the oscope and it worked great. Now all of the sudden when I select a com port it times out. I know I am on the right port because I see the FTDI chip in device manager. Can you help me with what to look at? Thanks</p>
Usually on a bread-board that the crystal and its capacitors are too far from the IC crystal-osc pins. Therefore it may not be oscillating or oscillating at a wrong frequency.<br><br>If the programming is OK and the Oscillation is correct only then will the communication take place at the correct baud rate.<br><br>When you select connect to com port you should get a response 'Aj Scope Ready' and not 'Time Out'. <br><br>As a hardware check that the clock frequency is OK and hence the correct baud-rate is being set-up: <br>On power up check the frequency at OC1 and OC2 outputs they should show a PWM waveform of 31.1kHz with 50% duty cycle. <br><br>Also independently check the loop-back of the Rx/Tx pins on the FTDI chip and make sure that you have set the jumper for 5V operation and that the RxTx are cross-connected to the TxRx of the PIC.
<p>&quot;Analog bandwidth (Large Signal), 0.30/0.30/0.70 MHz ,For Gain 1/2/5<br> Analog bandwidth (Small Signal), 12/6/7 MHz ,For Gain 1/2/5&quot;</p><p>What do you mean, Large Signal or Small Signal ?</p><p>Thank you!</p><p>Vasilis</p>
If we look at signal-amplitude with respect to the slew-rate of the analog front end and consider 1/10 of max-amplitude as small-signal and 9/10 of max-amplitude as large-signal then there is a difference in the bandwidths for these signals. The large-signal is slew limited and so shows a lower bandwidth compared to the small-signal case.
<p>Thank you for the answer. </p><p>Is there, approximately, a value for this signal ?</p><p>Can you give me an example with values ?</p>
<p>Hi.<br>Is it possible to use this oscilloscope to analyze other circuits like switched<br>power supply (all the sub blocks)? My concern is regarding the voltage range that it support and if it<br>support sampling the frequencies that switched power supply pwms usually operates</p>
<p>Setting Gain 1 with a 1:10 probe should give you +/- 125 V. And we can see waveforms up to 40-50 kHz. You need to be careful by providing isolation between the PC-scope and circuit-under-test. </p><p>Here is a snapshot of a test I just now carried out on a Mobile Phone Charger the waveform is -40V to +160V at a sampling rate of 2us/sample (500kHz). The waveform repeats at ~7kHz and the ringing waveform is ~60-70kHz.</p><p>The setup, waveform &amp; spectrum are shown. (zero line is the blue trace)</p>
<p>This is my DIY Universal PIC and AVR programmer that can be cheaply made. I have flashed the dsPIC30F2020 microcontroller in this programmer. I am recommending this to every electronic hobbyists.</p><p>https://www.instructables.com/id/DIY-UNIVERSAL-PIC-AND-AVR-PROGRAMMER/</p>
<p>I have completed this wonderful project recently, thankx to Ajoy Raman for his best support.</p><p>I made it as two parts:</p><p> 1.The main controller unit with PGA.</p><p> 2. FT232- USB to serial interface. </p><p>Both the PCB's are designed by me in eagle. </p><p>Major Steps:</p><p>1. I programmed the dsPIC micro-controller with my best custom made and DIY programmer. I will post the programmer in instructable soon.</p><p>2. I made the probes with RCA connectors (used in TV connectors) and sheild wires, which are cheap and effective.</p><p>3. I designed the FT232 board which brings down the cost.</p><p>4. Heat sink is important and I stick the micro-controller with a thermal glue.</p>
<p>Great work Asish! Should be an inspiration to DIY enthusiasts in India. Add a picture when you put in an enclosure.</p>
<p>Hi Ajoy</p><p>Thanks for sharing and documenting so well your project. This truly non-profit DIY Scope would be an invaluable tool for anyone on a limited budget!</p><p>Question:</p><p>Can I add AC coupling mode to circuit? 100~150nF in series capacitor for each channel would be a good choice?</p>
<p>Thanks! Yes AC coupling works. We need to set the offset so that the trace is at zero with the probe open. ( Approx -2.5V/-1.5V/-0.9V for the Channel gains 1/2/5). A 15nF coupling capacitor gives a HPF of ~10Hz and the 150nF you suggest would give a HPF of ~1Hz with the 1MOhm impedance of the scope.</p>
<p>sir i have a doubt, why use a PGA when you can simply multiply the values acquired via the sampling process by any number in the gui itself? is it not like a zoom in and zoom out effect?</p>
Hi maxwell_30! Depending on the resolution of the ADC one can consider multiplication &amp; offset addition in the GUI. If we work with 18-24 bit ADCs this could be feasible. However, at 8 bit where we have 256 levels multiplication X2 would reduce this to 128 levels &amp; X4 to just 64 levels. The quatization noise would be unacceptable. 8 bit is probably the minimum we should have for the ADC. The PGA implements the gain change in the analog domain so that the ADC always operates at 8 bit.
<p>oh yes!! i get it now :) Sir i just want to confirm one more thing, if the i/p at the channel of PGA is 5 V and the gain selected is 2, then the output will be 5 V only and not 10 V as the opamp is working on a dc voltage of 5V so that is the maximum output it can provide, right? I just want to ensure that i wont damage my microcontroller..</p>
<p>You are correct, with 5V as the supply voltage for the PGA the output can be a maximum of 5V which is within the ADC range of the microcontroller.</p>
<p>and sir how exactly is Vref compensating for ADC scale-factor change with variation in VDD? I am unable to understand that :/</p>
<p>VDD the USB 5V is used as the ADC Vref. The software assumes a ADC Vref of 5V and should ideally measure the 3.3V ref as 3.3V. Usually the USB 5V is less than 5V and the ADC would read the 3.3V as a higher value. This difference can be used to compensate the scale factor.</p>
<p>okay..so basically you are finding out the voltage actually being supplied to the circuit by doing reverse conversion of the digital value you get when you convert 3.3 V (i.e. we know on passing an analog voltage x through an ADC we get the digital value y=x*(Vref/1024) and x is 3.3 v here and y we get from the conversion and from these 2 we find out vref ) and then using that value for all the other conversions of ch1 and 2 while finiding analog values to be sketched in the gui again, right?</p><p>And if i understood the above thing correctly, I have another doubt...why convert the vref on both the channels 2 &amp; 3 when simply converting it on any one can do the job?</p>
<p>I found a minor hardware bug where the first ADC conversion is sometimes incorrect. To overcome this and also to reduce any noise the 2 reference channels are read twice and averaged.</p>
<p>Sir, i am finally done writing the code for a matlab based gui, and now i am trying to test the entire circuit on a<strong> breadboard</strong>. But i am facing a serious issue, because of which i am unable to proceed. As soon as i try to power the breadboard circuit via the 5 V of the FT232 breakout board, the voltage drops to 3.6 V (which i am guessing is because of the loading effect). As a result, the microcontroller dosen't power up and i receive no response on the GUI. </p><p>Can u please suggest me something to deal with this? Did u not face any such issue while testing the circuit on a breadboard or is it that i should test the circuit directly on a pcb or am i going wrong somewhere in my procedure to test a circuit with so many wires on a breadboad?</p>
<p>Check the cable from the USB port to the FT232 breakout it should be as short as possible or of higher wire gauge. Next there may be a resistor which is dropping the voltage within the module. Keep all the 5V and return wires short and thick</p>
Okay. Thank u :)
<p>Hi Ajoy,</p><p>I just started your project. First I designed a stripboard version for pcb. </p>
<p>Hello Nardu, The stripboard scheme is something new for me. Is there a design software for this? Could help with further prototyping. I have updated the card firmware and windows software: https://sites.google.com/site/ramanajoy/home/my-zip-rar-files/Scope2.rar?attredirects=0&amp;d=1 Regards, Ajoy</p>
<p>Hello Ajoy,<br>1. For stripboard design, personal I prefer Lochmaster :<br>http://www.abacom-online.de/uk/html/lochmaster.html<br>2. Any time, no problem. There are some limitation with SMD components,<br>but we try.</p>
<p>Dear Raman, </p><p>As per your requirement you can download the Stripboard design software from the following address.</p><p><a href="http://veecad.com/downloads.html" rel="nofollow">http://veecad.com/downloads.html</a></p><p>Regards, Vikas</p>
Hello Ajoy, I have nearly all of the parts I need for this project except the electrolytic capacitors which I will buy tomorrow. My question is about programming the dsPIC chip. I see you mention you use a PICKit but even the clones available are expensive in comparison to the project itself (at least they are in the UK). I notice from the dsPIC datasheet, it has an ICSP (In Circuit Serial Programming) option but I can't find details of how to use it. It simply needs power to the chip then uses the MCLR pin to clear the flash memory (I think) then the PGC (program clock) and PGD (program data) pins. I assume I would provide a steady square wave clock to PGC and toggle PGD between 1 &amp; 0 to send the program in serial form. Do you know anything further to clarify this? Is it possible to program the dsPIC with your software in this way? Many thanks. Brian
Hi Brian,<br><br>The dsPic needs a dedicated programmer. The external programmers use the ICSP interface. Check around for any technical schools hobbyists in your area for assistance in programming the chip.<br><br>I have updated the card firmware and windows software:<br>https://sites.google.com/site/ramanajoy/home/my-zip-rar-files/Scope2.rar?attredirects=0&amp;d=1<br>Regards, Ajoy
<p>Hi Ajoy,<br><br>I was hoping I could develop a programmer using an ESP8266 module I have. I can easily programme the ESP's GPIO pins to switch for PGD, PGC and MCLR although it works at 3.3V so I'd need a few extra components to switch for 5V. The ESP module came with a daughterboard with a CH340G USB/UART chip so I can talk to it from my Linux PC using ESPlorer in order to program it. I also intended using the daughterboard in place of the FT232R section of your circuit. I just need to work out timing and serial data format for PDC / PGC of the PIC. I think I've found some useful web pages which may help - I think I can make it work. Thanks for the link to the updated firmware and software.<br><br>Regards, Brian</p>
<p>If this works it would benefit several others who would then be able to manage without a dedicated programmer. Wish you all success in your efforts!</p>
<p>Hi Ajoy, I have found a document called &quot;dsPIC30F SMPS Flash Programming Specification&quot; (link http://ww1.microchip.com/downloads/en/DeviceDoc/70284C.pdf ). It seems to explain ICSP programming in detail as well as explaining the HEX file format and how to read the file to then write it to the dsPIC flash memory. A lot to read but it looks encouraging for my ESP8266 based programmer idea. Regards, Brian</p>
<p>Dear Ajoy, </p><p>Came across your fascinating project and am in the process of having a go.</p><p>When it comes to the FT232 USB to UART circuit, I would like to bring to your and the readers attention that you can buy on e-bay a small circuit board , &quot;FTDI 232&quot;, </p><p>used for programming the Arduino Nano. I have one of these boards, and can verify that it conforms 100% to your circuit.</p><p><a href="http://www.ebay.co.uk/itm/131730908119?_trksid=p2055119.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT" rel="nofollow">http://www.ebay.co.uk/itm/131730908119?_trksid=p2055119.m1438.l2649&amp;ssPageName=STRK%3AMEBIDX%3AIT</a></p><p>Now what makes this board very useful is that it is mounted on a pcb with easy to wire pins. It then also comes with a USB Mini socket, ready mounted.</p><p>I hope this is of help to others.</p><p>Jan</p>
Dear JanRose,<br><br>Thanks for your suggestion!<br>A hobbyist sent me this picture of the USB Scope built as you have suggested. By using a USB-TTL (5V Levels) small circuit board and fabricating the main board using non smd components using the PCB design from HeartygFx. Also the PCB was fabricated as a single side version with a few jumpers. This method would be the easiest for fabrication and soldering ease.
<p>sir how are u getting the analog B.W. to be 0.3 MHz? According to me, as the maximum tx rate supported by uart is 115200 bps and adc used it a 10 bit adc, so each sample requires 10 bits. Thus, the actual tx rate will be 115200/10=11.5 ksps. Now by nyquist criteria the max freq that we can sample with this sampling rate will be around 11.5/2=5.75 Khz only :/ </p>
<p>There are two bit/sampling rates we need to look at. 200 samples of CH1 &amp; Ch2 analog data are sampled at rates up to 1 mega-sample-per-sec using the normal modes. These 200+200 data samples are then then transferred to the PC using the USB-Serial converter at 115200 bps. </p>
<p>oh okay! thanks for the quick reply sir :)</p>
<p>Hello, good job!</p><p>Can you recommend another micro controller that I can use instead of dsPIC30F2020?</p>

About This Instructable




Bio: I am a retired Electronic Systems Engineer now pursuing my hobbies full time. I share what I do especially with the world wide student community.
More by ajoyraman:COMMUTATOR BASED DIRECTION INDICATOR Z Fold Display Board Standee Current Pulsing Keeps Power Bank Active 
Add instructable to: