Instructables

Make an Oscilloscope Using the SainSmart Mega2560 with the TFT LCD shield and the 3.5 "color touch screen

FeaturedContest WinnerContest Winner
Picture of Make an Oscilloscope Using the SainSmart Mega2560 with the TFT LCD shield and the 3.5
megascope2.jpg
WP_20140406_007.jpg
WP_20140406_004.jpg
megascope1.jpg

This instructable will show you how to build a portable Touch Screen
Oscilloscope for less than 40 U$!


The oscilloscope is one of the most powerful electronic instruments that
is available to electronics hobbyist, experimenters, and engineers. It is
mainly used to measue time-varying signals. Any time you have a signal
that varies with time( slowly, quickly, and /or periodically ) you can use
an oscilloscope to measure it , visualize it, and to find any unexpected
features in it.

We can use an oscilloscope to observe and study signal characteristics
that we could otherwise not see .

You will learn about the Arduino mega analog to digital converter( ADC).

We will be using the Arduino analog A0 input to sample and capture time
varying signals by Writing a program that will also display those signals
in a 3.8" TFT LCD touch display, and we will input data to modify the
oscilloscope behavior, using the touch capabilities of the screen display.

Before we start building and programming, lets review some basic
characteristics of an oscilloscope.

These are functions you can control on most oscilloscopes:

Sweep speed. Sweep speed is usually measured in units of time per distance,
like milliseconds/centimeter or milliseconds per division.This might also
be referred to as the horizontal sensitivity.

Vertical sensitivity. That's the measure of how sensitive the display dot
is to voltage applied to the input terminals. It is usually measured in
volts/centimeter or volts per division.

A trigger signal can be generated when the signal value reaches some
particular level - the trigger level. In most cases you can set the trigger
level to a voltage value of your choosing. A trigger is used to capture and
stabilize the waveform on the screen, or to wait for an event before
capturing the data
.
The oscilloscope, like my 4 channel DC DVM, will not be as accurate as
a commercial unit, but it works pretty good for low voltage and low frequencies.

 
Remove these adsRemove these ads by Signing Up
1-40 of 54Next »
grumpyboots made it!5 months ago

neato! thanks, maybe ill see what uses i can for this

Photo on 2014-04-20 at 5.51 PM.jpg
johnag (author)  grumpyboots5 months ago

Cool grumpyboots.. thanks for sharimg!

An excellent article!

I will be looking for a tft for my mega!

What sort of refresh rate do you think your tft has?

Have you considered reading the analogue port by interrupt-

I have a 153K oscilloscope design using a mega with hardware and software triggering.

http://www.instructables.com/id/Arduino-High-speed...

It would be interesting to bring the two concepts together.

guys my library shows a problem in this line UTFT myGLCD (ITDB24E_16,38,39,40,41). with the following Message: UTF does not name a type. can someone help me?

johnag (author)  Rogério Santana1 month ago

Make sure you have the library properly instaled and that you run the demo programs, as described in steps. 4 and 5 before loading the oscpe sketch

johnag (author)  Rogério Santana1 month ago

if you are usimg the sainsmart kit the line should read::

UTFT myGLCD(ITDB32S,38,39,40,41);

what does ('UTFT' does not name a type) mean I get this when I told it to load the sketch.

Jim

UTFT myGLCD(ITDB32S,38,39,40,41);

rroque52 months ago

Is to do this using a nano aruino v3.0?

johnag (author)  rroque52 months ago

I don't.think. so, sorry

rroque5 johnag2 months ago

Thanks!

alejandroym934 months ago

Nice work! Only one thing, how did you solved the problem of the negative part of the signal when you plug in the function generator?

johnag (author)  alejandroym934 months ago

check tis instructabel to giv you an idea:

How to make an Arduino oscilloscope probe by NeoRecasata

http://m.instructables.com/id/How-to-make-an-Arduino-oscilloscope-probe/

indeed it graph most part of the signal with the probe, but it keeps cutting a minimum part of the signal.

johnag (author)  alejandroym934 months ago

the signal needs to be "conditioned " to be between 0 and 5 volts before it is input into the arduino analog input. You may need to attenuate the signal and float it on a dc voltage. Use two resistors in series connect one end to ground and the other to the 5 volt arduino pin, connect a capacitor to the junction and to your function generator. Connect a jumper from the junction to the analog pin. This will float the waveform on a dc of 2.5 volts. You can use two 1 meg resistors and a .47 micro farad capacitor. Remember the voltage. From your function generator has to be 5 volts peak to peak,if it is not, you. Will need to attenuate it using a potentiometer..

thank you a lot man, it worked perfectly:)

johnag (author)  alejandroym934 months ago

glad to help...click the I made it button and share a picture if you want...

johnag (author)  alejandroym934 months ago
Use a voltage divider and a capacitor at the input.
Jan_Henrik4 months ago

Awesome project, I love it!!!

johnag (author)  Jan_Henrik4 months ago

thanks...you've got some awesome projects too!

Jan_Henrik johnag4 months ago

Thank you! :)

Mr. E4 months ago

Nicely done ! Something every work bench should have.

johnag (author)  Mr. E4 months ago

Thanks Mr. E, By the way, I tried your http://www.instructables.com/id/Donut-Protection-Device-Advanced-Arduino-Technique/ , another awesome project, thanks for sharing

OK I see where the pins go, from the PDF it did not show this and now looking at your design on the Instructables Interweb site I must have been off in well thanks and sorry to have bothered you.

Jim

murfmv4 months ago

Johnag, Thought I was having trouble compiling because of different Arduino versions, but then realized where are the libraries after the include statement and also problems cutting and IDE code. It's up and running and can't to test something. Always wanted an oscilloscope, now I have one and will be following ur blog.

Great Job!!

johnag (author)  murfmv4 months ago

Glad you worked out the problem. Take a picture, and click on the I made it button! Have fun using it.

dustint20045 months ago

Sooo. If you have specific parameters already set.

Does PC still need to be connected to test or capture data?

johnag (author)  dustint20044 months ago

no it doesn't need to be connected to the PC, and you can vary some of the parameters with the touch screen buttons.

murfmv4 months ago

Hello Johnag,

Great thing I'm unable to compile your program in version 1.05 after running the TFT examples. I've gotten no errors, but suspect that might be the problem. I'm certainly looking forward making this work!

30-065 months ago

Could this read from 10Hz to 20kHz?

johnag (author)  30-065 months ago

Probably not without an external ADC due to the limitations of the Arduino. But, the fundamentals of human voices are roughly in the range of 80 Hz to 1100 Hz, so you can use it to monitor voice patterns for stress and lie detection. The audio range of the human ear is from 20 hz to 20 khz which, I presume, is what you want to monitor.

I haven't finished tweaking the code, so if I figure out a way to increase the bandwidth without additional hardware I will update the instructuble.

grumpyboots5 months ago

what would be the usable limits for this scope, without dividers and such I mean?

Volts peak to peak etc

freq?

johnag (author)  grumpyboots5 months ago

The Oscilloscope bandwidth is limited to about 1 khz

The input is limited to a 5volt peak to peak waveform, unless you use a voltage divider at the input, and also limited to positive waveforms from 0 to 5 volts.

you can build an oscillator with a 555 timer IC and watch square and triangle waves, or you you can use a thermistor with a resistor to see temperature changes, or with a photo resistor to see light variations or just touch the probe and you should the a sine wave from the electrical power. at 60 hz if you are in the states, 50 hz if you live in europe. have fun!!!

bob30305 months ago
Interesting thanks for posting.
johnag (author)  bob30305 months ago

you're. Welcome

Treknology5 months ago

A very nice little project. I still use a 20MHz analog scope for most of my work, although if working in lower frequency ranges, your project would save considerable electricity.

I'm actually proposing a reverse project. I have some old 6" (maybe only 4") black & white TVs that are useless in the digital age (the don't even have composite inputs). As many people with CROs who don't know how to use them properly and ultimately end up wasting them by attaching them to the stereo, I'm going to convert these TVs into "sloppy" CROs for just that purpose!

johnag (author)  Treknology5 months ago

thanks, and good luck with your projects, if you do make them, share them I'd lik to see them.

Nice project. I think your scope could really use an adjustable trigger so that the waveform is not jumping all over the screen. A good trigger is hard to design though. Ideally you would use an interrupt input to trigger sampling, but that would require an external comparator an reference. The next best way would be to sample at the highest rate and do a compare to detect the threshold crossing. Then start sampling at the scope rate. Don't change the avr sample rate, just drop the samples you don't need. This will probably work for slow moving input signals, but will fall apart as you approach the avr sampling rate.
johnag (author)  dirty_valentine5 months ago

the scope has a software trigger, but you're right maybe I'll. try some thing like what you suggest, but my proggramimg skills aren't that great.

alzie5 months ago

Scool project!

Its tough making a good scope.

Also, check out:

http://www.seeedstudio.com/depot/DSO-Nano-v3-p-135...

I have their V2 nano scope.

Works well, i love it, is portable, and

is isolated from the AC line for power measurements.

1-40 of 54Next »