You are on page 1of 12

DEPARTMENT OF

ELECTRONICS AND COMMUNICATION ENGINEERING


Faculty of Engineering and Technology, SRM University.
MINI PROJECT REPORT
ODD Semester, 2016-17
Lab code & Name

EC1019A Processor Lab

Year & Semester

III Year, V sem

Project Title

Oscilloscope Using Arduino Testing PWM Waveform

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

Novelty in the project work


(2 marks)
Logic And Programming (4 marks)
Contribution to the project
(2 Marks)
Report writing (2 Marks)
Total (10 Marks)

Date:
Signature of Lab Supervisor

OSCILOSCOPE USING ARDUINO TESTING PWM WAVEFORM


OBJECTIVE:
The objective of the project is to measure the PWM waveform generated by an oscillator
using a oscilloscope made by an arduino.
ABSTRACT:
An oscilloscope is a type of electronic test instrument that allows observation of constantly
varying signal voltages, usually as a two-dimensional plot of one or more signals as a
function of time. Other signals (such as sound or vibration) can be converted to voltages
and displayed.
We have designed an Oscilloscope using PC and Arduino Board. The signal is first of all
fed to the Arduino Board where the analog signal is converted to a digital signal by the
ADC which is then serially outputted to the PC and is read by the Processing software via
the COM ports. Here the signal is read in the form of digital data but then is converted to
analog one by using the resolution of the ADC used by the Arduino Board. The Processing
software was then used to plot the signals on a graph.
INTRODUCTION:
An oscilloscope, previously called an oscillograph, and informally known as
a scope, CRO (for cathode-ray oscilloscope), or DSO(for the more modern digital storage
oscilloscope), is a type of electronic test instrument that allows observation of constantly
varying signal voltages, usually as a two-dimensional plot of one or more signals as a
function of time. Other signals (such as sound or vibration) can be converted to voltages
and displayed.
Oscilloscopes are used to observe the change of an electrical signal over time, such that
voltage and time describe a shape which is continuously graphed against a calibrated scale.
The observed waveform can be analyzed for such properties as amplitude, frequency,rise
time, time interval, distortion and others. Modern digital instruments may calculate and
display these properties directly. Originally, calculation of these values required manually
measuring the waveform against the scales built into the screen of the instrument.[3]
The oscilloscope can be adjusted so that repetitive signals can be observed as a continuous
shape on the screen. A storage oscilloscope allows single events to be captured by the
instrument and displayed for a relatively long time, allowing observation of events too fast
to be directly perceptible.

HARDWARE REQUIRED

1x Arduino

1x Breadboard

1x LED

1x 10k resistor

1x4.7k resistor

1x 1k resistor

1x 100nF electrolytic capacitor

Jumper cables

SOFTWARE REQUIRED

Arduino IDE
Processing IDE
CIRCUIT/COMPONENT SPECIFICATIONS:
Supply voltage (VCC)

5V DC

Supply current (VCC = +5 V)

13-15 mA

Output current (maximum)

200 mA

Power consumption (minimum operating)

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.*;

Serial port; // Create object from Serial class


int val;

// Data received from the serial port

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 getY(int val) {


return (int)(height - val / 1023.0f * (height - 1));
}

int getValue() {
int value = -1;
while (port.available() >= 3) {
if (port.read() == 0xff) {
value = (port.read() << 8) | (port.read());
}
}
return value;
}

void pushValue(int value) {


for (int i=0; i<width-1; i++)
values[i] = values[i+1];
values[width-1] = value;
}
6

void drawLines() {
stroke(255);

int displayWidth = (int) (width / zoom);

int k = values.length - displayWidth;

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 :

Potentiometer (Pot) is another class of variable resistors and is used as an adjustable


voltage divider. It consists of a fixed resistance track having connections at both ends and a
sliding contact, called wiper, which moves along this track by turning the spindle.
CAPACITORS:

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

OSCILLOSCOPE USING ARDUINO TESTING PWM WAVEFORM


S.SATHYANARAYAN RA1411004010118
SASHIDHAR ANBU RA1411004010118

12

You might also like