Oscilloscope using a microcontroller and a TV


I wanted to see if I could make a useful scope using just a microcontroller and a television. The result works, but is a bit slow with a maximum sampling rate of 15,750 Hz. This is fast enough for most electrophysiology, but not for audio. The sampling rate is determined by the maximum rate of the internal A/D converter.

The entire scope consists of a Mega32 microcontroller, 8 push buttons (connected to one port), and a TV. Optionally, you can add an RS232 interface to dump waveforms to a computer. The DAC to connect the microcontroller to the TV is shown below.

The analog input to the scope consists of a 0.47 microfarad capacitor and two 1.0 megaohm resistors as shown below. The highpass cutoff is around 1 Hz. The two resistors bias the A/D input to Vref/2. The capacitor blocks DC from the input. Input must be limited to +/-2.5 volts.

The full schematic:

The external trigger input is just a logic level directly into the INT0 input which is PORTD.2. The system runs on a 16 MHz crystal at 5 volts.The curcuit board is shown below (version 1 without RS232). The ExpressPCB (do a save as... on the following link and use ExpressPCB software) design file is for the version with RS232 output.

Parts list (Digikey part numbers):

Scope details

Scope freatures:

The CodeVision C program is loaded on the Atmel Mega32. The above image shows two pulses. The dot just below the trace is the cursor. Below that there is a RUN/STP/ARM indicator, cursor readout of time and voltage on the trace, a LEVL/EDGE/EXTN/FREE trigger indicator, and the trigger level. The current time and voltage scales are shown in the upper right corner.


Internally, the program is divided into two parts:

The serial port dump allows analysis of individual traces. A trace dump to a PC and then plotted by Excel is shown below. The actual data shown is simulated AP data fed into the scope from the sound port of a PC.

The Matlab commands

clear all
load 'a:\dump1.txt' -ascii
xlabel('Time (mSec)')

produced the plot below:

Copyright 2003 - Cornell University