Digital Acquisition of Analog Signals A Practical Guide

Similar documents
Working with ADCs, OAs and the MSP430

Advantages of Analog Representation. Varies continuously, like the property being measured. Represents continuous values. See Figure 12.

EE 230 Lecture 39. Data Converters. Time and Amplitude Quantization

FYS3240 PC-based instrumentation and microcontrollers. Signal sampling. Spring 2017 Lecture #5

Chapter 7. Introduction. Analog Signal and Discrete Time Series. Sampling, Digital Devices, and Data Acquisition

Design with Microprocessors

Microcontroller Systems. ELET 3232 Topic 21: ADC Basics

PHYS225 Lecture 22. Electronic Circuits

The University of Texas at Arlington Lecture 10 ADC and DAC

FYS3240 PC-based instrumentation and microcontrollers. Signal sampling. Spring 2015 Lecture #5

Fundamentals of Data Converters. DAVID KRESS Director of Technical Marketing

Analogue Interfacing. What is a signal? Continuous vs. Discrete Time. Continuous time signals

Linear Integrated Circuits

Microprocessors & Interfacing

MOS (PTY) LTD. E Single Channel PIR Signal Processor. Applications. General Description. Features. Digital Sensor Assembly with E931.

Analog Input and Output. Lecturer: Sri Parameswaran Notes by: Annie Guo

OPERATIONAL AMPLIFIERS LAB

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS

Summary Last Lecture

DIGITAL SIGNAL PROCESSING. Chapter 1 Introduction to Discrete-Time Signals & Sampling

Design IV. E232 Spring 07

Generating DTMF Tones Using Z8 Encore! MCU

Direct Digital Synthesis Primer

Multiplexer Options, Voltage Reference, and Track/Hold Function

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

Analog to Digital Converters

DATASHEET. Amicrosystems AMI-AD1224 HIGH PRECISION CURRENT-TO-DIGITAL CONVERSION MODULE PRODUCT DESCRIPTION FEATURES

INTRODUCTION TO COMMUNICATION SYSTEMS LABORATORY IV. Binary Pulse Amplitude Modulation and Pulse Code Modulation

UNIT III Data Acquisition & Microcontroller System. Mr. Manoj Rajale

Application Circuits 3. 3V R2. C4 100n G PI O. 0 G PI O S e t u p d a ta G PI O. 5 G PI O M o t i o n I n t G PI O. 4 G PI O.

Design and Implementation of Digital Stethoscope using TFT Module and Matlab Visualisation Tool

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

Module 5. DC to AC Converters. Version 2 EE IIT, Kharagpur 1

AC Current click PID: MIKROE Weight: 27 g

LC 2 MOS Signal Conditioning ADC with RTD Current Source AD7711A *

USER MANUAL SERIAL IR SENSOR ARRAY5

Building a Microcontroller based potentiostat: A Inexpensive and. versatile platform for teaching electrochemistry and instrumentation.

Enhancing Analog Signal Generation by Digital Channel Using Pulse-Width Modulation

ADC Bit High-Speed µp-compatible A/D Converter with Track/Hold Function

Lecture 4: Basic Electronics. Lecture 4 Brief Introduction to Electronics and the Arduino

Data acquisition and instrumentation. Data acquisition

Measuring and generating signals with ADC's and DAC's

Digital to Analog Conversion. Data Acquisition

Homework Assignment 06

OPERATIONAL AMPLIFIER PREPARED BY, PROF. CHIRAG H. RAVAL ASSISTANT PROFESSOR NIRMA UNIVRSITY

The Case for Oversampling

Working with ADCs, OAs and the MSP430

EET 223 RF COMMUNICATIONS LABORATORY EXPERIMENTS

4-Channel, 1 MSPS, 8-/10-/12-Bit ADCs with Sequencer in 16-Lead TSSOP AD7904/AD7914/AD7924

AN2668 Application note

EE445L Spring 2018 Final EID: Page 1 of 7

DATA INTEGRATION MULTICARRIER REFLECTOMETRY SENSORS

Introduction. sig. ref. sig

Data Acquisition Systems. Signal DAQ System The Answer?

24-Bit, 312 ksps, 109 db Sigma-Delta ADC with On-Chip Buffers and Serial Interface AD7764

Embedded Controls Final Project. Tom Hall EE /07/2011

Advanced Lab LAB 6: Signal Acquisition & Spectrum Analysis Using VirtualBench DSA Equipment: Objectives:

LLRF4 Evaluation Board

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

LC 2 MOS Loop-Powered Signal Conditioning ADC AD7713

AN3137 Application note

ME 461 Laboratory #3 Analog-to-Digital Conversion

Cyber-Physical Systems ADC / DAC

10. Chapter: A/D and D/A converter principles

Digital Design Laboratory Lecture 7. A/D and D/A

Data Conversion Circuits & Modulation Techniques. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

LAB #7: Digital Signal Processing

Analog Interface 8.1 OVERVIEW 8 1

Electronics II Physics 3620 / 6620

EM Arduino 4-20mA Shield Documentation. Version 1.5.0

5 V, 14-Bit Serial, 5 s ADC in SO-8 Package AD7894

8-Bit, high-speed, µp-compatible A/D converter with track/hold function ADC0820

Brushless DC motor controller

The Battle for Data Fidelity:Understanding the SFDR Spec

Analog-to-Digital Converter (ADC) And Digital-to-Analog Converter (DAC)

P a g e 1 ST985. TDR Cable Analyzer Instruction Manual. Analog Arts Inc.

II Year (04 Semester) EE6403 Discrete Time Systems and Signal Processing

EE251: Tuesday October 10

High Common-Mode Voltage Programmable Gain Difference Amplifier AD628

Interfacing to Analog World Sensor Interfacing

Tones. EECS 247 Lecture 21: Oversampled ADC Implementation 2002 B. Boser 1. 1/512 1/16-1/64 b1. 1/10 1 1/4 1/4 1/8 k1z -1 1-z -1 I1. k2z -1.

Analog to Digital Conversion

ECE 231 Laboratory Exercise 3 Oscilloscope/Function-Generator Operation ECE 231 Laboratory Exercise 3 Oscilloscope/Function Generator Operation

16-Channel, 1 MSPS, 12-Bit ADC with Sequencer in 28-Lead TSSOP AD7490

Lecture 14 Interface Electronics (Part 2) ECE 5900/6900 Fundamentals of Sensor Design

Module 13: Interfacing ADC. Introduction ADC Programming DAC Programming Sensor Interfacing

Considerations for Analog Input and Output

Community College of Allegheny County Unit 7 Page #1. Analog to Digital

APPLICATION NOTE. Atmel AVR127: Understanding ADC Parameters. Atmel 8-bit Microcontroller. Features. Introduction

P a g e 1. Introduction

Data Acquisition: A/D & D/A Conversion

Department of Electronics & Telecommunication Engg. LAB MANUAL. B.Tech V Semester [ ] (Branch: ETE)

Summary Last Lecture

Michael F. Toner, et. al.. "Distortion Measurement." Copyright 2000 CRC Press LLC. <

4 x 10 bit Free Run A/D 4 x Hi Comparator 4 x Low Comparator IRQ on Compare MX839. C-BUS Interface & Control Logic

MCP3909. Energy Metering IC with SPI Interface and Active Power Pulse Output. Features. Description. Package Type

Eliminate Pipeline Headaches with New 12-Bit 3Msps SAR ADC by Dave Thomas and William C. Rempfer

CHAPTER ELEVEN - Interfacing With the Analog World

Energy Metering IC with SPI Interface and Active Power Pulse Output. 24-Lead SSOP HPF HPF1. Serial Control And Output Buffers HPF1

System on a Chip. Prof. Dr. Michael Kraft

Transcription:

Digital Acquisition of Analog Signals A Practical Guide Nathan M. Neihart Senior Design Presentation

Motivation A common task for many senior design projects is to interface an analog signal with a digital system The digital system will typically be a microcontroller MSP430 Arduino Mega There are several important considerations that need to be made when performing this type of interface Voltage levels Interface circuits Sampling rates

Outline Resolution and Dynamic Range Sampling Rate Some Common Applications

Interfacing with the ADC The analog-to-digital converter takes an analog signal as an input and generates a digital number as the output ADC 000, 001, 101,... The ADC has 3 important characteristics Reference Voltage The maximum voltage that can be converted Resolution The minimum voltage change that can be detected Sampling Rate The time interval between consecutive samples We will discuss each of these in detail 4

Interfacing with the ADC All voltages are measured w.r.t. some reference point Usually the reference point is ground or common Sometimes the reference point can be another voltage V IN + V 1 - V REF + V 0 - Earth ground is a direct connection to the physical earth Earth Ground Common is simply a reference point that is common to the entire circuit I + Some power supplies use earth ground as the reference and others use a common terminal as the reference Common Terminal V 0-5

Resolution and Dynamic Range 6

Digital Code Resolution and Voltage Levels The reference voltage is the maximum voltage that the ADC can convert The minimum voltage is typically 0 V The resolution of the ADC is the smallest voltage change that can be measured 111 110 101 100 011 010 001 000 LSB 0 V Analog Input Voltage (V) REF V LSB = V ref 2 N 1 V ref Reference voltage in V N Word width of ADC output 7

Resolution and Voltage Levels Resolution of the ADC System Voltage = ADC Reading Analog Voltage Measured Given an analog voltage, we can compute the expected digital output D N = V in 2 N 1 V ref D N is an N-bit digital word V in is the analog input voltage Given the ADC digital output, we can compute the expected analog input V in = V ref 2 N 1 D N If V in V ref then D N is all ONEs If V in 0 then D N is all ZEROs 8

Resolution and Voltage Levels In order for your ADC to function properly, your analog input signal must be within range of the ADC reference voltage Pay attention to circuits that require dual-polarity power supplies V DD V DD V REF V REF ADC Amp GND GND DC Offset 0 V DD V DD V REF V REF ADC Amp V SS 0 GND 9

Resolution and Voltage Levels 10

Resolution and Voltage Levels You may not always have the ability to control the DC offset of your analog source You can shift the average value (or DC offset) of your input signal externally using an op-amp R 2 V OUT = V IN R 2 R 1 + V DC R 2 R 1 + 1 V IN C DC R 1 V OUT To avoid saturating the output: V DC V SS + V in,max R 2 R 1 V 1 + R 2 ΤR DC 1 V DD V in,max R 2 1 + R 2 ΤR 1 R 1 11

Resolution and Voltage Levels Maximum resolution will only be achieved with fullscale input V REF For inputs with fixed amplitude Increase gain before ADC Set the correct V REF 1-bit Resolution 0 MSP432 ATmega328 1.2 V Av cc (5 V) 1.45 V 1.1 V 2.5 V Externally Set Externally Set V REF 3-bit Resolution 0 12

Resolution and Voltage Levels For inputs with large dynamic range Variable gain block will provide best resolution Gain is controlled by ADC output D 8 0b11111xxx then decrease gain D 8 0b00000xxx then increase gain 0. 03V ref V in G 0. 97V ref R N ADC output is now dependent on the gain The MCU must know the current value of gain G V in = V ref 2 N 1 D N V IN R 1 R B R A Switch Controlled by MCU ADC R A < R B < < R N 13

Resolution and Voltage Levels The analog supply voltage may be larger than the ADC supply voltage This is okay if the analog signal is still within safe operating limits of the ADC During power up or for invalid inputs the analog signal may exceed safe operating voltages for the ADC You should limit (or clamp) the analog input signal The output is limited to: V L V OUT V H R is required to limit the current flowing into the output of the op-amps V IN R To ADC V H V L 14

Resolution and Voltage Levels V IN >V H R V H V H V L VIN<V L R V L V H V L 15

Sampling 16

ADC Sampling Rate One of the most important characteristics of the ADC is the sampling rate The sampling rate must be at least twice the highest frequency of interest If the sampling rate is too low you will get aliasing Aliasing is an effect that causes signals with different frequencies to become indistinguishable 17

ADC Sampling Rate Video taken from: https://www.youtube.com/watch?v=vll-t4z_tno 18

ADC Sampling Rate Sweep the frequency of a sinusoidal signal from 20 Hz to 15 khz Sine wave sampled at f S = 44. 1 khz No aliasing Sine wave sampled at f s = 10 khz Aliasing at high frequencies Saw tooth wave sampled with f S = 30 khz Why is there still aliasing at high frequencies? 19

ADC Sampling Rate bm The Fourier series expansion for the Saw tooth wave: Sampling Frequency f t = 2 π m=1 sin mωt m bm 1 2 3 4 5 6 7 m(ωt) Sampling Frequency 3 4 6 7 5 1 2 3 4 5 6 7 m(ωt) 20

ADC Sampling Rate When choosing a sampling rate you must know something about the frequency content of your signal An anti-aliasing filter should be used to limit the bandwidth LPF V IN f c = f s /2 ADC 21

ADC Sampling Rate Often you will need to sample signals very close to the Nyquist rate Care must be taken when using low sampling rates V in t = sin 8π 10 3 t 22

ADC Sampling Rate So how do we control the sampling rate? Default Arduino ADC clock rate is f ADC = 125 khz Normal conversion requires 13 clock cycles or 104 μs Maximum sampling rate is 9,615 Hz The actual sampling rate depends on your implementation 23

ADC Sampling Rate The serial monitor is a very useful debugging tool for Arduino Sample Arduino Code It is common to embed the ADC conversion function into the main loop Takes approximately 284 μs to execute this loop int analogpin = 3; int val = 0; void setup() { Serial.begin(9600); } void loop() { val = analogread(analogpin); Serial.print( Value is: ); Serial.println(val); } Actual sampling rate is 3,521 Hz! 24

ADC Sampling Rate A much better way is to use timers and interrupts Sampling rate is now tightly controlled by the timer Sampling rate is still limited by other code and resolution of timer Sample Arduino Code #include TimerOne.h int analogpin = 3; int val = 0; void setup() { Timer1.initialize(1000); Timer1.attachInterrupt(callback); } void callback() { val = analogread(analogpin); } void loop() { // Do something with val } 25

Common Applications 26

Measuring Amplitude Measuring the amplitude of an unknown AC signal with respect to ground V t = V DC + Asin ωt + θ v n = v DC + Asin 2π f f S n + θ A common method for finding amplitude is to find the maximum value of v n Do not forget the DC offset Amp V REF Does sampling rate matter? DC Offset 0 27

Measuring Amplitude Accuracy can be improved by taking at least 5 samples per period Measuring RMS voltage is a bit more accurate RMS v n = 1 N n v n V DC 2 28

Digitizing Multiple Signal Sources Four Modes of Operation 1. Single-Channel Single Conversion 2. Sequence-of-Channels 3. Repeat Single-Channel 4. Repeat Sequence-of-Channels 29

Digitizing Multiple Signal Sources V 1 IDEAL Control V 2 t MUX ADC t t Δt t V 1 REALISTIC Control V 2 t MUX ADC n t n 30

Summary Make sure that your analog input signal is within the valid range of the ADC For maximum resolution, you want the input signal to be close to V ref Variable amplification may be necessary Make sure that you are sampling above the Nyquist rate Watch out where you place your conversion enable code You should always low-pass filter your input signal before digitization Avoid unwanted aliasing Minimize noise contribution from any gain blocks 31

Thank You 32