DIY USB-Oscilloscope in a matchbox

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

I wish to acknowledge the inputs from the following designs which have led to this optimized solution:
DIY USB-Oscilloscope in a matchbox

DPScope SE – the simplest real oscilloscope/logic analyzer on the planet, by womai,

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

Step 2: Block Schematic and Function Description

Figure 1 shows the simplified block schematic of the system.

For ease of portability the unit is powered and controlled from the USB port of a PC.

The configuration is optimized so that only five integrated circuits all operating on a single +5V supply are required to provide the full functionality of this Digital Storage Oscilloscope.

The FT232R from FDTI is a USB to serial UART interface with advanced features providing:

• A single chip USB to asynchronous serial data transfer interface.
• With the entire USB protocol handled on the chip.
• A fully integrated 1024 bit EEPROM storing device descriptors and CBUS I/O configuration.
• With fully integrated USB termination resistors.
• A fully integrated clock generation with no external crystal required
• Output selection enabling glue-less interface to external MCU or FPGA.
• And data transfer rates from 300 baud to 3 Mega baud

This chip provides a minimum component count USB-Serial interface and is used to communicate with the host PC for enumeration as a USB to UART device setting up the Aj_Scope2 as a 200mA device and acts as the USB communication interface.

The MCP6S22 devices are digitally controlled Programmable Gain Amplifiers (PGA) with high bandwidth and high input impedance controlled through a Serial-Peripheral-Interface (SPI). These devices provide the input interface between the dsPIC18F14K50 and dsPIC30F2020 and the external analog signals being monitored.

The dsPIC30F2020 micro-controller implements the main Oscilloscope Functions.

• Analog to Digital conversion of the CH1 and CH2 signal conditioned inputs at the required sampling rates
• Trigger interrupt handling
• Responding to serial commands from PC and sending back the acquired data.
• A  Busy signal is  also generated

The dsPIC30F2020 micro-controller is ideally suited to this task as it permits simultaneous 2-channel A/D conversion at rates up to 1Msps, has internal comparators which can handle the trigger functionality, provide PWM outputs which are used to set the input offset voltages and a SPI interface for controlling the PGAs.

A LM1117 3.3V regulator provides a Voltage reference which is used to compensate for the gain changes with varying USB +5V.

Step 3: Software on the PC Host

Both Microsoft Windows and Linux based GUI software have been developed to interface with the Aj_Scope2 via the USB port of a PC.

Visual Basic .Net Microsoft Windows Application Code

A Visual Basic .Net 2.0 based GUI program is used to control the functions of the Aj_Scope2.

The Aj_Scope.exe along with associated ZedGraph.dll and FTDI USB driver files have been tested for compatibility with Windows XP and Windows 7 with .Net 2.0.

* The FDTI VCP drivers can be downloaded from‎

Open Source Python Cross-Platform Application Code

Alternatively a Python based GUI program can be used to control the functions of the Aj_Scope2.

The  Aj_Scope.pyc python executable bit code provides a cross-platform application which has been tested using Python 2.7 on Windows XP and Windows 7 and on Debian 6.0 (“squeeze”)  and Debian 7.0 (“wheezy”) using Python 2.6 and Python 2.7 respectively.

The Python installation requires the following packages:
Tkinter, ttk, serial, glob, math, time, csv, numpy and matplotlib

*On Linux systems appropriate ‘chmod’ commands need to be executed as root for giving users permission to access the VCP port which is typically /dev/ttyUSB0


For more detail: DIY USB-Oscilloscope in a matchbox

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us: