Arduino Oscilloscope Project
Arduino Oscilloscope Project
Project Title
Lab Supervisor
S.Bashyam
Assistant professor
Electronics and Communication Department
Team Members
S.SATHYANARAYAN RA1411004010008
SASHIDHAR ANBU RA1411004010118
Reg. No
Mark split up
RA1411004010008
RA1411004010118
Date:
Signature of Lab Supervisor
HARDWARE REQUIRED
1x Arduino
1x Breadboard
1x LED
1x 10k resistor
1x4.7k resistor
1x 1k resistor
Jumper cables
SOFTWARE REQUIRED
Arduino IDE
Processing IDE
CIRCUIT/COMPONENT SPECIFICATIONS:
Supply voltage (VCC)
5V DC
13-15 mA
200 mA
30 mW@5V
Operating temperature
0 to 70 C
CIRCUIT DIAGRAM:
DESIGN ISSUES:
Efficient only on a short scale.
No customization.
Noise signal.
APPROACH/METHODOLOGY:
The major components in this project are Arduino microcontroller and Processing
software. The Arduino 0 and GND pins are connected to the the PWM output . Here the
PWM is used to test the working of the oscilloscope. It uses a pot of 100kohms to vary the
waveform using the 555 timer I. It is powered by a 9V battery.
The Arduino sedns the data received from these two ports to the pc using the write function
where the processing software reads the data and then plots the graph. In the 555 timer the
diodes and the pot play a major role in changing the width of the signal. When it is varied
the amount of current going to port 6 is varied. The diodes help in only sending one side of
the pots current. As the voltage going to the pin 6 is varied the width of the signal is
controlled by the 555 timer ic.
PROGRAM CODE:
Arduino:
#define ANALOG_IN 0
void setup() {
Serial.begin(9600);
//Serial.begin(115200);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.write( 0xff );
Serial.write( (val >> 8) & 0xff );
Serial.write( val & 0xff );
}
Processing:
import processing.serial.*;
int[] values;
float zoom;
void setup()
{
5
size(1280, 480);
// Open the port that the board is connected to and use the same speed (9600 bps)
port = new Serial(this, Serial.list()[0], 9600);
values = new int[width];
zoom = 1.0f;
smooth();
}
int getValue() {
int value = -1;
while (port.available() >= 3) {
if (port.read() == 0xff) {
value = (port.read() << 8) | (port.read());
}
}
return value;
}
void drawLines() {
stroke(255);
int x0 = 0;
int y0 = getY(values[k]);
for (int i=1; i<displayWidth; i++) {
k++;
int x1 = (int) (i * (width-1) / (displayWidth-1));
int y1 = getY(values[k]);
line(x0, y0, x1, y1);
x0 = x1;
y0 = y1;
}
}
void drawGrid() {
stroke(255, 0, 0);
line(0, height/2, width, height/2);
}
void keyReleased() {
switch (key) {
7
case '+':
zoom *= 2.0f;
println(zoom);
if ( (int) (width / zoom) <= 1 )
zoom /= 2.0f;
break;
case '-':
zoom /= 2.0f;
if (zoom < 1.0f)
zoom *= 2.0f;
break;
}
}
void draw()
{
background(0);
drawGrid();
val = getValue();
if (val != -1) {
pushValue(val);
}
drawLines();
CONCLUSIONS:
The Arduino with connected to a PC makes it easier to access and more affordable. It is
also easily transportable and only needs access of a PC therefore can be connected
anywhere without any bulk equipment
REFERENCES:
http://www.instructables.com/id/Arduino-Oscilloscope-poor-mans-Oscilloscope/
http://www.instructables.com/id/Simple-and-dirty-Pulse-Width-Modulation-PWM-Wi/
APPENDIX:
Arduino:
Arduino is an open-source project that created microcontroller-based kits for building digital
devices and interactive objects that can sense and control physical devices
POTENTIOMETER :
Capacitor is a passive component used to store charge. The charge (q) stored in a capacitor
is the product of its capacitance (C) value and the voltage (V) applied to it. Capacitors
9
offer infinite reactance to zero frequency so they are used for blocking DC components or
bypassing the AC signals.
RESISTOR:
Resistor is used in a circuit to limit the current flowing in it. It is a passive component.
According to ohms law, R=V/I.
DIODE:
A diode is a specialized electronic component with two electrodes called the anode and the
cathode. Most diodes are made with semiconductor materials such as silicon, germanium,
or selenium.
555 TIMER:
10
The 555 timer IC is an integrated circuit (chip) used in a variety of timer, pulse generation,
and oscillator applications. The 555 can be used to provide time delays, as an oscillator,
and as a flip-flop element. Derivatives provide up to four timing circuits in one package.
11
12