Introduction: Simple PC Oscilliscope

Picture of Simple PC Oscilliscope

Sometimes when I build simple ttl (Transistor–transistor logic) circuits I like to see the results of the output. An example would be the pwm (Pulse-width modulation) that might control a robot motor. I do not have the money to buy an oscilloscope. so I am using this project to fulfil those needs.

Note I am assuming you know how to use this set up. If you are not sure, please get a professional to help. If you are unfamiliar with electronics do not do this without help of a professional. Improper probes could destroy your computer, what is connected to your computer, and as well as not be safe.

Step 1: Input Probe.

Picture of Input Probe.

You may want to build this input probe from the first diagram. http://nte01.nteinc.com/nte/NTExRefSemiProd.nsf/$$Search is a good place to go to get equivalent part numbers.  Also included are other probes that are not as system safe.

http://xoscope.sourceforge.net/hardware/hardware.html

Quote from linuxquestions
[quote]
I made a little progress....
I started first with using the line in jack. I made a probe with a 1 meg resistor inline. The tip of the stereo plug is the left channel or channel 1 on Xoscope display. So the ring is the right channel or ch. 2 on the display. I only used one channel to start with. I used the Sleve as ground. I found the line jack seems work a lot better "cleaner" than the mic input.
With xoscope running, trigger off, I opened Kmix and selected the red button under "line" and went over and selected the green button above "IGAIN" and set the gain mid way and it started to work. This was after much knob dicking and fiddling around without a clue.
I seemed to have bleed over from the other channel, but I think its just the setting of the scale I used 1/5 and the noise dropped way down. I think being familure with how it works will make it easier to use.
I think its possible to make a 555 timer oscillator maybe with some clipping diodes to create a voltage reference?
[/quote]

Step 2: Getting the Software for Ubuntu.

Picture of Getting the Software for Ubuntu.

You will need two pieces of software. One for the scope software itself and one for the volume control. You can go to the synaptic package manager an get the two files or you can get them via the command line/ (requires an internet connection).

Xoscope - oscilliscope

Ubuntu
$ sudo apt-get install xoscope

Fedora 16
$ sudo yum install oscilloscope

Pavucontrol - soundcard control  (older systems may need to use the alsa utilities instead)
sudo apt-get install pavucontrol

Untested:
Fedora 16 32 bit
sudo yum install gtk+-devel pavucontrol
download and extract the xoscope archive
cd to the xoscope directory
./configure
sudo make
sudo make install

Step 3: Xoscope Quickie Manual.

NAME
       oscope xoscope - Digital Oscilloscope via Sound Card
                                    or Other Hardware

SYNOPSIS

		oscope [oscope options] [file]
        xoscope [toolkit options] [oscope options] [file]
 

DESCRIPTION

		Oscope  is  a  digital  real-time oscilloscope. It graphically displays
        signal amplitude or bit logic as a function of time.   Signals  may  be
        displayed,  saved, recalled, and manipulated by math functions.  Signal
        input devices currently include:
 
        /dev/dsp
             Audio sound recording via /dev/dsp.  Two 8-bit analog channels  at
             8000 S/s to 44100 S/s.  Left and right audio is connected to X and
             Y inputs respectively.  Use an external mixer  program  to  select
             which  sound inputs to record.  AC coupled, voltages unknown, 256K
             sample memory.
 
        EsounD
             Shared audio sound via the  Enlightened  Sound  Daemon.   This  is
             great  for  watching music but support for it is an option at com
             pile-time.  EsounD is auto-detected and preferred over /dev/dsp.
 
        ProbeScope / OsziFOX
             Radio Shack ProbeScope, Cat. No. 22-310 is also known as an  oszi
             FOX.   This  handheld  probe sends its data through a serial port.
             It samples one channel at 6-bits up to 20 MS/s with 128 samples of
             memory.  Real voltages are labeled in sample ranges from 1 volt to
             100 volts.  If a ProbeScope is detected, it is connected to the  Z
             input.
 
        Bitscope
             Bitscope (www.bitscope.com) is a mixed-signal capture engine which
             is accessed through a serial port.  It  simultaneously  samples  a
             digital  8-bit port and two analog channels at 8 bit resolution at
             up to 25 MS/s or more.  If detected, Channel A and B are connected
             to  X  and Y while the Logic Analyzer is connected to Z, disabling
             all sound input.  Bitscope support is currently under  development
             and not yet fully functional.
 
        See  the  -x  and -z options and the ENVIRONMENT section below for more
        details on how the above devices are detected.  Some  of  the  controls
        below apply only to the sound card and are labeled as such.  Oscope has
        no physical control over the ProbeScope/osziFOX which is controlled  by
        its  own  switches and built-in menus.  Please refer to your ProbeScope
        or osziFOX Owner’s Manual for operating  instructions.   Bitscope  will
        eventually be controlled through a separate dialog window.
        Oscope  is an interactive program and can be completely controlled from
        the keyboard at run-time.  In verbose key help mode, each available key
        is shown on the screen in (parentheses).  The following single key com
        mands are available:
 
        ?    Toggle verbose key help display mode.
 
        Escape
             Immediately quit the program.
 
        @    Load a previously saved file.  You are prompted for the  filename.
 
        #    Save  current  settings  and  memory buffers to a file that can be
             loaded later.  You are prompted for the  filename  and  asked  for
             confirmation to overwrite if it already exists.
 
        Enter
             Clear and refresh the entire screen.
 
        ^    Toggle  the serial input device on/off.  A serial device is turned
             on only if it is found active on a serial port.  This may be  use
             ful  if  the device was not detected at startup.  See the ENVIRON     
             MENT section below for more details.
 
        &    Toggle the sound card input device on/off.
 
        *    Cycle the sound card DMA divisor: 4, 2, 1.  The sound driver  will
             divide  it’s DMA buffer by this factor.  The value 4 usually gives
             the fastest display rate.
 
             Under EsounD, this value instead determines whether the connection
             to EsounD will block (4) or not (2 or 1).  Blocking mode is nicest
             to CPU usage but the oscope interface will not  respond  when  the
             there  is  no  sound  stream coming from EsounD.  Nonblocking mode
             will let oscope be responsive whether sound is available  or  not,
             but will consume all available CPU cycles.
 
        (/)  Decrease/increase the sound card sampling rate.
 
        9/0  Increase/decrease  the  Sec/Div horizontal time scale (zoom out/in
             on time).
 
        -/=  Decrease/increase the sound card trigger level.
 
        _    Toggle the sound card trigger channel: X or Y.
 
        +    Cycle the sound card trigger  type:  automatic,  rising  edge,  or
             falling edge.
 
        Space
             Cycle  the  trigger  mode of the sound card: run, wait, stop.  Run
             mode continuously acquires  and  displays  samples  after  trigger
             events.   Wait mode waits for the first trigger event and displays
             only the first set of samples; this is "single-shot"  mode.   Stop
             mode  suspends  the data acquisition and displays the current sam
             ples.
 
        !    Cycle the plotting mode: point, point accumulate,  line,  or  line
             accumulate.   In  the  accumulate  modes,  all samples stay on the
             screen; use Enter to clear them.
 
        ,    Cycle the graticule style: none, minor divisions  only,  or  minor
             and major divisions.
 
        .    Toggle  the graticule position: behind or in front of the signals.
 
          Decrease/increase the graticule color.
 
                 Toggle the manual cursors on/off.  When manual  cursors  are  dis
             played,  the  measurements between the cursor positions are shown.
             When cursors are not displayed, automatic measurements are  shown.
 
        "    Reset  both manual cursor positions to the sample just after trig
             ger.
 
        Ctrl-q/w/e/r
             The Control key held down in combination with  q/w/e/r  moves  the
             first cursor back or forward by 10 samples or back or forward by 1
             sample respectively.
 
        Ctrl-a/s/d/f
             The Control key held down in combination with  a/s/d/f  moves  the
             second  cursor back or forward by 10 samples or back or forward by
             1 sample respectively.
 
        1-8  Select the corresponding display channel.  Measurements  are  dis
             played  for the channel.  Channel 1 and 2 are used as input to the
             math functions so they can’t be used to do math.  By default, they
             are  connected to the X and Y input channels.  Channel 1 and 2 can
             also be used to display memory buffers or the Z  input  for  doing
             math  on  memory  or the alternate input.  Channel 3 through 8 are
             not restricted and can be used for any purpose.  By default, the Z
             input  is  connected  to Channel 3.  The remaining single key com
             mands operate on the currently selected channel:
 
        Tab  Toggle visibility: Hide or show the selected channel.
 
        {/}  Decrease/Increase vertical scale of the selected channel.
 
        [/]  Decrease/Increase vertical position of the selected channel.
 
             /~  Decrease/Increase number of logic analyzer  bits  displayed.   The
             default  of zero bits plots the signal as one analog line of vary
             ing amplitude.  Any other value plots multiple digital lines  rep
             resenting the least significant bits from bottom to top.
 
        ;/:  Increase/Decrease the math function of the selected channel.  This
             is not available on channel 1 & 2.
 
        $    Show the result of an external math command on the selected  chan
             nel.   You  are prompted for the command.  The command must accept
             samples of channel 1 & 2 on stdin and write a new signal  to  std
             out.   See operl, offt.c and xy.c in the distribution for examples
             of external math filter commands.  Not available on channel 1 & 2.
 
        A-W  Store the currently selected channel into the corresponding memory
             buffer.  Buffer X, Y  and  Z  can  not  be  used  because  they’re
             reserved as the signal inputs.  Memories are stored from time zero
             to the current display update position.  So it is best to STOP the
             display before storing to a memory buffer.
 
        a-z  Recall the corresponding memory buffer or input device to the cur
             rently selected channel.  Buffer X is the Left or A  input,  Y  is
             the Right or B input, and Z is ProbeScope or Logic Analyzer input.
             The rest of the buffers are available for signal memory.
        Xoscope adds mouse controls to menus or around the edges of  the  scope
        area.   These should be nearly self-explanatory.  They perform the same
        functions as the equivalent keyboard commands  above.   If  built  with
        GTK+,  a context-sensitive pop-up menu is available with right-click to
        select channels, change scale and position, recall  and  store  signals
        and  so  on.   Left  click  decreases  a  variable  while  right  click
        increases.  The manual measurement cursors can also be positioned  with
        the mouse.
        The  command-line  options  define the startup state of oscope and have
        reasonable defaults.  All options may be capitalized in case they  con
        flict  with  an  X  toolkit option.  These options are also recorded in
        text files saved by oscope.
 
        -h   Help usage  message  showing  these  startup  options  with  their
             default values, then exit.
 
        -# 
             Startup  conditions of each channel.  # is a channel number from 1
             to 8.  Code can have up to  three  fields,  separated  by  colons:
             position[.bits][:scale[:function  #,  memory  letter,  or external
             command]].  Position is the number of pixels above  (positive)  or
             below (negative) the center of the display.  Bits is the number of
             logic analyzer bits to display.  Scale is a valid  scaling  factor
             from  1/50  to  50,  expressed as a fraction.  The third field may
             contain a built-in math function number, memory letter, or  exter
             nal math command to run on the channel.  Using these options makes
             the channel visible unless position begins with a  ’+’,  in  which
             case the channel is hidden.
 
        -a 
             Active, or selected, channel.
 
        -r 
             Sound  card  sampling  Rate  in samples per second.  Current valid
             values are 8000, 11025, 22050, or 44100.
 
        -s 
             Time Scale factor from 1/20 to 1000 expressed as a fraction  where
             1/1 is 1 ms/div.
 
        -t 
             Sound  card  Trigger  conditions.   Trigger  can  have up to three
             fields, separated by colons: position[:type[:channel]].   Position
             is  the  number of pixels above (positive) or below (negative) the
             center of the display.  Type is a number indicating  the  kind  of
             trigger,  0 = automatic, 1 = rising edge, 2 = falling edge.  Chan
             nel should be x or y.
 
        -l 
             Manual cursor Line  positions.   Cursors  can  have  up  to  three
             fields,  separated  by colons: first[:second[:on?]].  First is the
             sample position of the first cursor.  Second is the  sample  posi
             tion  of the second cursor.  The final field is weather the manual
             cursors are displayed (1) or the not displayed (0).
 
        -c 
             Graticule Color, 0 - 15.
 
        -d 
             Divisor for sound card DMA: 1, 2, or 4.   The  sound  driver  will
             divide  it’s DMA buffer by this factor.  The value 4 usually gives
             the fastest display rate.
 
        -m 
             Graphics Mode to use.  For xoscope, use the more flexible  -geome
             try instead.  0 = 640x480x16, 1 = 800x600x16, 2 = 1024x768x16, 3 =
             1280x1024x16.  WARNING: not all modes are supported by  all  video
             cards; don’t use unsupported modes!
 
        -f   Font  to  use.   For oscope, these are listed in /usr/lib/kbd/con
             solefonts.  For xoscope, they’re  the  output  of  xlsfonts.   The
             default should work best.
 
        -p 
             Plot  type.   0  = point, 1 = point accumulate, 2 = line, 3 = line
             accumulate, 4 = step, 5 = step accumulate.
 
        -g

EXAMPLES


		oscope -1 80 -2 -80 -3 0:1/5:6 -4 -160:1/5:7
 
             This  runs  oscope  with  channel  1 above and channel 2 below the
             center of the display.  Also channel 3 and 4 are made  visible  to
             show the FFT of channel 1 and 2 respectively at a reduced scale of
             1/5.
 
        xoscope oscope.dat
 
             This runs xoscope, loading settings and memory buffers from a pre
             viously saved data file called "oscope.dat".
 

FILES


		Oscope  creates readable text data files.  The files contain at least a
        comment header which holds the current settings of oscope.  Loading the
        file causes these saved settings to be restored.
 
        To  record  your  signals  permanently  first  store  them  into memory
        buffers, optionally recall them to channels, and then  save  the  file.
        All  non-empty  memory buffers are written to a column of the file fol
        lowing the comment header.  Columns are separated  by  tab  characters.
        These  are  stored  back into the memory buffers when the file is later
        loaded.  Simply recall them to channels to view them.
 
        This format could also be read by some  spreadsheet  or  plotting  pro
        grams.  For example, the gnuplot (1) command
 
        plot "oscope.dat" using 0:1, "oscope.dat" using 0:2
 
        would  plot the first and second columns of the "oscope.dat" data file.
 

ENVIRONMENT


		OSCOPEPATH
             The path to use when  looking  for  external  math  commands.   If
             unset, the built-in default is used.
 
        PROBESCOPE
             The  serial device your ProbeScope or osziFOX is connected to.  If
             no ProbeScope  is  found  here,  some  known  serial  devices  are
             checked.   If  unset,  /dev/probescope  is  used.  /dev/probescope
             could be a symbolic link to the real device such as /dev/ttyS1.
 
        BITSCOPE
             The serial device your Bitscope is connected to.  If  no  Bitscope
             is  found  here, some known serial devices are checked.  If unset,
             /dev/bitscope is used.  /dev/bitscope could be a symbolic link  to
             the real device such as /dev/ttyS1.
 
        ESPEAKER
             The  host:port  of  the  EsounD to connect to if built with EsounD
             support.  If unset, localhost is assumed.  If no EsounD connection
             is  made or if there is no EsounD support compiled in, then oscope
             will try to read /dev/dsp directly.
 

LIMITATIONS


		The sound card should be capable of 44100 Hz  sampling  via  the  sound
        drivers.   You  must  use an external mixer program to select the input
        source device, level, etc.  Since these unknowns affect the  amplitude,
        there is no reference to voltage on the Y axis; it is in fact, unknown.
        Instead youre given the scale in pixels per sample  unit.   Note  that
        the  serial oscilloscope devices dont have this limitation.  They have
        real voltage labels on the Y axis.
 
        Signal math is only valid if Channel 1 and 2  contain  signals  of  the
        same  sampling  rate.   It  is up to you to make sure this is the case.
        Doing math on signals of different sample rates will produce  incorrect
        results!
 
        The automatic measurements count zero crossings and divide to determine
        the frequency and period.  If these zero crossings are not  "regularly-
        periodic", these measurements could be invalid.  Oscope does understand
        how to measure the built-in FFT functions by  locating  the  peak  fre
        quency.   Use  manual  cursor  positioning to get more precise measure
        ments.
 
        Your sound card is most-likely AC coupled so you will never see any  DC
        offset.   You probably cant get DC coupling by just shorting the input
        capacitors on your sound card.  Use serial hardware to see DC  offsets.
 
        The display may not be able to keep up if you give it too much to plot,
        depending on your sound  card,  graphics  card,  and  processor  speed.
        External math commands are particularly expensive since the kernel must
        then split the available CPU cycles across multiple processes.  To max
        imize  refresh  speed,  hide  all unneeded channels, use point or point
        accumulate mode, zoom in on Sec/Div as much as possible, and  turn  off
        the graticule.
 
        Because  it  uses  svgalib,  oscope must be run as root or be setuid to
        root.  xoscope doesnt have this restriction.
 

BUGS


		The keyboard interface may be confusing.
 

AUTHOR


		Oscope was written  by  Tim  Witham  (twitham@quiknet.com),  originally
        based  on  "scope" by Jeff Tranter (Jeff_Tranter@Mitel.COM).  Oscope is
        released under the conditions of the GNU General Public  License.   See
        the files README and COPYING in the distribution for details.
 
 

Step 4: Additional Sources

Picture of Additional Sources

Mostly for MSWindows users:

http://www.zeitnitz.de/Christian/scope_en

http://www.picotech.com/picoscope-oscilloscope-software.html

http://www.tech-systems-labs.com/test-software.htm

http://www.electronics-lab.com/downloads/pc/index.html

http://www.brothersoft.com/downloads/oscilloscope.html

Comments

PabloAB (author)2016-03-06

Did you consider Spek.cc and the GUI: PulseView (https://sigrok.org/wiki/PulseView )? Looks more powerful and friendly.

Computothought (author)PabloAB2016-04-13

I just wanted to use what was in the repo and easy to install.

ifernandez3 (author)2013-10-19

gracias . bien explicado.vamos a ver como podemos armarla.

Your welcome!

profpat (author)2012-05-06

boy,

this is really simple! great instructable!

Computothought (author)profpat2012-05-06

Thanx, we appreciate the comment.

pfred2 (author)2012-03-27

This is really cool! I have a couple of oscilloscopes and I still think it is cool. But then again I just like oscilloscopes I guess. I can get this for Debian Lenny even. I just checked with:

pfred1@spot:~$ aptitude search xoscope
p   xoscope                         - digital oscilloscope

Now I have to see what the difference between a TL072 and a TL082 is to see if I can use some of the ICs I already have here. Texas Instruments seems to think, "The JFET-input operational amplifiers in the TL07x series are similar to the TL08x series, with low input bias and offset currents and fast slew rate."

Hmmm, sounds promising to me. Now that I'm looking at the schematic again I might even have the original book it came out of. The Art of Electronics sounds awfully familiar to me.

Thanks for writing this up. I've heard of this stuff but never really looked at it too closely before. I just might have to try it out someday here.

Computothought (author)pfred22012-03-27

Thanx!

eefmf (author)2011-04-15

Please try the PDF and tell me if you agree the PDF is not working.
There may be something wrong at my computer.
thanks

pfred2 (author)eefmf2012-03-27

It sure seems broken to me here. I just tried to download it, that netted me a 0 byte file, so then I tried to just view it, and that got me a blank page. Using

wget "https://www.instructables.com/pdf/Simple-PC-oscilliscope/Simple-PC-oscilliscope.pdf"

gets me something, but it isn't a PDF file, I don't know exactly what it is.

pfred1@spot:~/Downloads/XoSCOPE$ head Simple-PC-oscilliscope.pdf



I'm lodging a complaint with the management around here, that I do know!

Computothought (author)eefmf2011-04-15

Please direct your issues to the site administrators. I have no control over what you can or can not get.

eefmf (author)2011-03-28

Print PDF is not working.
Please fix it.

Computothought (author)eefmf2011-03-28

if you are talking aobyt Instructables, you need to direct you comments to the admin. if you are talking about Xoscope, I did not write the software. you might be able to get in touch with the authors here:http://xoscope.sourceforge.net/

About This Instructable

38,750views

78favorites

License:

Bio: computoman.blogspot.com Bytesize articles instead of a trilogy in one post.
More by Computothought:Coffeepot mealsEasy sun hatEasy cakes and pies.
Add instructable to: