Make a Digital Oscilloscope Via Arduino




Often seen people making online digital oscilloscope, DSO must have digital-analog conversion unit, according to d/a conversion circuit can be divided into two modes: 1. Special ADC chip + single-chip, 2. using single-chip ADC count inside the converter. For the first model I tried two (see my blog:, this circuit is a little more complex, component is more difficult to complete, it is difficult for beginners. The second structure is relatively simple, easyto make, but has a significant drawback, that is, within a narrow bandwidth, one of the more typical works are the overseas friends of, the bandwidth of the oscilloscope only 7.7KHz. Domestic users and STC single-chip AVR production, but the actual bandwidth is less than 10KHz.

Step 1: Code

Recently saw a net friend with Arduino oscilloscope, itmay be easier than the second method above, but their results are not ideal, the bandwidth is narrow. So I wanted to try and see and there is no good way to solve this problem. Produced by experiment, and constantly modify the code, and improved d/a conversion sample rate, very good results have been achieved.

The main parameters of the final product: Frequency response: 10Hz-50KHz Power supply: 5V LCD LCD screen: 128x64 (ST7920) Measurement display area: 96x64 Information display: 32x64, displays the frequency of the test signal, Vpp, and more Sync: rising edge triggers Scan speed: 0.02ms/div~10ms/div, carrying nine 1-2-5 Hold function: freeze the displayed waveform and parameters Second, basic test Using the Arduino project's biggest advantage is its rich resources, and do not need much knowledge of SCM. I made using a repository u8glib LCD, making it easier to program, or LCD drive will cost you a lot of time. U8glib download: (989.55 KB, downloads: 2577) Here is my first test circuit for Arduino UNO building, of 12864 LCD LCD using ST7920 control. As long as the input method in the following code, compiled after download you can achieve the basic functions of digital oscilloscope, wouldn't it be simpler?

# Include //statement
U8GLIB_ST7920_128X64_4X u8g(13, 12, 11); Statement LCD SPI Com:SCK =13, MOSI = 12, CS = 11 int x,y; Painted point coordinates int Buffer[128]; Cache storage array void setup( ) { } Sample void sample( ) { for(x = 0;x < 128;x++) Buffer[x] = analogRead(A0); Signal sampling for(x = 0;x < 128;x++) Buffer[x] = 63-(Buffer[x]>>4); Calculate y values } Display void draw( ) { for(x = 0;x < 127;x++) u8g.drawLine(x,Buffer[x],x,Buffer[x+1]); Draw two lines u8g.drawLine(64,0,64,63); Draw the axes u8g.drawLine(0,32,128,32); For (x=0;x<128;x+=8)//draw the axis scale u8g.drawLine(x,31,x,33); for(x=0;x<64;x+=8) u8g.drawLine(63,x,65,x); u8g.drawFrame(0,0,128,64); Draw border } void loop( ) { sample(); Sample u8g.firstPage(); Clear screen do draw( ); Display while( u8g.nextPage( ));


Step 2: Circuit

Using the test circuit, my Arduino is measured directlyusing the analogRead () function to complete a d/a conversion for about 111 μs conversion speed is slow, so much of its bandwidth is 1KHz, the next priority is to improve the speed of digital-analog conversion, while adding other features.

Third, the latest programs Here is the latest source code using, please keep my boot LOGO, HA HA. (2.72 KB, downloads: 2710)

Program chip 1.1V ADC use voltage reference mentioned above, if you want to use external 5V reference voltage should be program ADMUX=0xe0; To: ADMUX=0x60; Vpp= (V_max-V_min) *1.1/255; read: Vpp= (V_max-V_min) *5/255;

Four, machine made Experiments using the Arduino UNO above, the actualcard when using the Arduino PRO mini, so as to have a smaller volume.

Step 3: Major Component List:

Arduino PRO mini 1

LCD12864 LCD (ST7920) 1

electrolytic capacitors (100 μ 25V) 1

potentiometer (50k) 1

hole plate 3

power switch 1

battery cartridge 2

button switch (with rechargeable battery, 7th) 1

Case 1

Step 4: Wiring and Assembly

welding circuit board components

Step 5: Assembly

Load the circuit board into the case, with thick white Panel, attached to the inside of the front panel.

Step 6: Upload and Test

Due to the Arduino PRO mini does not turn USB serial port circuit, so to transfer via a USB serial port downloading before downloading the program.

Oscilloscope debugging is very simple, just have to adjust the potentiometer 50k Center the horizontal scanlines. I use a signal generator signal source.

Step 7: Some Explanations

1, this is one of the most simple digital Oscilloscopes, you can further improve on the basis of this;

2, you may have noticed that I am not using I/O port 0-7, which happens to be an 8-bit AVR single-chip microcomputer and mouth, this is what I prepared for subsequent upgrades, using special ADC chip, it can be used as data entry, if you are interested in the oscilloscope, then I will consider upgrading;

3, work was rushed and have any defects and deficiencies of, please advise, you have any questions you canalso over here.



  • Pocket Sized Contest

    Pocket Sized Contest
  • Weaving Challenge

    Weaving Challenge
  • Paper Contest

    Paper Contest

6 Discussions


1 year ago

What kind of code is it? never saw arduino code like this before!


1 year ago

please put sketch...


1 year ago

Dear sir

In this circuit can i change, Volts / div and Time base of frequency and bandwidth please give me a solution.

waiting for your replay




2 years ago

the code does not wok , keeps getting error message :( :(


2 years ago

what is maximum frequencyt meter?


2 years ago

This is very cool! I will make one myself :). Why do you say you need the Arduino PRO? It should work with any other Arduino too if I'm correct