Arduino Oscilloscope Projects 2015.pdf

(7556 KB) Pobierz
Arduino
Oscilloscope
Projects
Robert J Davis II
Arduino Oscilloscope Projects
Copyright 2015 by Robert J Davis II
All rights reserved
In essence this is a continuation of my previous book “Arduino LCD Projects” where I introduced
many LCD screens and the CA3306 fast analog to digital converter to make a fast 5 MSPS
oscilloscope. A magazine article about the Arduino and CA3306 based oscilloscope created so much
interest that I decided to write a book showing some of the most popular analog to digital converters
and some of the most popular LCD screen’s together in Oscilloscope, and logic analyzer, types of
applications. Some chapters of this book repeat some of the designs that were found in the “Arduino
LCD Projects” book.
Years ago, as a teenager, I tried many times to build an oscilloscope. However I never had a working
oscilloscope until I built one as part of my CIE training. Then in my book “Digital and Computer
Projects” I introduced the concept of a parallel port PC based oscilloscope. I even designed a circuit
board for it. However the parallel port is now history and USB is where things are at. Along came
the Arduino and it is the basis for a simple USB oscilloscope.
There are many fast analog to digital converters that I want to cover in this book. There are some fast
analog to digital converters that can operate at speeds of 50 MSPS (Million Samples Per Second) or
even faster. Since the Arduino Uno is not nearly that fast, those analog to digital converters must be
used with a FIFO (Fist In First Out) high speed memory buffer,
The use of fast analog to digital converters with an LCD screen to make an oscilloscope is an area
that raises a lot of design questions. I hope to answer many of your questions in this book.
Once again the safe construction and operation of these devices is solely up to the reader. The reader
must take all safety precautions and accept responsibility for the safe operation of these devices.
There are no guarantees implied with the circuit designs and software programs that are found within
this book.
The most important thing is to have fun! Try out some circuits and see what you like. Make your
own hardware and software improvements. I am sure you can come up with better designs!
Table of Contents.
1. Overview of Arduino Uno Oscilloscopes
Internal analog to digital converter
External analog to digital converter
FIFO and External analog to digital converter
2. Analog Input Section Design
TL082 or LF353
AD744 and NE5532
3. Fast Analog to Digital Converter
CA3306
CA3318
AD775
AD8703
TLC5510
Synchronizing the Clocks
4. Monochrome LCD - QC12864B
Internal Analog to Digital Converter
Six Channel Logic Analyzer
External Analog to Digital Converter
5. Serial Color LCD - 1.8TFT SPI
Internal Analog to Digital Converter
External Analog to Digital Converter
6. Parallel Color LCD - TFT240_262K
Internal Analog to Digital Converter
Six Channel Logic Analyzer
External Analog to Digital Converter
7. Serial Color LCD - 2.2 to 2.8 SPI
Internal Analog to Digital Converter
External Analog to Digital Converter
8. Putting the Oscilloscope into a Case
Bibliography
Chapter 1
Overview of Arduino Oscilloscopes
There are basically three types of Arduino Uno based oscilloscopes. First you can use the built in
analog to digital converter but modify its timing to make it much faster. Secondly you can add a fast
external analog to digital converter with either 6 or 8 bits of accuracy depending on if you use port C
or port D. The third type uses a FIFO (First in First Out) buffer to sample data at speeds faster than
the Arduino can operate at.
This is the block diagram of the first type of oscilloscope. For this type of oscilloscope you typically
apply the buffered signal to A0. With software modifications to the clock timing setup of the built in
analog to digital converter you can achieve 100,000 samples per second or .1 MSPS.
Here is the code to change the clock settings in order to speed up the Arduino’s internal analog to
digital converter by a factor of almost 16. The change will reduce the accuracy of the converter.
This code will clear the most significant bit of the three timing control bits. To do that, add this code
right after the “void loop() {”.
// Clear bit 2 of ADC pre-scalier from 125KHz to 2 MHz
ADCSRA &= ~(1 << ADPS2);
For the next type of oscilloscope we add an analog to digital converter and use the parallel input
command for speeds up to 5 million samples per second. The PINC (Parallel Input Port C) command
uses A0 to A5. The PIND (Parallel Input Port D) command uses D0 to D7.
There are two variations to the external analog to digital converter setup. The first uses A0 to A5 and
is hence it is limited to only six bits. This is an ideal setup for the CA3306 as it is a six bit converter.
You can use an eight bit converter but only connect the top six outputs. That is to say D7 becomes D5,
D6 becomes D4, etc. To rapidly read the contents of the six analog inputs the “PINC” command is
Zgłoś jeśli naruszono regulamin