Electronic instrumentation Digitization of Analog Signal in TD

Slides:



Advertisements
Similar presentations
EET260 Introduction to digital communication
Advertisements

Intermediate Electronics and Lilypad Where Electronics Meet Textiles Workshop with Lynne Bruning and Troy Robert Nachtigall Sponsored by Spark Fun and.
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
How to use Arduino By: Andrew Hoffmaster.
Analog-to-Digital Converter (ADC) And
EET 252 Unit 6 Analog-to-Digital Conversion
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
Digital to Analog and Analog to Digital Conversion
Digital Fundamentals Tenth Edition Floyd Chapter 12.
CE 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Analog to Digital (and back again) Interfacing a microprocessor-based system.
Analog to Digital Conversion. Introduction  An analog-to-digital converter (ADC, A/D, or A to D) is a device that converts continuous signals to discrete.
Analog to Digital Conversion. 12 bit vs 16 bit A/D Card Input Volts = A/D 12 bit 2 12 = Volts = Volts = 2048 −10 Volts = 0 Input Volts.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Lecture 9: D/A and A/D Converters
SIMS-201 Characteristics of Audio Signals Sampling of Audio Signals Introduction to Audio Information.
IT-101 Section 001 Lecture #8 Introduction to Information Technology.
Analogue to Digital Conversion
Analogue to Digital Conversion
Discussion #25 – ADCECEN 3011 Conversion Mosiah 5:2 2 And they all cried with one voice, saying: Yea, we believe all the words which though has spoken.
EET260: A/D and D/A converters
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 4 Digital Transmission.
Chapter 4 Digital Transmission
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
 Principles of Digital Audio. Analog Audio  3 Characteristics of analog audio signals: 1. Continuous signal – single repetitive waveform 2. Infinite.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Digital to Analogue Conversion Natural signals tend to be analogue Need to convert to digital.
Computer Based Data Acquisition Basics. Outline Basics of data acquisition Analog to Digital Conversion –Quantization –Aliasing.
Sampling Theorems. Periodic Sampling Most signals are continuous in time. Example: voice, music, images ADC and DAC is needed to convert from continuous-time.
CSC361/661 Digital Media Spring 2002
1 4-Integrating Peripherals in Embedded Systems (cont.)
Analog to Digital Converters (ADC) 1
Data Acquisition Systems
ENGR 104: Data Acquisition Lecturers: Dr. Binh Tran Dr. Otto Wilson Jr. © The Catholic University of America Dept of Biomedical Engineering.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 1 Getting Started to Arduino.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
BM-305 Mikrodenetleyiciler Güz 2015 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Analog/Digital Conversion
Chapter 4 Digital Transmission. 4.2 Summary Line Coding Line Coding Schemes Block Coding Scrambling Signal Element versus data element Multilevel : 2b1Q.
Transmission Media. Quiz: ANGEL->Lessons->Quiz 2 Figure 1Figure 2 Figure 3Figure 4.
Embedded Systems Design 1 Lecture Set C Interfacing the MCS-51 to: –D/A Converter –A/D Converter.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
1 What is Multimedia? Multimedia can have a many definitions Multimedia means that computer information can be represented through media types: – Text.
Microcontroller basics Embedded systems for mortals.
Lecture 9: Introduction to Arduino Topics: Arduino Fundamentals, Bean Date: Mar 22, 2016.
Digital Logic & Design Dr.Waseem Ikram Lecture 44.
1 Basic Signal Conversion 센서 및 계측 공학 (Sensor and Instrumentation Engineering) 2016 년 1 학기 충북대학교 전기전자반도체공학과 박 찬식
Ultrasonic Sensor TYWu.
Analog-Digital Conversion. Analog outputs from sensors and analog front- ends (analog signal conditioning) have to be converted into digital signals.
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
Arduino Programming. THE ARDUINO IS A MICROCONTROLLER – A LOW COST, LOW PERFORMANCE COMPUTER.
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
MECH 373 Instrumentation and Measurements
Arduino Setup & Flexing the ExBow
Microcontroller basics
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
4.1 Chapter 4 Digital Transmission Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Digital Acquisition of Analog Signals – A Practical Guide
Soutenance de thèse vendredi 24 novembre 2006, Lorient
Digital Control Systems Waseem Gulsher
Conversation between Analogue and Digital System
Arduino : Introduction & Programming
Analog to Digital Encoding
CTY SAR FCPS Alexander Velikanov
Presentation transcript:

Electronic instrumentation Digitization of Analog Signal in TD Lecturer: Dr. Samuel Kosolapov

Items to be discussed Digitization (or digitizing) of Analog Signal Sampling and Quantization Storage of Digital signal as array of counts Nyquist Frequency Alias Serial Monitor and Serial Plotter Arduino Examples

ADC ADC Clock Quantization. Result: Digitized signal stored as a sequence of numbers  array Analog Signal : AI V(t) = F(t) Clock (Pulse Wave signal) Sampling interval, Sampling Frequency

ADC: Sampling and Quantization (simplified operation as a two stage process) Quantization. Result: Digitized signal stored as a sequence of numbers  array Analog Signal : AI S/H Sample and Hold circuit Quantizer

Stage 1. Sample and Hold Sample and Hold circuit AI : Analog Input AO : Analog Output C : control signal (Clock) Analog Signal : AI Analog Signal : AO The output level of the S/H is updated on every rising edge of the ADC’s clock input AI not equal to AO !!!

Stage 2. Quantization Quantizer Circuit Clock Analog Signal : AO (Pulse Wave signal) Sampling interval, Sampling Frequency Quantization. Result: Digitized signal stored as a sequence of numbers  array

Stage 2. Quantization: Number of Quantization Levels Quantizer Circuit Quantizer circuit “searchs” for the best “approximation” To finish the process in the reasonable time one must LIMIT a number of quantization levels.  Speed versus Accuracy

Sampling Frequency. Nyquist Frequency Nyquist sampling theorem: The sampling frequency should be at least twice the highest frequency contained in the signal. Example: signal is sinewave at a frequency 1 Hz According to Nyquist theorem, if we sample this waveform at 2 Hz , this is sufficient to capture every peak of the signal  We can reconstruct this signal

Oversampling and Undersampling Oversampling (at a frequency, say 3 Hz) is OK. We have more than enough samples to reconstruct the signal Undersampling (at a frequency, say 1.5 Hz) is BAD. The problem is that with undersampling we get wrong information about the signal. The person receiving these samples reconstruct different signal

Nyquist Frequency Real signal is a complex signal composed of many frequency components. By Fourier theorem we know, that any continuous signal can be decomposed in terms of a sum of sines and cosines at different frequencies. Example: sum of sinewaves at frequencies 1 Hz, 2 Hz and 3 Hz We know, that highest frequency in this signal is 3 Hz. This signal must be sampled at least at 2*3 Hz = 6 Hz. One can see that then we can exactly reconstruct the signal

Nyquist Frequency and Nyquist Rate Strictly speaking, the Nyquist frequency should not be confused with the Nyquist rate, which is the minimum sampling rate that satisfies the Nyquist sampling criterion for a given signal  Thus, Nyquist rate is a property of a continuous-time signal, whereas Nyquist frequency is a property of a discrete-time system.

Restoring Analog Signal by “samples”

Arduino: Presenting Digitized Signal with Serial Monitor and Serial Plotter Version 1.6.6. Reinstall !!! Arduino has a class “Serial” Arduino communicates with PC by using USB cable. However communication is executed by using RS232 protocol Arduino IDE has “Serial Monitor” and “Serial Plotter”. “Serial Monitor” can accept bytes from Arduino and send bytes to Arduino. Class Serial has a number of “methods” (functions) enabling to work with bytes, int, strings, etc.

Arduino: Generating Synthetic Signal and Presenting it with Serial Monitor and Serial Plotter int digitalSignal[100]; void setup() { Serial.begin(9600); for (int i=0; i<100; i++) { digitalSignal[i] = i; } void loop() { for (int i=0; i<100; i++) { Serial.println( digitalSignal[i] ); delay(1); }

Arduino: Presenting Digitized Signal with Serial Monitor and Serial Plotter

Arduino: Analog Input. Potentiometer Potentiometer used as a “Angle Sensor”. Potentiometer connected as Voltage Divider. One (say, left) pin of the potentiometer is connected to +5V Then right pin of the potentiometer is connected to GND Middle pin of the potentiometer is connected to A0 : Analog Input Pin Rotating the handle changes the voltage on the middle pin from 0 V to +5V

Arduino: Analog Input. Potentiometer. Code. int analogPin = 0; // A0 int val; void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: val = analogRead( analogPin); Serial.println(val); delay(50); Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.  Graphical representation is available using serial plotter (Tools > Serial Plotter menu)   Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. // initialize serial communication at 9600 bits per second:   Serial.begin(9600); Serial.println(val);

Arduino: Analog Input. “Simple Voltmeter”. void loop() {   // read the input on analog pin 0:   int sensorValue = analogRead(A0);   // Convert the analog reading // (which goes from 0 - 1023) to a voltage (0 - 5V):   float voltage = sensorValue * (5.0 / 1023.0);   // print out the value you read:   Serial.println(voltage); } Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.  Graphical representation is available using serial plotter (Tools > Serial Plotter menu)   Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

Arduino: Analog Input. Voltage range The Arduino UNO board contains a 6 channel 10-bit analog to digital converter (Pins A0 .. A5) This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, 0.0049 volts (4.9 mV) per unit. * Some authors uses 5 V / 1023 !!!! The input range and resolution can be changed using analogReference(). Do not do this until full understanding

Arduino: Analog Input. Sampling Rate For a 16 MHz Arduino the ADC clock is set to 16 MHz/128 = 125 KHz. Each conversion in AVR takes 13 ADC clocks so 125 KHz /13 = 9615 Hz. That is the maximum possible sampling rate, but the actual sampling rate in your application depends on the interval between successive conversions calls Practically: Much less. Something must be done with samples. Sending data to PC takes time PC must response But Windows is not real-time system  one may get jitter Professionals using direct access to processor’ registers can increase Sampling Rate but on the price of the precision (less bits)