Project tutorial
Digital Oscilloscope Experiment Based on Arduino

Digital Oscilloscope Experiment Based on Arduino

A digital oscilloscope experiment based on Arduino.

  • 3,489 views
  • 3 comments
  • 20 respects

Components and supplies

About this project

Recently I used an Arduino for a digital oscilloscope experiment. It is very interesting to experiment with. The programming uses a u8g library file that supports multiple LCD displays. There is no need to know how a microcontroller works, nor care about the LCD driver. It makes programming very simple.

The display used is 12864 LCD driven by the ST7920 with an Arduino UNO. Here is the circuit diagram. (You can redeem it from PCBWay, please support me by registering with my invitation PCBWay link.)

Step One

After running the basic code, the waveform of the input signal can be displayed.

Using the ADC inside the microcontroller for digital-to-analog conversion, up to about 1.5KHz input signal can be displayed.

Here is the basic code:

#include <U8glib.h> 
U8GLIB_ST7920_128X64_4X u8g(13, 12, 11);  
int x, y; int Buffer[128];
void setup( ) { }
void loop( )
{
for(x = 0;x < 128;x++) 
Buffer[x] = 63-(analogRead(A0)>>4);
u8g.firstPage(); 
do 
{
for(x = 1;x < 127;x++)
u8g.drawLine(x, Buffer[x], x, Buffer[x+1]); }
while(u8g.nextPage( ));
}

Waveform diagram as shown:

Step Two: Add axes and borders

#include <U8glib.h> 
U8GLIB_ST7920_128X64_4X u8g(13, 12, 11);
int x, y; int Buffer[128];
void setup( )
{
analogReference(INTERNAL); 
} 
void loop( )
{
for(x = 0;x < 128;x++) 
Buffer[x] = 63-(analogRead(A0)>>4);
u8g.firstPage();
do 
{
for(x = 0;x < 127;x++) 
u8g.drawLine(x, Buffer[x], x, Buffer[x+1]); 
u8g.drawLine(64, 0, 64, 63); 
u8g.drawLine(0, 32, 128, 32);
for(x=0;x<128;x+=8) 
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); 
}
while( u8g.nextPage( ));
}

Here is the final version:

Comments

Similar projects you might like

MQ-4 Natural Gas Sensor Experiment Based on Arduino

Project tutorial by Andrew85

  • 711 views
  • 1 comment
  • 7 respects

Arduino Based Digital Temperature Sensor

Project showcase by Abishek Bhalaaji

  • 6,877 views
  • 0 comments
  • 7 respects

Nipkow Disk Based Digital Display Device

Project showcase by christopheArduino

  • 16,796 views
  • 8 comments
  • 55 respects

Arduino Digital Clock Using 1Sheeld

Project tutorial by amrmostaafaa

  • 2,184 views
  • 0 comments
  • 5 respects

RFID Based Automatic Door System

Project showcase by Robodia Technology

  • 35,762 views
  • 20 comments
  • 97 respects

Complete Digital Clock Including Alarm and Motion Sensor

Project tutorial by LAGSILVA

  • 12,679 views
  • 11 comments
  • 50 respects
Add projectSign up / Login