Oscilloscope Arduino-Processing

105,027

147

69

Introduction: Oscilloscope Arduino-Processing

Oscilloscope is a device that allows us to see graphically the electrical signal.

If you want a cheap oscilloscope to learn what it is or to play with, follow the steps below:

Step 1: Have an Arduino Uno

The price of Arduino Uno is around $ 20 in internet stores.

Step 2: Install the Arduino IDE and TimerOne.h Library

  1. First, if you do not already have the Arduino IDE installed, install it from the site Arduino: click here
  2. Install the "TimerOne.h" library for the Arduino IDE, following the steps bellow
    • In the Arduino program click on "Sketch" (see the picture)
    • "Include Library ..."
    • "Manage Libraries ..."
    • On the line "Type: 'all' Topic: 'all'" has a blank search field , type "TimerOne".
    • (Information about the library will appear )
    • click over that text and the "Install" button will appear.
    • click "Install"
    • Restart the program

Step 3: Download Arduino Program and Upload It to Arduino

  1. Download and unzip the Arduino program from this link: (oscilloscope_arduino.ino)
  2. Connect the Arduino to the computer via USB port
  3. Run the Arduino IDE;
  4. Open the downloaded program "oscilloscope_arduino.ino"
  5. Adjust the COM port correctly (see picture)
  6. Upload the program to Arduino.

Step 4: Download the Oscilloscope Processing Program

  1. Download and unzip the Processing program to run on the computer. Choose the correct one below:
  2. Execute the Processing file (ex: Windows 64 bits => oscilloscope_4ch.exe)
    • Obs: lib\ folder is important, do not delete it
    • Java 8 needs to be installed

Step 5: If Oscilloscope_4ch.exe Doesn't Work...

If oscilloscope_4ch.exe doesn't work for any reason:

  1. Install the Processing IDE.
  2. Download and unzip the Processing source oscilloscope program
  3. Run Processing IDE and open the oscilloscope source program
  4. Execute the program clicking on the triangle icon

Step 6: Configure Serial Port to Connect Oscilloscope Program With Arduino

  1. You already have the oscilloscope program running and the Arduino connected to the computer by USB port. Now you have to connect to each other by "serial".
  2. In the "Configurar a serial" (Configure the Serial) box, click "select serial" until the COM where the Arduino is connected appears.(if it did not appear, click "refresh" to update)
  3. Click "select speed" until the speed 115200 appears.
  4. Click "off" to switch to "on"
  5. If everything is correct, the oscilloscope will show the 4 channels [A0 (ch-0), A1 (ch-1), A2 (ch-2) and A3 (ch-3)]
    obs: if nothing is connected you will see a noise.

Step 7: Connect the Output (~10) to Input (A0) and (~9) to (A1)

  • With wires connect the Arduino's digital output (~10) to analog input (A0) and digital output (~9) to input (A1).

You will see appear a signal like the picture.
The out (~9) and (~10) are generated by the "Ger.Sinal" box:
(~9) is PWM of 10Hz (T = 100ms) with 25% ON.
(~10) is a square of period 2T (200ms)

  • You can adjust the values on that box dragging the edge or clicking around the control.

Step 8: Tips

  1. Click "Trigger" at the Ch-0 (red) to stabilish the signals.
  2. To not read the signals of Ch-2 and Ch-3, click on the names "Ch-2" and Ch-3 ".
  3. To see the XY (Lissajous figures), click on the name "XYZ"
  4. To detect the frequencies, click on "detect freq."
  5. To measure voltage and time/frequency, click on "medir" (measure) of the desired channel then click on a point on the graph and drag to the other desired point.
  6. To change the dial control value click between vertical lines or drag the edge indicated by the triangles. (see picture)
  7. There is so much more! Explore!

Step 9: Aplication: Detecting Flash Frequency

You can find out the frequency that the flashlight is blinking using a LDR and a resistor (see the picture)

Step 10: Application: Detecting RPM of Fan

To find out the RPM of a fan use the circuit with LDR, resistor and a flashlight (not blinking).

Using the frequency value shown by the oscilloscope, apply the formula of the picture.

Step 11: Application: Analysing the Remote Control Signal

You can see the IR signal from remote control using the phototransistor TIL78.

Make the circuit of the picture, then follow the steps bellow:

  1. Adjust "dt" to 2ms (see all signal) or 100us (see details)
  2. Turn ch-0 trigger ON
  3. Increase level of trigger tension
  4. Click "UMA" (one): oscilloscope will stay waitting for the signal
  5. Press any remote control key directing it to TIL-78
  6. Analyse the graphic

Step 12: Application: Testing Components or Devices

We can use the oscilloscope to test electronic components or devices.

In this example we will test the little joystick for Arduino.

    1. Make the circuit shown in the picture.
    2. Connect the oscilloscope program to Arduino (configuring the Serial Port box)
    3. Click on "fluxo" (flow) so the Arduino sends each point right after reading.
    4. Adjust "dt" to 100ms to have a slow reading.
    5. Turn off the "ch-3" clicking over the name
    6. Adjust "v/div" to 5 (pressing the "shift" key to adjust all channels simultaneously)
    7. Change the ch-0 to up, moving the little left triangle (pressing the "shift" key)
    8. Turn on the XYZ channel and drag the "v/div", adjusting it to fill the free space.
    9. Move the joystick to all directions and press the button some times.
    10. See the curves.

    Step 13: Measure Resistors and Capacitors

    The "medir res./cap." (measure res./cap.) box is for measuring values of resistors and capacitors, but it will only work if you make the circuit of the picture.

    That function has the hability to discover by itself if the component connected is a capacitor or a resistor, and to choose the better result using 3 scales (low, middle or high values)

    Step 14: Do You Want More Fun?

    You can download the entire project directly from the GitHub site clicking here

    Watch the video on Youtube (turn on closecaption and translate to english!)

    Please, let me know if you liked that project or if you had any trouble to follow the steps.

    I will apreciate any help to develop that project. Programmers, users, curious, dreammers, etc.., will be welcome! ;)

    19 People Made This Project!

    Recommendations

    • Battery Powered Contest

      Battery Powered Contest
    • Plywood Challenge

      Plywood Challenge
    • Plastic Contest

      Plastic Contest

    69 Discussions

    0
    SamM292
    SamM292

    3 months ago

    ¡Fantástico! Me tomó solo unos minutos ponerme en marcha. Muy complacido. Me mantendrá ocupado durante el resto del bloqueo de COVID-19.
    ====
    Fantastic! It took me only few minutes to up and run. Very pleased. It will keep me occupied for the rest of the COVID-19 lock-down.

    1
    henriquerocks
    henriquerocks

    Question 3 months ago

    Hi.

    I'm having some issues with the program. The demo and all the measurements of the program works fine, but, for some reason, when I click "off" to turn the application on, it chashes. Furthermore, when the apllication crashes and closes, a .log file is created in the native folder, and in this page it says:

    A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=23664, tid=0x000000000000636c
    #
    # JRE version: Java(TM) SE Runtime Environment (8.0_261-b12) (build 1.8.0_261-b12)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.261-b12 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # C [jSSC-2.8.dll+0xb5db]
    #
    # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

    Anyone can help me with this?? Pls

    0
    Marius Sulzer
    Marius Sulzer

    4 months ago

    Hi there,

    I try to get the data on my serial port, but when I do so only hieroglyphs appear. I matched the baud rate of the serial monitor with the one in Serial-begin().

    I'm using an XLR8 Board from Alorium which can be used as Arduino UNO but with even better performance.

    Is it possible to write the high frequency ADC data in the serial port with a high baud rate? I want to read out the serial port with a python code.

    Thank you for your help. I'm looking forward to reading your answer.
    Marius

    0
    RogerioBego
    RogerioBego

    Reply 4 months ago

    In the arduion program (.ino) the speed is adjusted to 115200, you can decrease it.
    You can try too, change 8 bits or 7 bits in your serial port.

    0
    Marius Sulzer
    Marius Sulzer

    Reply 4 months ago

    Hi there,

    thanks for your reply. How do I change it to 7 bits?

    1
    suman.menon283
    suman.menon283

    Question 10 months ago

    Hi, i was doing a experiment where i use a function generator to display a sin wave . but when i do this, the negative half cycle of the wave clipped off . it happent to all the other wave. why it happent???? should i add 2.5V to the signal from function generator????
    what should i do to prevent clipping of the signal ????....plz help me..... i don't get a clear idea from the previous comment ..... plz help me with this................

    0
    mklanert
    mklanert

    Answer 4 months ago

    I imagine your wave is going from +5V to -5V, right? Arduino analog ports can only read 0V to +5V signals. It means it can only read the positive portion of your wave as it cannot read negative voltage signals. What the author suggested as the solution in your previous question is that you have to displace the mean voltage of your wave from 0V to +2.5V, and use a maximum amplitude of 2.5V. Doing this, your peak will be +5V (2.5V mean + 2.5V amplitude) and your valley will be 0V (2.5V mean - 2.5V amplitude), so you will stay in the 0V to +5V range of inputs.

    0
    rk7312945
    rk7312945

    Question 5 months ago

    What is the maximum voltage can be measure using this ?

    0
    mklanert
    mklanert

    Answer 4 months ago

    Most arduino boards are limited to 5V for inputs, some are 3.3V. However, you can always use a voltage divider to measure higher voltages. I didn't do this instructable yet, but it looks like you can set in the PC software the voltage divider you are using so it will show the proper voltage reading.

    0
    SBINS
    SBINS

    5 months ago

    Hi,

    I wanted to measure 0-5v volts from an external source to see its waveform and needed help to understand the wiring to take such measurement. Do I connect positive of external source to analog pins A(0-4) and negative of external to gnd of Arduino? Can you kindly tell me if I need to change anything in the code to take such external measurements? Any other precautions to protect the uno?

    Additionally, when you say 4 channel, does it mean I can use analog pins A0, A1, A2 and A3 to connect to 4 different positive inputs from 4 different circuits? Also, the 4 negative terminals will all be connected to gnd of Arduino board? Thanks a lot for helping me learn :)

    0
    mohdraisariffin
    mohdraisariffin

    7 months ago

    Dear Sir,
    Is there ways to overcome problem with Arduino Nano Every. Below is the error message while uploading the oscilloscope_arduino into Nano Every.
    Arduino: 1.8.12 (Windows 10), Board: "Arduino Nano Every, ATMEGA328"
    WARNING: library TimerOne-1.1.0 claims to run on avr architecture(s) and may be incompatible with your current board which runs on megaavr architecture(s).
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::initialize(long unsigned int)':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:47:2: error: 'TCCR1B' was not declared in this scope
    TCCR1B = _BV(WGM13); // set mode as phase and frequency correct pwm, stop the timer
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:47:2: note: suggested alternative: 'TCB1'
    TCCR1B = _BV(WGM13); // set mode as phase and frequency correct pwm, stop the timer
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:47:15: error: 'WGM13' was not declared in this scope
    TCCR1B = _BV(WGM13); // set mode as phase and frequency correct pwm, stop the timer
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:48:2: error: 'TCCR1A' was not declared in this scope
    TCCR1A = 0; // clear control register A
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:48:2: note: suggested alternative: 'TCB1'
    TCCR1A = 0; // clear control register A
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::setPeriod(long unsigned int)':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:54:25: error: 'CS10' was not declared in this scope
    clockSelectBits = _BV(CS10);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:54:25: note: suggested alternative: 'B110'
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:58:25: error: 'CS11' was not declared in this scope
    clockSelectBits = _BV(CS11);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:58:25: note: suggested alternative: 'B111'
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:62:25: error: 'CS11' was not declared in this scope
    clockSelectBits = _BV(CS11) | _BV(CS10);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:62:25: note: suggested alternative: 'B111'
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:62:37: error: 'CS10' was not declared in this scope
    clockSelectBits = _BV(CS11) | _BV(CS10);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:62:37: note: suggested alternative: 'B110'
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:66:25: error: 'CS12' was not declared in this scope
    clockSelectBits = _BV(CS12);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:70:25: error: 'CS12' was not declared in this scope
    clockSelectBits = _BV(CS12) | _BV(CS10);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:70:37: error: 'CS10' was not declared in this scope
    clockSelectBits = _BV(CS12) | _BV(CS10);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:70:37: note: suggested alternative: 'B110'
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:73:25: error: 'CS12' was not declared in this scope
    clockSelectBits = _BV(CS12) | _BV(CS10);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:73:37: error: 'CS10' was not declared in this scope
    clockSelectBits = _BV(CS12) | _BV(CS10);
    ^
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:73:37: note: suggested alternative: 'B110'
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:76:2: error: 'ICR1' was not declared in this scope
    ICR1 = pwmPeriod;
    ^~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:76:2: note: suggested alternative: 'TCB1'
    ICR1 = pwmPeriod;
    ^~~~
    TCB1
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:77:2: error: 'TCCR1B' was not declared in this scope
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:77:2: note: suggested alternative: 'TCB1'
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:77:15: error: 'WGM13' was not declared in this scope
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::start()':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:84:2: error: 'TCCR1B' was not declared in this scope
    TCCR1B = 0;
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:84:2: note: suggested alternative: 'TCB1'
    TCCR1B = 0;
    ^~~~~~
    TCB1
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:85:2: error: 'TCNT1' was not declared in this scope
    TCNT1 = 0; // TODO: does this cause an undesired interrupt?
    ^~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:85:2: note: suggested alternative: 'TCB1'
    TCNT1 = 0; // TODO: does this cause an undesired interrupt?
    ^~~~~
    TCB1
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::stop()':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:89:2: error: 'TCCR1B' was not declared in this scope
    TCCR1B = _BV(WGM13);
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:89:2: note: suggested alternative: 'TCB1'
    TCCR1B = _BV(WGM13);
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:89:15: error: 'WGM13' was not declared in this scope
    TCCR1B = _BV(WGM13);
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::resume()':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:95:2: error: 'TCCR1B' was not declared in this scope
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:95:2: note: suggested alternative: 'TCB1'
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:95:15: error: 'WGM13' was not declared in this scope
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::setPwmDuty(char, unsigned int)':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:105:13: error: 'TIMER1_A_PIN' was not declared in this scope
    if (pin == TIMER1_A_PIN) OCR1A = dutyCycle;
    ^~~~~~~~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:105:13: note: suggested alternative: 'TIMERA0'
    if (pin == TIMER1_A_PIN) OCR1A = dutyCycle;
    ^~~~~~~~~~~~
    TIMERA0
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:105:27: error: 'OCR1A' was not declared in this scope
    if (pin == TIMER1_A_PIN) OCR1A = dutyCycle;
    ^~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::pwm(char, unsigned int)':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:114:13: error: 'TIMER1_A_PIN' was not declared in this scope
    if (pin == TIMER1_A_PIN) { pinMode(TIMER1_A_PIN, OUTPUT); TCCR1A |= _BV(COM1A1); }
    ^~~~~~~~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:114:13: note: suggested alternative: 'TIMERA0'
    if (pin == TIMER1_A_PIN) { pinMode(TIMER1_A_PIN, OUTPUT); TCCR1A |= _BV(COM1A1); }
    ^~~~~~~~~~~~
    TIMERA0
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:114:60: error: 'TCCR1A' was not declared in this scope
    if (pin == TIMER1_A_PIN) { pinMode(TIMER1_A_PIN, OUTPUT); TCCR1A |= _BV(COM1A1); }
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:114:60: note: suggested alternative: 'TCB1'
    if (pin == TIMER1_A_PIN) { pinMode(TIMER1_A_PIN, OUTPUT); TCCR1A |= _BV(COM1A1); }
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:114:74: error: 'COM1A1' was not declared in this scope
    if (pin == TIMER1_A_PIN) { pinMode(TIMER1_A_PIN, OUTPUT); TCCR1A |= _BV(COM1A1); }
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:122:2: error: 'TCCR1B' was not declared in this scope
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:122:2: note: suggested alternative: 'TCB1'
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:122:15: error: 'WGM13' was not declared in this scope
    TCCR1B = _BV(WGM13) | clockSelectBits;
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::disablePwm(char)':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:129:13: error: 'TIMER1_A_PIN' was not declared in this scope
    if (pin == TIMER1_A_PIN) TCCR1A &= ~_BV(COM1A1);
    ^~~~~~~~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:129:13: note: suggested alternative: 'TIMERA0'
    if (pin == TIMER1_A_PIN) TCCR1A &= ~_BV(COM1A1);
    ^~~~~~~~~~~~
    TIMERA0
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:129:27: error: 'TCCR1A' was not declared in this scope
    if (pin == TIMER1_A_PIN) TCCR1A &= ~_BV(COM1A1);
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:129:27: note: suggested alternative: 'TCB1'
    if (pin == TIMER1_A_PIN) TCCR1A &= ~_BV(COM1A1);
    ^~~~~~
    TCB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:129:42: error: 'COM1A1' was not declared in this scope
    if (pin == TIMER1_A_PIN) TCCR1A &= ~_BV(COM1A1);
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::attachInterrupt(void (*)())':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:143:2: error: 'TIMSK1' was not declared in this scope
    TIMSK1 = _BV(TOIE1);
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:143:2: note: suggested alternative: 'TIMERB1'
    TIMSK1 = _BV(TOIE1);
    ^~~~~~
    TIMERB1
    In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
    from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/String.h:31,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Print.h:24,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Stream.h:25,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/Client.h:22,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/api/ArduinoAPI.h:29,
    from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.6\cores\arduino/Arduino.h:23,
    from sketch\oscilloscope_arduino.ino.cpp:1:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:143:15: error: 'TOIE1' was not declared in this scope
    TIMSK1 = _BV(TOIE1);
    ^
    In file included from D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:30:0:
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h: In member function 'void TimerOne::detachInterrupt()':
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:150:2: error: 'TIMSK1' was not declared in this scope
    TIMSK1 = 0;
    ^~~~~~
    C:\Users\User\Documents\Arduino\libraries\TimerOne-1.1.0/TimerOne.h:150:2: note: suggested alternative: 'TIMERB1'
    TIMSK1 = 0;
    ^~~~~~
    TIMERB1
    D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino: At global scope:
    oscilloscope_arduino:34:35: error: 'ADPS2' was not declared in this scope
    const unsigned char PS_16 = (1 << ADPS2);
    ^~~~~
    oscilloscope_arduino:35:35: error: 'ADPS2' was not declared in this scope
    const unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);
    ^~~~~
    oscilloscope_arduino:35:50: error: 'ADPS0' was not declared in this scope
    const unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);
    ^~~~~
    D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:35:50: note: suggested alternative: 'ADC0'
    const unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);
    ^~~~~
    ADC0
    oscilloscope_arduino:36:35: error: 'ADPS2' was not declared in this scope
    const unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1);
    ^~~~~
    oscilloscope_arduino:36:50: error: 'ADPS1' was not declared in this scope
    const unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1);
    ^~~~~
    oscilloscope_arduino:37:36: error: 'ADPS2' was not declared in this scope
    const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
    ^~~~~
    oscilloscope_arduino:37:51: error: 'ADPS1' was not declared in this scope
    const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
    ^~~~~
    oscilloscope_arduino:37:66: error: 'ADPS0' was not declared in this scope
    const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
    ^~~~~
    D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:37:66: note: suggested alternative: 'ADC0'
    const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
    ^~~~~
    ADC0
    oscilloscope_arduino:38:2: error: 'configurar' does not name a type
    configurar no setup: ADC
    ^~~~~~~~~~
    D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino: In function 'void setup()':
    oscilloscope_arduino:114:3: error: 'ADCSRA' was not declared in this scope
    ADCSRA |= PS_16; // 16 prescaler
    ^~~~~~
    D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:114:3: note: suggested alternative: 'ADC_t'
    ADCSRA |= PS_16; // 16 prescaler
    ^~~~~~
    ADC_t
    D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino: In function 'void printConfig()':
    oscilloscope_arduino:470:46: error: 'pwmOn' was not declared in this scope
    Serial.print(">? pwmOn="); Serial.println(pwmOn);
    ^~~~~
    D:\Sementara\oscilloscope_arduino\oscilloscope_arduino\oscilloscope_arduino.ino:470:46: note: suggested alternative: 'pwmPon'
    Serial.print(">? pwmOn="); Serial.println(pwmOn);
    ^~~~~
    pwmPon
    exit status 1
    'ADPS2' was not declared in this scope
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    0
    sayarbilgi
    sayarbilgi

    7 months ago

    RogerioBego çok teşekür ederim tam aradıgım proje harika çalışıyor.:)
    geriye probları yapmak kaldı

    0
    RamyaV
    RamyaV

    8 months ago

    Hello, I want to use Arduino Nano board with the oscilloscope programs. Could you please let me know the changes in pin numbers that had to be made for the programs to run as intended
    Thanks in acvance!

    0
    Cesar_Gabriel
    Cesar_Gabriel

    9 months ago

    Great Project! Very useful! Thank you!

    0
    rajainayat
    rajainayat

    9 months ago

    How much frequency of this Scope be obtained like 100MHz 200MHz or 300MHz

    0
    tpower4
    tpower4

    1 year ago

    Is there some way I can connect this to line voltage using some type of isolator . works fine for digital signals

    0
    rajainayat
    rajainayat

    Reply 9 months ago

    yes like for 220V you can use step down Transformer and take 5volts AC which will be a line voltage signal with frequency and phase parameters of Line voltage.

    2
    tomisen
    tomisen

    Question 10 months ago

    Hi . Thank you for making this project. I´m currently running at the mega board. I have started to focus on the ESP32 cip.
    Is there any version working on the ESP32 platform ?

    0
    CarlosM466
    CarlosM466

    Question 1 year ago on Introduction

    Thank you for your project. I have arduino.exe 1.8.9 installed on Windows 10. Could you, please, help us with the arduino software?
    When I try to upload the program oscilloscope_arduino to my arduino uno I get this message:
    Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"

    C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\Print.h: In function 'write.constprop':

    C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\Print.h:55:5: internal compiler error: Segmentation fault

    }

    ^

    Please submit a full bug report,

    with preprocessed source if appropriate.

    See <http://gcc.gnu.org/bugs.html&gt; for instructions.

    lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

    compilation terminated.

    c:/program files/windowsapps/arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

    collect2.exe: error: ld returned 1 exit status

    exit status 1
    Error compiling for board Arduino/Genuino Uno.

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    0
    jamesaharrisonuk
    jamesaharrisonuk

    1 year ago

    Hello. I'm trying to measure a 1Mhz Crystal Can and I'm getting some strange results. Could you tell me what Settings I need so it measures correctly. The software isnt written in English.