Instructables

Arduino - Oscilloscope (poor man's Oscilloscope)

Picture of Arduino - Oscilloscope (poor man's Oscilloscope)
555 timer.png
Hi guys,
a few days ago i found this code in github and it's the best i found so far, so i've decided to spread this project as much as I can, for anyone who want a cheap oscilloscope around this is the best way!  Let's start...

First, download processing. It's free Click here to download. You don't need to install anything, It runs like the Arduino IDE.
Now upload this code into your Arduino 
After Run this code in Processing IDE

And then you just need to connect the Arduino analog pin 0 to the signal you want to read.
And It's done!

The Circuit I'll be measuring , it's a simple 555 timer circuit... that flashes a LED, parts list and wiring diagram:

1x Arduino
1x Breadboard
1x LED
1x 10k resistor
1x4.7k resistor
1x 1k resistor
1x 100nF electrolytic capacitor
Jumper cables
check my YouTube video and watch it working. you can also visit my website for more projects and tips.


1-40 of 42Next »
TMSZ6 months ago

If serial port speed is configured to 9600 bps it should be able to get 320 samples per second, thus it be useful up to ~30Hz. Code is far from optimal even at this serial speed, e.g. additional 0xFF synchro byte is most likely redundant for USB connection.
As for GUI part - same hardware/firmware should work with miniscope v3 or v4 with Bus Pirate plugin - Bus Pirate has similar ADC streaming mode. Required changes: removing 0xFF byte and changing serial speed from 115200 used by BP to 9600 used here (dll plugin has to be recompiled).

jp_boardrides6 months ago

I revamped the Processing software this morning. I think I've made it much easier to use. Check it out at:

http://www.instructables.com/id/Arduino-Improved-Poor-Mans-Oscilloscope/

Ubiqvit9 months ago
Hello everybody! I have arduino Mega ADK and decided to try out this project. Anyway, i tested it with function generator and I can nicely see slow (<10Hz) frequency signals. But when frequency is increase above 15 Hz signal becomes unreadable. It looks like some random(aliasing) signal. In the comments I read that you can read signals up to kHz. Any advice what could be wrong? Thank you for answer.

The serial port oscilloscopes are very limited. Check out this video for a more advanced oscilloscope.

http://www.youtube.com/watch?v=5ky_N5-Fu6M

kaxlon7 months ago
Thanks for this one! A great start for beginners like me. Keep up the good work.
RuiSantos (author)  kaxlon7 months ago
Thanks for your feedback Kaxlon!
I'm glad you enjoyed :)
promach9 months ago
How do I increase the bandwidth (I suppose it is correct, or is it the sampling rate) of the poor man oscilloscope because I have a 1MHz square wave to examine ?
rexco1 year ago
Hi! Any chance to speed up the 'time base' of the oscilloscope so I could look at slow AC-signals (maybe up to about 300Hz)? Thanks..
RuiSantos (author)  rexco1 year ago
I don't think that is possible,... But I'm not sure... I guess I need to research on that...
promach1 year ago
Hi, I am using your oscilloscope to view a PWM signal generated from a 555 timer. However, I have some doubt regarding the voltage boundary. Red Line means what ? My positive peak is at around 3.6V. And from my observation, I can never see my negative peak. Why ?
squarewave.png
Since most ADCs do not read negative voltage, there is a better solution: inverting the voltage to be all positive. It would even be able to use the Arduino's built in ADCs, but would require an Op-amp. It would be a small amount of external hardware (as shown in the schematic). I will be making an instructable of an Oscope using cheaper parts than it costs to even buy an arduino, roughly $15 for a dedicated USB Oscope. (will use MSP430)
Power inverter.png
http://www.ti.com/product/amc7812
This is an ADC and DAC and goes -5V -> +5V
This is because the ATMEGA328 cannot read a negative voltage, it would require a different ADC than the one that is built into the ATMEGA328 to be able to read the negative voltage. The lowest voltage that the ATMEGA328 can possibly read is GND. You could even actually use a MAX232 (RS232 to TTL converter) to be able to read higher voltages such as 10V. Personally the way I would do it is I would get an external ADC which can read below 0V (GND), and a MAX232 so that the Arduino would be able use the data (since it is TTL level). You would have a more efficient and possibly better Oscope. I think I might write an instructable on how I would do this so it is easier for you to do.

On another note, depending on the resolution of the ADC converter, you could be able to even read micro-volts, so an adjustable speed for an Oscope would be easier now, and the resolution could be a lot higher.
simonfrfr1 year ago
Reminds me of this project... http://www.instructables.com/id/Oscilloscope-THE-EASY-WAY-DIY/
RuiSantos (author)  simonfrfr1 year ago
yeah it's a bit similar ... Although the processing code in my project is much shorter.
just a few lines compared to that one you showed
tali21 year ago
Hey Thanks for posting the code on instructables. Through when I was looking through the code and working with the signal input to the oscilloscope the output wasn't what I expected it was rather off and due to that it maybe a good code but still needs some working I believe.
RuiSantos (author)  tali21 year ago
sorry for the long delay to answer... sure it need some improvements, but will never get much better with just an atmega microcontroller i guess
afarid41 year ago
That's surprisingly simple! But I'm guessing this wouldn't read AC signals?
I made a probe for it http://www.instructables.com/id/How-to-make-an-Arduino-oscilloscope-probe/
RuiSantos (author)  NeoRecasata1 year ago
yeah I saw you project seems really good! thanks for sharing!
Hey Thanks for the example, It looks really simple.

I've got almost everything to work except when I open the Processing sketch I can't get a waveform to appear. Everything else is fine, my LED is flashing from the 555 timer, and the my probe is connected to Analog 0. The only issue I could think might of is maybe I had to change the serial port in the Processing sketch, but I don't see anything about that. It looks like a little wiring mistake, but I'm positive all my wires are connected properly.


Any suggestions would be helpful. Thanks.
RuiSantos (author)  Williamscullen8181 year ago
hi, that's really weird for example after you upload the code into your arduino and then run the processing code nothing appears?
thuiberts1 year ago
It would be really nice to have an indication of voltage and time and perhaps a pause mode in this, but I have absolutely no experience with processing.
I must say it works very well. I am using it to monitor an EEG device that I'm building.
RuiSantos (author)  thuiberts1 year ago
i'll probably do that in a few months right now i'm finishing some projects :)
thanks for the feedback
Hi RuiSantos,
It's me again. As discussed off-line I finished the instructable on a multi-channel version of the oscilloscope you are showing here. For anyone who is interest in a 2-channel or even a 3-channel version check at:
http://www.instructables.com/id/Arduino-Multi-Channel-Oscilloscope-Poor-Mans-O/
Thanks again RuiSantos for posting this. I am very happy I have one useful tool more in my arsenal.
Hi RuiSantos,
I tried it and it worked great. This was a good find of yours.
And by the way, the window size for the scope is adjustable.
Go to the first line in the void setup ():
size(1280, 480);
adjust to your liking. I needed
size(1014, 480);
to perfectly fit to the width of my screen.
Thanks again, I know this will come in handy very soon.
RuiSantos (author)  Superbender1 year ago
Hi,
Thanks for the info! :) Actually for me it works the size of the screen on the code :)
This project is great for me to study some signals as I don't have an Oscilloscope at home yet (I'll probably buy one really soon . )
good luck with your projects and check my original Arduino projects on my instructables account!
Thanks again for your comment

I have a fairly old machine for my hobby stuff, might have been the reason why I needed a smaller window size.
However, do you happen to have an idea if this scope can be expanded to a second channel?
RuiSantos (author)  Superbender1 year ago
yeah that's actually a really cool idea. I might do that ! And It should be easy to do that. In the arduino code you just need to define one more analog pin like the analog pin 1. On the processing you will need to duplicate the code that represents the signal from the analog pin 0 to represent the too the new analog pin 1at the same time or in two windows or something.
I agree that a second channel would be a cool feature. Please keep me posted on your progress. If I find the time I might try to work on it during the course of the next days. I hope though that you can beat me to it. ;)
RuiSantos (author)  Superbender1 year ago
I'll try that few modifications don't take much time :)
Hy does this works on 64bit WIn7? Because while i run the processing i got an error that serial doesn't work on 64bits..
Download the 32 bit version of processing and you will be good to go. I had the same problem as I am using a 64 bit win7. 64 bit processing does not support serial, you have to use the 32 bit version of processing.
RuiSantos (author)  kavtoakustika1 year ago
Yes for me was working on a 64bits windows... Try to search more about that error, because im sure that processing works on that operative system
alex_keil1 year ago
Nice! This worked right off the bat for me. Thanks.
RuiSantos (author)  alex_keil1 year ago
nice, almost everyone who tries it works, I'm glad you like it!
WWC1 year ago
Hi
Did you actually try this scope or is this just a repost from the internet?
I don't get a reading when i try this.
RuiSantos (author)  WWC1 year ago
i've found this code on the internet has i said in the post... but it works fine for me gives me a good reading ...
what are you trying to read? if the circuit it's to noisy probably you can't do much with this oscilloscope
WWC RuiSantos1 year ago
A schmitt trigger. Scope shows no display. Only bare scope with the o line.
RuiSantos (author)  WWC1 year ago
never happened to me before, if you have the circuit in your computer send me a private message with it, and when i have time i'll try it...
sorry
1-40 of 42Next »