Oscilloscope as an Image Viewer

Here we present a project where you can display any image or multiple images (monochrome) on an analogue oscilloscope. -- Vineet Nayak


Cathode ray oscilloscope (CRO) is a versatile laboratory instrument which is used to display, measure and analyse electrical signals. It is nothing but a fast x-y plotter that displays an input signal versus another signal or time. There is a luminous spot which moves over the display area in response to the input voltage. But displaying a monochrome bitmap image on an oscilloscope is a challenging yet interesting task. Here we present a project where you can display any image or multiple images (monochrome) on an analogue oscilloscope. Fig. 1 shows ‘EFY’ image on the oscilloscope.

Circuit and working

Fig. 1: Block diagram of different modules in OpenCV

The heart of the project is ATmega16 microcontroller—a low-power CMOS 8-bit chip based on AVR enhanced RISC architecture. It has 16kB in-system programmable Flash memory, 512 bytes of EEPROM and 1kB SRAM. A 16MHz crystal is connected across its pins 12 and 13 to provide basic clock. An R-2R ladder network DAC (digital-to-analogue converter) is used to convert digital (8-bit) values from the microcontroller to analogue values that are input to the oscilloscope.


The software is written in C language and compiled using Programmer’s Notepad of WinAVR software. The hex code is burnt in the microcontroller using a suitable programmer. The fuse settings for ATmega16 are:

 [stextbox id=”grey”]lfuse-0xef

The code is written such that it accepts byte codes in pages and columns format. The byte codes of the image is in the intel[] array which is stored in Flash memory. The myte[] array stores the pixel data of 32 pixels along a column, indicating the on/off states. On state is represented by a value of 1 to 31 and an off state by 0. The vertical trace movement is synchronised by the 20µs delay from one column to the next. The details are given in comment lines of the code.

Fig. 2: Circuit for oscilloscope as image viewer

The loop is repeated continuously as there is no DDRAM (data display RAM) to store the pixel information. So, for persistence of vision, the trace is repeated continuously for a certain number of cycles (50 here in the code). More than one image can be stored in new arrays until the Flash memory saturates.

The trace of the oscilloscope runs with internal trigger set at 10ms (time/div). The trace is set at this value for proper persistence of vision and in synchronisation with the timing of the code for proper display.

Fig. 3: GLCD bitmap editor

The analogue values are applied to the y-input of the scope. Each of the 32 pixels across a single column in the screen is assigned a particular voltage level (digital values from 0 to 31) as seen in the code. By switching the values from 0 to 31 very fast, we form a pixel of 32 dots across a single column. As the trace moves horizontally, it forms an array of pixels across the screen having 32 rows. This is how the pixel array is generated on the screen. The 32 pixels across a single column constitute 4 bytes. By individual switching of the pixels across a column till the trace moves to the next column, an image can be displayed.

Fig. 4: Loading the BMP image to get the byte code

Download Source Code: click here


Please enter your comment!
Please enter your name here