Help me to make oscilloscope using Arduino mega2560

How to make simple oscilloscope using arduino mega2560 which detects the three types of waves

1)Sine wave
2)Square wave
3)triangular wave

and also measure its amplitude and frequency or Timeperiod.

Thatz my academic project. I am beginner so help me......

Nice, I have the same idea :wink:
A simple 2 channel Oscilloscope with Arduino Mega and a A 2.4″ TFT touchscreen shield.
I'm still waiting for the parts I've ordered on ebay

Which kind of display you want to use for your project?

What range of frequency and amplitude?

How to make simple oscilloscope using arduino mega2560 which detects the three types of waves

An oscilloscope will detect ALL types of waveform. What makes you think an oscilloscope will only detect a few?
Doesn't bode well for your project.

Have you seen this?
http://www.negtronics.com/simplot

Besides using analogRead() to take measurements (at a slow 110uS/sample rate) your use of the term "oscilloscope" also implies a display - what are you planning there?

I'd suggest using a fast external SPI ADC that can take fast samples and transfer them to the Arduino using 4 or 8 MHz SPI speed. Then you can display them on a screen with SPI interface as well.
Perhaps an OLED or TFT display

Check Adafruit.com, maybe this for a display:
Gameduino 2 with 4.3 480x272 Display and Touchscreen : ID 1654 : $69.95 : Adafruit Industries, Unique & fun DIY electronics and kits

ADC example:

Read a 12-bit sample:

digitalWrite (csPin, LOW); // use direct port manipulation to speed this up:
                                      // say D10 was used: PORTB = PORTB & 0b11111011;
byte1 = SPI.transfer(0);
byte2 = SPI.transfer(0);
digitalWrite (csPin, HIGH); // say D10 was used: PORTB = PORTB | 0b00000100;
// put the bytes together, See Figure 3
// http://www.ti.com/lit/ds/symlink/adcs7476.pdf
int 12bitData = (byte1<<8) | byte2; // Or maybe (byte1<<8) + byte2 ?? Try both ways

That will capture a sample in about 8-10uS ,with SPIdivisor set to (2) for 8 MHz transfer speed, for a max 100K to 125K sample rate, with max speed determined by how long your code took to send the data to the display.

You may also find something useful in this Girino Instructable

...R

Do you have any specific voltage or frequency requirements?

You may be able to do something "simple" to view waveforms with limited/constrained voltages & frequencies, but I would NOT attempt to build a general-purpose 'instrument'. I wouldn't try to build a multimeter either, but if you need to measure a voltage or current within a known range for a specific purpose (such as a voltage in a thermostat that's proportional to the temperature) that's OK.

This is not really a beginner project... Do you have any electronics or programming experience?

OK, Like any project, take it one step at a time... Start by measuring voltage. The Arduino's analog-to-digital converter has 5V and 1.1V references built-in.

The Arduino can be damaged by voltages higher than 5V and by negative voltages. If you'll be connecting to unknown voltages, you'll need to protect the inputs. Assuming you want to measure negative voltages, you'll need to bias the input (then you simply subtract-out the bias in software).

If you buy an oscilloscope probe, note that most probes are "10X" which means there's a 1/10 voltage divider inside the probe... If you're getting 5V out, you're putting 50V in. Tektronics 'scopes(and I assume others) will detect the 10X probe and adjust the display accordingly for an accurate display.

Once you can measure voltage you are measuring amplitude.

Then, you'll need to learn to display graphics (on an LCD screen, I assume).

In order "capture" a waveform, you need to sample the voltage at known intervals (a known sample rate). Once you've captured an array of voltage readings, you can plot the array and you have a waveform display.

To calculate the frequency, find the zero-crossings and calculate the time-period between two consecutive positive-going zero-crossings (or between two consecutive negative-going zero-crossings). The frequency is the inverse of the period. If the waveform is not centered around zero, you can find and use the mid-amplitude point. (This will only work for "nice" regular-simple single-frequency waveforms.)