Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
289 views

PC Based Oscilloscope Using Arduino

This document describes how to build a low-cost oscilloscope using an Arduino board and a PC. The Arduino board samples input signals using its analog-to-digital converter and transmits the data to the PC via USB. A Windows application then plots the signal as a waveform on the PC screen. The setup allows users to visualize signals up to 5kHz and is inexpensive compared to a standalone oscilloscope.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
289 views

PC Based Oscilloscope Using Arduino

This document describes how to build a low-cost oscilloscope using an Arduino board and a PC. The Arduino board samples input signals using its analog-to-digital converter and transmits the data to the PC via USB. A Windows application then plots the signal as a waveform on the PC screen. The setup allows users to visualize signals up to 5kHz and is inexpensive compared to a standalone oscilloscope.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Do-it-yourself Sa

Th ni
eo

PC-Based Oscilloscope
Using Arduino
Ramalingam Balaji

O
scilloscopes are an essential
tool for electronics hobbyists
and professionals to verify

AREF
GND
13
12
11
10
9
8

7
6
5
4
3
2
TX 1
RX 0
that their designs would work as ex- ARDUINO DIGITAL

DRIVER
pected. PC-based oscilloscopes score

USB
ATMEGA328

over standalone oscilloscopes due to TO USB

POWER
ANALOG

INPUT

IOREF
their compact size, low cost and abil-

GND
GND
3.3V
RST

Vin

A0
A1
A2
A3
A4
A5
5V
ity to do offline analysis.
Here we describe how you can BOARD1
make your own oscilloscope at a LAPTOP
very low cost using your PC and an D2
D1
Arduino board as the hardware for 1N4148 R1 1N4148
10K
signal acquisition. You can use this
oscilloscope to capture frequency sig- CON1
nals up to 5kHz. The Arduino board, INPUT

the heart of the oscilloscope, reads Fig. 1: Circuit of the PC-based oscilloscope using Arduino
the values from its inbuilt analogue-
to-digital converter (ADC) and
pushes these to the PC via USB port.
We have provided here an Arduino
sketch, which you can compile and
load directly to the Arduino. You also
need to install an executable file or
application in your Windows PC. This
application works as the front-end to
plot input signals as waveforms on
your computer screen.
The Arduino board consists of
Atmel’s AVR microcontroller, which
can be 8-, 16- or 32-bit based on the
type of the board. For this project you
can use any variant of the Arduino as
hardware. The AVR microcontroller Fig. 2: Message on the screen when the PC-based scope is run for the first time
has an inbuilt ADC. In the project we
use pin A0 to capture the input signal. loscope is limited by the baud rate Fig. 1. The Arduino board connects
The captured input signal is fed to of the UART. The Arduino sketch is to your laptop or PC via the USB
UART via UART-USB converter in the coded to read the ADC using ISR, cable. Any external power supply
Arduino to the PC. A virtual COM and the UART baud rate is config- for the board is not required as the
port is created by Windows whenever ured at 115200, which sends data at board is powered by the USB only.
the Arduino connects to the PC. A 85µs intervals. This gives an effec- Connect switching diodes (D1 and
Windows-based application developed tive sampling rate of 12kSa/s. D2) as input protection circuit to
using NI LabWindows opens up the pin A0 of the Arduino’s ADC. You
virtual COM port and starts plotting Construction need Arduino sketch (pcscope.ino)
signals visually using Graph libraries. The PC scope set-up is quite simple and PC software or executable file
The sampling speed of the oscil- and straightforward as shown in (PCScope.exe) in order to use this

www.efymag.com Electronics For You | JUne 2017 127


Do-it-yourself
circuit. Install PCScope. which is much faster
exe program (developed than the UART data trans-
by author) in your Win- fer rate.
dows PC and open the PC software. As
application. Next, open stated earlier, the front-
the Arduino sketch from end PC software for
Arduino IDE and compile signal acquisition and
the sketch. Connect the processing is developed
Arduino board to the PC using NI LabWindows.
and flash the sketch into The serial port data is
the microcontroller on captured through Arduino
the Arduino board. at regular time intervals
The ADC of Arduino Fig. 3: Message after the hardware successfully connects to the PC and plotted as a graph
can measure voltages up on the screen using the
to 5V. So it is advisable Plot function library. The
to add a small protection display points along X-
circuit to limit the input axis are calculated based
voltage to 5V and clamp on the user-defined time
the negative voltage. A scale. The Y-axis range
low-power, fast-switching is set using the voltage
diode like 1N4148 can be selection control.
used to protect the input
pin. Connect a 10-kilo- Testing
ohm resistor in series After installing the PC
with the input. It will scope application, click
work as a current limiter ‘Connect’ button on your
in case the input goes PC screen to connect to
beyond 5V. Additional Fig. 4: Test signal of 525Hz square waveform captured on the screen the Arduino board (Fig.
voltage dividers can be 2). When the board gets
used in case you need to connected to your PC, you
measure voltages higher will get a confirmation
than 5V. message for three seconds
as shown in Fig. 3.
Software Feed any squarewave
Arduino sketch. The input of up to 5kHz at
sampling rate of this PC CON1. The software must
scope application is lim- plot its output waveform
ited by the rate at which on your PC. Square and
the data is sent to the PC. triangular output wave-
Baud rate of 115000 gives forms of 525Hz and
time interval of around 530Hz captured on the
85 µs. It is important to screen during testing are
get the ADC signals much Fig. 5: Test signal of 530Hz triangular waveform captured on the screen shown in Figs 4 and 5,
before this time to get re- respectively. Similarly,
liable data plotting. The sketch reads the prescaler to 16. With this, you you can feed rectangular or pulse
pin A0 of Board1 and sends to UART get ADC conversion every 20µs, inputs (but not sine waves) to get
at 115200 baud rate. At this speed, output waveforms.
bytes of the input are pushed at time
intervals of around 85µs.
By default, the ADC configuration efy Note The author is a program
The source code of manager at Robert Bosch,
of the Arduino gives samples every Bengaluru. He has filed several
this project is patents in automotive electronics
116µs. So here the ADC is configured included in this and published papers in SAE
with additional lines of code to get month’s EFY DVD and conferences and several
international magazines
samples faster than 85µs by setting is also available for free
download at source.
128 June 2017 | Electronics For You efymag.com www.efymag.com

You might also like