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 59Next »
Whitmore12 made it!26 days ago

Great Instructable! It got me thinking and I decided to make my own PipBoy from it!

MyPipBoy.jpgOscilloscope.jpgPipboyOscope.jpg
johnag (author)  Whitmore1226 days ago
Cool, thanks forsharing..
grumpyboots made it!6 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)  grumpyboots6 months ago

Cool grumpyboots.. thanks for sharimg!

Looks more complicated the it is. The Lego enclosure is a nice touch!

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.

johnag (author)  DavidPatterson24 days ago

Sorry for the delay in responding. Thanks for your comment. I don't know the refresh rate of the screen, haven't checked the specs in detail. It would definitely improve the scope if you could increase the bandwidth by using your design. If you get the kit and try your concepts on it , please share.. If I have time I might try it myself..Again thanks.

Hi,

I ordered the lcd a month ago- apparently it is somewhere between China and the uk.

In the mean time I have developed code which runs at

237.3 Khz, with configurable software triggering.

http://forum.arduino.cc/index.php?PHPSESSID=3e1pvs...

I have also written software which runs at 1.2MHz using a TLV571, also with software triggering.

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 Santana2 months 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 Santana2 months 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);

rroque53 months ago

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

johnag (author)  rroque53 months ago

I don't.think. so, sorry

rroque5 johnag3 months ago

Thanks!

alejandroym935 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)  alejandroym935 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)  alejandroym935 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)  alejandroym935 months ago

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

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

Awesome project, I love it!!!

johnag (author)  Jan_Henrik5 months ago

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

Jan_Henrik johnag5 months ago

Thank you! :)

Mr. E5 months ago

Nicely done ! Something every work bench should have.

johnag (author)  Mr. E5 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

murfmv6 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)  murfmv6 months ago

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

dustint20046 months ago

Sooo. If you have specific parameters already set.

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

johnag (author)  dustint20046 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.

murfmv6 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-066 months ago

Could this read from 10Hz to 20kHz?

johnag (author)  30-066 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.

grumpyboots6 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)  grumpyboots6 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!!!

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

you're. Welcome

1-40 of 59Next »