A PC and an Arduino: here’s your DIY Oscilloscope

By on June 3, 2014

Web site:


Project Summary:

We have designed an Oscilloscope using PC and Arduino Board. The signal is first of all fed to the Arduino Board where the analog signal is converted to a digital signal by the ADC which is then serially outputted to the PC and is read by the MATLAB software via the COM ports. Here the signal is read in the form of digital data but then is converted to analog one by using the resolution of the ADC used by the Arduino Board. The MATLAB software was then used to plot the signals.

Full Project:


The input to be plotted is given to one of the five analog pins in the board. The software used for interfacing the board with the PC is Matlab R2012a. The compiler Arduino 1.0 has been used for uploading the codes to the board. The MAX 232 Line Driver and ATmega328 Processor has been used. The various components used in this designing has been illustrated briefly in the coming sections.



Circuit diagram:

our ckt

Bill of Materials:

Arduino Board

LM358 IC

3PCS 1Mohm

2PCS 0.01 µF




clear all;clc;close all;
for i=1:length(x)
t = y/1024*5;
A = y;
for k=1:1024
m = max(count);
in = find(count==m);


disp('making plot..')
figure('Name','The Digital Values From Serial Port');
title('Serial Port Data');
ylim([0 1023]);
xlabel('From Serial Port');
ylabel('Digital Voltage');

title('The Analog Plot Of Voltage');
ylim([0 5]);
xlabel('From Serial Port');
ylabel('Analog Voltage');

fprintf('%d is found toh be maximum count of %d ',in-1,m);

t = 0:1023;
plot(t,count),title('Frequency Count');
xlabel('Digital Value');
ylabel('No Of Occurences');
xlim([0 1023]);

d = count/length(A)*100;
title('Digital Values Frequency Percentage');
xlabel('Digital Value');
ylabel('Percentage of No Of Occurences');
xlim([0 1023]);

 Arduino Board codes

void setup() {
  // initialize serial communication at 9600 bits per second:

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  delay(100);        // delay in between reads for stability

Software & Code Snippets:

About prem_ranjan


  1. MinasMazar

    June 3, 2014 at 2:33 PM

    I think the best way to connect Arduino board to PC is with https://github.com/austinbv/dino enjoy Ruby powa! ;-)

  2. Emna Mechri

    June 3, 2014 at 4:12 PM

    nice project ! Arduino, Matlab *_*

  3. diex

    June 3, 2014 at 5:01 PM

    100 ms delay? is it a lot, isn’t it?

  4. Dave Stansbie

    June 3, 2014 at 10:57 PM

    I’ve logged in but I can’t see any of the project. Am I missing something?

  5. vish

    June 29, 2014 at 5:22 AM

    Hi… check out this project
    No additional software needed….works from your browser…even from your tablet or smartphone.

  6. Joy V. John

    June 29, 2014 at 6:00 AM

    Can this be accomplished using raspberry pi?

    • Glen Duncan

      June 30, 2014 at 5:57 AM

      ANYTHING an Arduino can do, the Pi can do.

      • Yo Joe

        June 30, 2014 at 7:14 AM

        Disagree. They have their strengths and weaknesses and are really completely different. Pi has no where near the same amount of I/O as the Arduino’s (open ended, i’m gonna assume Mega, or Due)

        • adsicks

          January 18, 2016 at 10:49 AM

          The thing is, you can buy an Arduino chip for a few bucks, tie it into a usb breakout to program it, and then add analog processing to your Pi from a Pi breakout….why not….you could probably load your firmware off the Pi to the ATmega328P from the serial pins on the Pi at boot. And there are smaller versions of the ATmega328P with fewer pins even. All these chips have the Uno bootloader on them….

      • Jim Myers

        July 2, 2014 at 3:50 AM

        The Raspberry Pi and the Arduino are designed for entirely different uses. The Raspberry Pi is much slower at processing IO because it must rely upon a full OS for operation. The Pi also suffers from a dearth of GPIO ports. The attached graphic gives a basic comparison between an Arduino Uno and a Raspberry Pi model B.

        The Raspberry Pi is aimed at software applications while the Arduino is aimed at hardware applications. The Arduino is superior at briding the hardware/software gap as compared to the Pi.

  7. Karolis

    October 28, 2014 at 3:53 PM

    Isn’t that too much 1 MOhm on the input of the op-amp? It should be quite noisy on the input of this design..

  8. Pingback: Merry Christmas and a Open New Year | Open Electronics

  9. rohit rana

    April 24, 2015 at 9:06 AM

    can anybody tell how to display real time waveform in this pc based oscilloscope project.the above code given displaying only waveform but not in continuous manner. please kindly post how to display continuous waveform

  10. Jupiterov

    July 26, 2015 at 9:37 PM

    Hi All! There is a nice project of an Oscilloscope with Arduino UNO with miuPanel that permits to see and control the oscilloscope with a smart phone without the need to write the APP. The sample rate is 50 kSa/s, it implements the trigger and can provide more than 20 FPS on a smartphone LCD. See: http://www.miupanel.com/Projects/Arduino-Advanced-Oscilloscope You could use miuPanel too to provide the graphical interface to your Arduino project.

  11. deadpool

    March 9, 2016 at 8:09 AM

    Can this be accomplished using arduino uno ??

  12. deadpool

    March 10, 2016 at 2:11 AM

    Can this be accomplished using arduino uno ??

Leave a Reply