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
- First, if you do not already have the Arduino IDE installed, install it from the site Arduino: click here
- 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
- Download and unzip the Arduino program from this link: (oscilloscope_arduino.ino)
- Connect the Arduino to the computer via USB port
- Run the Arduino IDE;
- Open the downloaded program "oscilloscope_arduino.ino"
- Adjust the COM port correctly (see picture)
- Upload the program to Arduino.
Step 4: Download the Oscilloscope Processing Program
- Download and unzip the Processing program to run on the computer. Choose the correct one below:
- - windows 32
- - windows 64
- - linux 32
- - linux 64
- 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:
- Install the Processing IDE.
- Download and unzip the Processing source oscilloscope program
- Run Processing IDE and open the oscilloscope source program
- Execute the program clicking on the triangle icon
Step 6: Configure Serial Port to Connect Oscilloscope Program With Arduino
- 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".
- 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)
- Click "select speed" until the speed 115200 appears.
- Click "off" to switch to "on"
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
- Click "Trigger" at the Ch-0 (red) to stabilish the signals.
- To not read the signals of Ch-2 and Ch-3, click on the names "Ch-2" and Ch-3 ".
- To see the XY (Lissajous figures), click on the name "XYZ"
- To detect the frequencies, click on "detect freq."
- 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.
- To change the dial control value click between vertical lines or drag the edge indicated by the triangles. (see picture)
- 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:
- Adjust "dt" to 2ms (see all signal) or 100us (see details)
- Turn ch-0 trigger ON
- Increase level of trigger tension
- Click "UMA" (one): oscilloscope will stay waitting for the signal
- Press any remote control key directing it to TIL-78
- 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.
- Make the circuit shown in the picture.
- Connect the oscilloscope program to Arduino (configuring the Serial Port box)
- Click on "fluxo" (flow) so the Arduino sends each point right after reading.
- Adjust "dt" to 100ms to have a slow reading.
- Turn off the "ch-3" clicking over the name
- Adjust "v/div" to 5 (pressing the "shift" key to adjust all channels simultaneously)
- Change the ch-0 to up, moving the little left triangle (pressing the "shift" key)
- Turn on the XYZ channel and drag the "v/div", adjusting it to fill the free space.
- Move the joystick to all directions and press the button some times.
- 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! ;)
7 People Made This Project!
astrohitchhiker made it!
Krisianto made it!
pedro.pires made it!
mohammad rezam6 made it!
See 3 More
35 Discussions
21 days ago
Many thanks! Works like a charm! Exactly what i was looking for.
6 weeks ago
Thanks,works fine!
8 weeks ago
Hi, Great project Thank You :)
3 months ago
this is what i'm looking for! great job! but sadly the scope do not find my correct serial port.
I'm using Ubuntu. The Arduino IDE always shows "/dev/ttyS0" and if a Arduino is plugged in "/dev/ttyUSB0" (...USB1)
Is there a solution for that?
Reply 2 months ago
If you plug the arduino after run the program, you have to click on "refresh" to get the new connections, and after click on the connection name "/dev/.." to show the new connections
Reply 3 months ago
I will install Linux to verify the problem!
Thanks!
3 months ago
with the pre-compiled version 1.3 now it works perfect! i think to processing files have to be updated to 1.3, too
Reply 3 months ago
Thanks!
3 months ago
#include
TimerOne.h: No such file or directory
error
Reply 3 months ago
Did you do the step 2 (Step 2: Install the Arduino IDE and TimerOne.h Library)?
4 months ago
BegOscopio is not receiving a signal from Arduido UNO. I went through everything from scratch several times to no avail. I tried both the web-based and downloaded Arduino IDE. Everything looks great at the end and I can see an LED on UNO flash when BegOscopio is turned on, but there are just flat lines on all channels when trying to view the UNO test signal. The three BegOscopio test patterns work OK. I clicked everything, moved wired around, and even tested the UNO test signal with another small oscilloscope. It was OK. I feel that I am missing something obvious. I would appreciate advice. Thanks in advance.
Reply 4 months ago
When you connect Arduino UNO to the computer you have to see which "com" port it actually is connected. Then you have to configure the begOscopio to that "com", and the frame "Configure Serial" should be green.
To be sure you can use the Arduino IDE to connect to Arduino and findout the Com Port.
Reply 4 months ago
Dear Dr. Bego, Thank you for the advice. Besides checking the com port, I switched to the 32 bit version of oscilloscope_4ch.exe, even though I am running 64 bit Windows 10. This did the trick. BegOscopio v1.3 is now running perfectly. Thank you for this beautiful program. Doug Furtek
5 months ago
Hi Rogerio, congratulations for the very good job!
A question: what are the timing limitations? I mean, with a faster CPU (i.e. NodeMCU@160Mhz) what results could I expect in terms of frequency reading?
Obrigado,
Fabio
Reply 5 months ago
Hi Fabio,
I am happy you are interested to upgrade the CPU. I stopped with the Oscilloscope project! ;)
But I am sure that if you use a faster microcontroller you can read high frequencys.
I tested Arduino Due (84MHz) and I could read higher frequencys. (AD convertion is faster). obs: Arduino Uno (16MHz).
The good is that I changed nothing in Arduino code.
If you want I can help you to change the "Processing" code.
Reply 5 months ago
I gave up with the NodeMCU, as it has only one ADC input (not four).
Reply 5 months ago
BTW, the Processing code is really interesting, I am looking at it. I also made a compilation for Mac OSX and it is working.
Reply 5 months ago
Great! If you put in youtube let me know!
Question 6 months ago
Olá Rogerio!
Very nice project!
Are there some voltage or current limiaton for input signals?
Answer 5 months ago
Yes!
The limitation is the same as the Arduino input (5V)
But, as I discribed before, you can use circuits to decrease the tension