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,

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

Picture of 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

Picture of 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

Picture of 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

Step 4: GUI VB.Net 2.0

Picture of GUI VB.Net 2.0
The GUI based Windows software on the Host PC permits checking for available COM ports and connecting to the port on which the hardware is connected. Once connected the hardware unit responds with a ready signal.

Display and trigger modes, sampling rate, channel gains, channel offset trigger offset and number of samples can be set using the simple controls.

The RUN button initiates the signal capture single, repetitive or over-plotted.

Initially signals can be acquired in auto / single mode after with suitable changes can be made in the gain and offsets and a trigger level set. Repeat mode can now be used for continuous display of the signals. Display of Ch1/Ch2 is possible with trigger by either Ch1 or Ch2.

Finally an EXIT button is provided to close the program and exit.

Figure 3, Shows the VB.Net 2.0 based GUI

Figure 4, Shows the Mouse cursor data display

Figure 5, Shows the Image zoom, copy, print and save modes

Figure 6, Shows the Plot in EXCEL based on saved data

Figure 7, Shows the Spectrum Display

Step 5: GUI Software on Debian Linux "Lenny"

Picture of GUI Software on Debian Linux "Lenny"
The Python based GUI software runs on Windows Python or on Linux Systems. The following GUI screens were captured with  the Python software running on Debian 'Lenny':

Figure 8, GUI Python

Figure 9, Cursor Display

Figure 10 Image zoom, pan and save modes  provided by the Python Tkinter Toolbar.

Figure 11, Plot in Debian Gnumeric based on saved .csv data

Figure 12, XY Plot

Figure 13, DFT Spectrum Plot

Step 6: The Aj_Scope2 Unit

Picture of The Aj_Scope2  Unit

In order to economize on the cost of an enclosure while still providing an aesthetic unit the Aj_Scope2 is enclosed in a large size cardboard matchbox enclosure.

The USB connection to the PC is on one end while the Audio-Jack for the signals to be monitored is on the other.

A ‘Busy’ LED is provided on one corner at the top and a ‘Reset’ switch is provided diagonally opposite.

The ‘Reset’ switch provides a restart of the micro-controller is the worst-case of hang-up. This typically occurs when the operator selects a trigger threshold which is out of limits with respect to the waveform being observed. If the Aj_Scope2 is operated correctly this switch is seldom used.

Step 7: Circuit Diagrams 1: USB Interface

Picture of Circuit Diagrams 1: USB Interface

Figure 15, Shows the USB Interface.

The FDTI FT232R forms a single chip minimum component count interface between the PC USB port and the micro-controller serial-link Rx-Data and Tx-Data pins. As all the circuitry in self contained only one capacitor C8 needs to be added for the 3.3V generation.

Power to the rest of the circuitry is fed from the USB connector.

On connection to the PC USB port , the device is enumerated as a Virtual Com Port (VCP) and the corresponding drivers are loaded by the OS. As the Aj_Scope2 draws approximately 150mA the device has been programmed to indicate a 200mA device.

Step 8: Circuit Diagrams 2: Analog Interface

Picture of Circuit Diagrams 2: Analog Interface

Figure 16, Shows the Analog Input Interface for Ch1 (this is duplicated for Ch2)

An input potential divider with a ratio 4:1 is formed by resistors R2: (R3+R7+R8+R9), 820k: 205k. The input impedance of this divider is therefore 1.025 Meg Ohm. Capacitors C9 and C10 are added so as to compensate for any input capacitance of the MCP6S22.

OC1 a PWM output of the micro-controller is filtered in two stages by R9/C15 and R8/C14 and produces a DC offset voltage at the junction of R7/R8 based on the duty cycle of the PWM. This offset voltage is initialized to produce a fixed VDD/2 voltage at the output of the MCP6S22 which is then changed by the Ch1 offset voltage slider around this value. The PWM voltage is suitably adjusted for different gain settings.

The MCP6S22 is connected to the micro-controller through an SPI interface in order to setup the gain values 1/2/5.

VOUT at Pin 1 of the MCP6S22 is fed as an analog input to the microcontroller within a working range 0-VDD. This output is potential divided by 2 using R1/R4 and fed as an input to the internal comparator CMP3 of the microcontroller. This voltage is used for the trigger function.

Step 9: Circuit Diagrams 3: Processor Circuit

Picture of Circuit Diagrams 3: Processor Circuit

Figure 16a, Shows the Processor Circuit

The dsPic30F2020 is powered from the USB bus.

A reset switch is provided at the MCLR pin.

A 16MHz crystal is connected across OSC1/OSC2 and sets up the processor clock.

RE0 to RE3 form the SPI interface to the two PGAs.

OC1 and OC2 for the PWM signals setting the offset voltages for Ch1 and Ch2. U1ARX and U1ATX are connected to the USB to Serial converter FT232R.

A Vref of 3.3V is connected to the analog inputs AN2/AN3 and is used to compensate for ADC scale-factor change with variation in VDD.

Finally the PGA outputs are connected to AN0/AN1 and CMP3A/CMP3B.

Under software control the microcontroller A/D converts the Ch1/Ch2 inputs at fixed intervals and stores them in internal memory before transferring them to the host PC.

When not in auto mode the start of the conversion sequence is determined by comparing an internally generated trigger reference voltage with the voltages at CMP3A/CMP3B.

LED D1 flashes during the initialization and acquisition process indicating that the processor is busy. No commands are initiated during this phase.

Figure 17 shows the overall circuit.

Step 10: Bill of Materials

Picture of Bill of Materials

The USB Oscilloscope is a highly optimized design and uses only five Integrated circuits to achieve the total functionality.

U4 the dsPic30F2020  is the micro-controller

U3 & U5  are the Programmable gain amplifiers MCP6S22

U2 is the USB to serial converter FT232R

and U1 is a 3.3 V , LM1117 regulator used as a voltage reference 

42 other components make up the connectors , switch and passive components.

The overall cost of the BOM is 940  Indian Rupees or an equivalent of $ 15.

Step 11: Double Sided PCB "HOW-TO"

Picture of Double Sided PCB "HOW-TO"
Follow this procedure to fabricate the double sided PCB  using the toner transfer method. 

1. In fabricating the double sided PCB by the toner transfer method the top of the CAD layout needs to be mirrored. Print the files on A4 size on Photo-paper and use it to iron on the toner to the copper clad sheet.

2. The trick in alignment is take a print of top or bottom on normal paper, cut the paper to the approximate size of the PCB and use this as a template to drill the four (paper pin diameter) locating holes at the center of mounting holes in the copper clad sheet.

3. Use the TOP+BOT file to check your placement

4. Now pierce 4 paper-pins through the TOP print and pass through the 4 holes in the copper clad sheet, this aligns the Top.

5 .Pierce the BOT 4 mounting holes and then exactly place them on the 4 pins which are jutting out of the bottom side of the copper clad sheet.

6. Now flatten everything and then stick the paper edges with 3M tape.

7. Remove the pins and proceed with the toner transfer ironing.

8. Two tricks

a) Do the ironing between a few folds of newspaper

b) To save on photo-paper first print on normal paper, stick slightly larger than PCB size piece of photo paper  over the area where the PCB was printed and feed the same paper back into the laser printer.
9. Soak the ironed PCB in water for some time and gently peel off the paper.

10. Gently rub off any paper sticking on the copper sheet.

11. Etch with a Ferric-Chloride solution.

12. Drill the component holes and then clean out the toner from the card.

The double sided PCB used in this Instrructable has been prepared using this method.

The Hole registration was good. 

Figure 18, shows the component layout and Fig 19, the wired PCB.

Step 12: Construction

Picture of Construction
In order to be a 'Truly-DIY' Instructable a work around is presented to handle the FT232R device which comes in a 28 Pin SSOP package.

Step 1 & Step 2 show that  the double sided PCB  track widths are suited for the 'Toner-Transfer' method of PCB fabrication.

However, to handle the 28 Pin SSOP package a larger artificial footprint has been created and only the 12 pins which are required for the operation of the chip are extended carefully using thin copper wire to the pads of this artificial footprint. This is relatively easy to do while wearing spectacles with a +ive power or using a magnifying glass.
Step 3

As this is a DIY double sided PCB there are no plated through holes. It is necessary to connect the thru-hole-vias by soldering a through wire on  both sides.

Step 4
In this step the IC bases and connectors are soldered on the PCB.

It is necessary to check that pads on the top layer are soldered on top and if necessary at the bottom also in order to handle the non availability of plated through holes for component pins.

Additionally some pads for the connectors on the top layer are inaccessible because they are covered by the connector body. In this case small holes need to be drilled near these pins and the pad  connection  extended to the bottom by soldering a thin copper wire through the board. This needs to be done carefully so as not to create any accidental connection to neighboring tracks.

A thin piece of paper or any insulating material needs to be placed under the USB connector so that the body does not short with tracks on the top of the board.
Step 5
Soldering  the passive components and insert the ICs. 

Note how the MCP6S22 which comes in a Small 8-pin MSOP Package is handled.

In this case cut pieces from the other component leads are inserted into the base and soldered carefully  to the MCP6S22 pins. This helps in taking care of these devices which come both in the Small 8-pin MSOP Package or the 8-pin DIP package.
Step 6

Conformal Coating
If the dsPIC30F2020 has been programmed with the .Hex fuse file and the pads checked once more for proper soldering on both sides wherever necessary, the circuit can be powered up and checked for operation. 

Once the basic operation is checked along with the Host PC loaded with appropriate Windows/Linux software the  board needs to be cleaned of excess solder flux using ISO-Propyl Alcohol or Spirit and dried.

After covering the IC base locations with insulating tape the board is sprayed on both sides with a conformal coating for protection.
Step 7,8 & 9
Assembling inside the Matchbox Inner Cardboard Container. Sliding into the outer cover and sticking the legs.

Holes need to be cut for the connectors and reset switch using a sharp knife  and the board carefully fitted into the inner cardboard container of the matchbox.

Next, this can be slid into the outer cover with a hole for the LED and legs stuck onto the bottom
Step 10
Are we now ready ? No !

While practically operating the system it was noticed that the dsPIC30F2020 runs hot to the touch. This is particularly so because of operating at a clock frequency just outside specifications, the enclosure and when the USB 5V is slightly on the 5+ side. 

This could lead to intermittent communication between the PIC and Host PC.

A  heat-sink  is added to eliminate this problem.
Step 11 & 12
The heat sink uses 0.8 mm aluminum fabricated with openings for the taller components.

The reset switch is turned to the vertical position.

Heat sink compound is added over the processor IC.

And the heat sink plate fixed using the screws through the mounting holes.

This compound unit is now fitted back into the inner cardboard and slid into the top cover.

We are done and the DIY-USB-Oscilloscope is ready to use.

Step 13: Software and Documentation

Picture of Software and Documentation
The Scope2.rar file contains the technical documentation and software required for this Instructable.

Folder dsPIC30F2020 contains the fuse .Hex file

Folder  Python contains the Python V2.6 and V2.7 .pyc files to be used with Debian 'Lenny"/'Wheezy'

Folder  Visual Basic contains the Visual Basic .NET 2.0 executive and associated files

Aj_Scope2_Tech-Manual.pdf  is the Technical Manual V 1.0

email any feedback to

visit my website for other projects

Step 14: Important

Picture of Important

Integrated Circuits

The Integrated Circuits were sourced from element14 as per the following details

Manufacturer: FTDI
Order Code: 1146032
Manufacturer Part No: FT232RL

Manufacturer: MICROCHIP
Order Code: 1439475
Manufacturer Part No: MCP6S22-I/SN

Manufacturer: MICROCHIP
Order Code: 1297281
Manufacturer Part No: DSPIC30F2020-30I/SP

Order Code: 2148396
Manufacturer Part No: LM1117MPX-3.3/NOPB.


Warning & Disclaimer:

All content provided here is for informational purposes only. I  make no representations as to the accuracy or completeness of any information. I will not be liable for any errors or omissions in this information. I will not be liable for any losses, injuries, or damages from the display or use of this information including software.


DominikP13 (author)2017-10-22


Please to pcb to me email


hackerh (author)2017-08-20


Thank you Mr. ajoyraman

Is it possible to give me an example of this is a small program showing the action of ADC fast to take the sample of 200KHZ

This email is


hackerh (author)2017-08-20


I have a query to make it possible to create Oscilloscope By Arduino UNO and have a fast analogRead can read the signal with high speed for 200KHZ.

If possible, it helps me to accomplish it

This email is


ajoyraman (author)hackerh2017-08-20

Dear Hackerh,

Yes it should be possible to get a sampling rate of 200 kHz for a one channel oscilloscope. You would need to setup a timer interrupt at the desired rate and carry out A/D conversion on each interrupt. Save say 250 to 400 sample values and them read them out and display them.

I have worked with the PIC in 'c' and the source code and methodology is shared please go through this.

Happy programming!

Ajoy Raman

ajoyraman (author)2016-03-01

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.

Check out:


0joze0 (author)ajoyraman2017-08-17

Dear Ajoyraman, thank you for sharing this project.

I want to build your oscilloscope with 28027 MCU. As I am not good with MCUs, can u send some link of hardware proggramer circuit (serial), free software to use with it and which 2807 MCU pins are used to program with serial programmer. ( in datasheet are named for JTAG....tck, tdo,tms,tdi,trst)

I have made hardware for PIC mcu, but there are pins- mclr,pgc,pgd,..

thank for your kindness,


ajoyraman (author)0joze02017-08-17

Dear Joe,

Thank you for your mail.
Kindly consider using this launchpad from TI.
The programmer is built into the launchpad.

This would be a good starting point in working with the TMS28027 processor.

Ti has also provided a free IDE (downloadable as well as Cloud based) with a lot of examples.


JurisP1 (author)ajoyraman2017-01-25

Hello again!

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!

ajoyraman (author)JurisP12017-01-25

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.

JurisP1 (author)ajoyraman2017-01-25

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 "LPC-Link 2" (LPC4370 tripple core, ADC, 80Msample/sec), it is not expensive. But, suggested scope add-on "LabTool" is complicated and expensive. Someone should make simpler alternative :)

JurisP1 (author)ajoyraman2016-10-28

Hello! Thanks for sharing Your projects! Does "Student Scope" work with the same GUI software?
Also, link to RS Online Design Spark is dead, so it seems.
Best wishes! :)

Pcman123 (author)2017-03-14

Very good i like Scope. but i'm lazy to do this..haha.. and because of this i get Hantek Usb oscilloscope, i think this is best Best USB oscilloscope for his price. But bravo to the invention.

grtyvr made it! (author)2017-02-06

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.

I used the FTDI cable option that ajoraman recommends.

Thanks AJ for the great project!

JanRose made it! (author)2016-04-14

Hi all, I recently completed this nifty Scope project and am very satisfied with the outcome.

With the blessing of Mr Ajoy Raman, I would like to share two "mods" or changes I made, with the hope that others may benefit.

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..£3.00 or so. (E-bay, Sparkfun etc)

I have included a stock photo, showing the connections. For our application we only need four pins, +5v, 0V (Gnd), RX and TX.

It is now very easy to incorporate this little board as a "component" 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.

(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?)

2. The second "change" 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.

The reason for this is simply because of difficulty I had in sourcing the dual channel in DIP package. The single channel in DIP package I found readily available. No other reason.

BUT please take note: 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.

(On the MCP6S22, Pin 3, is isolated and not connected to anything).

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 "pull down" on the MCP's a little, so that the heatsink don't rock on the PIC....

I tested the working of my unit on a simple 555 astable, adjustable over a wide range by trimpot. Brilliant results..

Finally I built the whole unit into a plastic case, job done.

Hope this is of some insight to others..


gnoris (author)JanRose2017-02-05

Dear JanRose!

Do you made this board with eagle?

Do you have the pcb and sch file?

Can you share with me?



ajoyraman (author)JanRose2016-04-15

Thank You JanRose for this extremely simple implementation of the USB Scope!

billakis (author)2017-01-06

I have built the circuit and when i program the pic with my Pickit 2 i receive a warning,

"Some configurations words not in hex file. Ensure defaults values above right are acceptable"

Do i have to do something?

I continue and program the pic with success.

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?

I haven't test it yet.

Thank you!

ajoyraman (author)billakis2017-01-06

If you are getting the trace on the GUI your programming should be good.

With the probe grounded we should get Zero and ~3 V when open.

Change R6 150 Ohms to something between 15 to 47 Ohms (5V to Pin 28 AVDD Resistor) and check

billakis (author)billakis2017-01-06

From Pickit 2, the hex's configuration bits are

FBS 000F

FSS 0000

FGS 0007




FPOR 0000

FICD 0083

Are they correct?

clstans (author)2016-12-05

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

ajoyraman (author)clstans2016-12-05

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.

If the programming is OK and the Oscillation is correct only then will the communication take place at the correct baud rate.

When you select connect to com port you should get a response 'Aj Scope Ready' and not 'Time Out'.

As a hardware check that the clock frequency is OK and hence the correct baud-rate is being set-up:
On power up check the frequency at OC1 and OC2 outputs they should show a PWM waveform of 31.1kHz with 50% duty cycle.

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.

billakis (author)2016-11-10

"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"

What do you mean, Large Signal or Small Signal ?

Thank you!


ajoyraman (author)billakis2016-11-11

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.

billakis (author)ajoyraman2016-11-14

Thank you for the answer.

Is there, approximately, a value for this signal ?

Can you give me an example with values ?

gsle2003 (author)2016-10-03

Is it possible to use this oscilloscope to analyze other circuits like switched
power supply (all the sub blocks)? My concern is regarding the voltage range that it support and if it
support sampling the frequencies that switched power supply pwms usually operates

ajoyraman (author)gsle20032016-10-03

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.

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.

The setup, waveform & spectrum are shown. (zero line is the blue trace)

Asishjohney (author)2016-07-03

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.

Asishjohney made it! (author)2016-06-23

I have completed this wonderful project recently, thankx to Ajoy Raman for his best support.

I made it as two parts:

1.The main controller unit with PGA.

2. FT232- USB to serial interface.

Both the PCB's are designed by me in eagle.

Major Steps:

1. I programmed the dsPIC micro-controller with my best custom made and DIY programmer. I will post the programmer in instructable soon.

2. I made the probes with RCA connectors (used in TV connectors) and sheild wires, which are cheap and effective.

3. I designed the FT232 board which brings down the cost.

4. Heat sink is important and I stick the micro-controller with a thermal glue.

ajoyraman (author)Asishjohney2016-06-24

Great work Asish! Should be an inspiration to DIY enthusiasts in India. Add a picture when you put in an enclosure.

timarlop (author)2016-06-15

Hi Ajoy

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!


Can I add AC coupling mode to circuit? 100~150nF in series capacitor for each channel would be a good choice?

ajoyraman (author)timarlop2016-06-15

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.

maxwell_30 (author)2016-03-27

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?

ajoyraman (author)maxwell_302016-03-28

Hi maxwell_30! Depending on the resolution of the ADC one can consider multiplication & 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 & 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.

maxwell_30 (author)ajoyraman2016-03-28

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..

ajoyraman (author)maxwell_302016-03-28

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.

maxwell_30 (author)ajoyraman2016-04-04

and sir how exactly is Vref compensating for ADC scale-factor change with variation in VDD? I am unable to understand that :/

ajoyraman (author)maxwell_302016-04-04

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.

maxwell_30 (author)ajoyraman2016-04-09 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?

And if i understood the above thing correctly, I have another doubt...why convert the vref on both the channels 2 & 3 when simply converting it on any one can do the job?

ajoyraman (author)maxwell_302016-04-11

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.

maxwell_30 (author)ajoyraman2016-04-21

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 breadboard. 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.

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?

ajoyraman (author)maxwell_302016-04-21

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

maxwell_30 (author)ajoyraman2016-04-22

Okay. Thank u :)

Nardu (author)2016-03-16

Hi Ajoy,

I just started your project. First I designed a stripboard version for pcb.

ajoyraman (author)Nardu2016-03-16

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: Regards, Ajoy

Nardu (author)ajoyraman2016-03-29

Hello Ajoy,
1. For stripboard design, personal I prefer Lochmaster :
2. Any time, no problem. There are some limitation with SMD components,
but we try.

VikasD14 (author)ajoyraman2016-03-26

Dear Raman,

As per your requirement you can download the Stripboard design software from the following address.

Regards, Vikas

bgowland (author)2016-03-10

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 & 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

ajoyraman (author)bgowland2016-03-10

Hi Brian,

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.

I have updated the card firmware and windows software:
Regards, Ajoy

bgowland (author)ajoyraman2016-03-11

Hi Ajoy,

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.

Regards, Brian

ajoyraman (author)bgowland2016-03-12

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!

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:Android OTG Development InterfaceArduino Uno DDS Audio Signal GeneratorSimple DIY Electronic Enclosure
Add instructable to: