Académique Documents
Professionnel Documents
Culture Documents
Living
Outside
Play
Technology
Workshop
Make an Oscilloscope Using the SainSmart Mega2560 with the TFT LCD shield
and the 3.5 "color touch screen
by johnag on July 19, 2013
Table of Contents
Make an Oscilloscope Using the SainSmart Mega2560 with the TFT LCD shield and the 3.5 "color touch screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Intro: Make an Oscilloscope Using the SainSmart Mega2560 with the TFT LCD shield and the 3.5 "color touch screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
Intro: Make an Oscilloscope Using the SainSmart Mega2560 with the TFT LCD shield and the 3.5 "color touch screen
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.
Our 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.
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
Image Notes
1. SainSmart 3.2" TFT LCD Display is a LCD touch screen module.
2. SainSmart Mega 2560
3. SainSmart 3.2 inch LCD shield
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
Image Notes
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
1. press the buttons and you should see them at the bottom of the display
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
y=myTouch.getY();
delay(500);
if ((y>=1) & (y<=50)) // Delay row
{
if ((x>=250) & (x<=300)) // Delay Button
waitForIt(250, 1, 310, 50);
mode= mode ++ ;
{
myGLCD.setColor(255, 0, 0);
myGLCD.drawRoundRect (250, 1, 310, 50);
// Select delay times
if (mode == 0) dTime = 0;
if (mode == 1) dTime = 1;
if (mode == 2) dTime = 2;
if (mode == 3) dTime = 5;
if (mode == 4) dTime = 10;
if (mode == 5) dTime = 20;
if (mode == 6) dTime = 30;
if (mode == 7) dTime = 50;
if (mode == 8) dTime = 100;
if (mode == 9) dTime = 200;
if (mode == 10) dTime = 500;
if (mode > 10) mode = 0;
}}
if ((y>=70) & (y<=120)) // Trigger row
{
if ((x>=250) & (x<=300)) // Trigger Button
waitForIt(250, 55, 310, 105);
tmode= tmode ++;
{
myGLCD.setColor(255, 0, 0);
// Select Software trigger value
myGLCD.drawRoundRect (250, 55, 310, 105);
if (tmode == 1) Trigger = 0;
if (tmode == 2) Trigger = 10;
if (tmode == 3) Trigger = 20;
if (tmode == 4) Trigger = 30;
if (tmode == 5) Trigger = 50;
if (tmode > 5)tmode = 0;
}}
if ((y>=130) & (y<=180)) // H position row
{
if ((x>=250) & (x<=300)) // H position Button
waitForIt(250, 110, 310, 160);
hpos= hpos ++;
{
myGLCD.setColor(255, 0, 0);
myGLCD.drawRoundRect (250, 110, 310, 160);
myGLCD.clrScr();
buttons();
if (hpos > 60)hpos = 50;
}}}}
//----------wait for touch sub
void waitForIt(int x1, int y1, int x2, int y2)
{
while (myTouch.dataAvailable())
myTouch.read();
}
//----------draw grid sub
void DrawGrid(){
myGLCD.setColor( 0, 200, 0);
for( dgvh = 0; dgvh < 5; dgvh ++){
myGLCD.drawLine( dgvh * 50, 0, dgvh * 50, 240);
myGLCD.drawLine( 0, dgvh * 50, 245 ,dgvh * 50);
}
myGLCD.drawLine( 245, 0, 245, 240);
myGLCD.drawLine( 0, 239, 245, 239);
myGLCD.setColor(255, 255, 255);
myGLCD.drawRoundRect (250, 1, 310, 50);
myGLCD.drawRoundRect (250, 55, 310, 105);
myGLCD.drawRoundRect (250, 110, 310, 160);
myGLCD.drawRoundRect (250, 165, 310, 215);
}
// ------ Wait for input to be greater than trigger sub
void trigger(){
while (Input < Trigger){ Input = analogRead(A0)*5/100;
}}
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/
Mini Arduino
environment
monitor **
UPDATE Added RTC ***
by johnag
Mini Arduino
Multi Function
Controller w/
LCD Display by
johnag
Make a Mini
Arduino
programmable 4
channel DCDVM by johnag
Mini Arduino
Portable EEG Brain Wave
Monitor + by
johnag
Your Image on
an Arduino! TFT LCD Screen
Guide by
Qtechknow
Arduino
"Talking" Temp
/ Humidity on a
TFT LCD w/
relays by
sspence
Advertisements
Comments
2 comments
Add Comment
carlos66ba says:
johnag says:
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/