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

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 www.ftdichip.com/‎
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

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"

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

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

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

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

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

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"

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

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

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 ajoyraman@gmail.com

visit my website www.ajoyraman.in for other projects

Step 14: 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.

<p>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 <a href="http://fanyit.com/review/hantek-best-usb-oscilloscope-review/" rel="nofollow">Best USB oscilloscope</a> for his price. But bravo to the invention.</p>
<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>

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:Extend Defective Fluorescent Tube-Light Life COMMUTATOR BASED DIRECTION INDICATOR Z Fold Display Board Standee 
Add instructable to: