ANALOG TO DIGITAL CONVERTER ANALOG INPUT

Similar documents
Rowan University Freshman Clinic I Lab Project 2 The Operational Amplifier (Op Amp)

Department of Mechanical and Aerospace Engineering. MAE334 - Introduction to Instrumentation and Computers. Final Examination.

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

MAE334 - Introduction to Instrumentation and Computers. Final Exam. December 11, 2006

Lecture 3: Sensors, signals, ADC and DAC

Signal Characteristics and Conditioning

Module 1: Introduction to Experimental Techniques Lecture 2: Sources of error. The Lecture Contains: Sources of Error in Measurement

SENSOR AND MEASUREMENT EXPERIMENTS

Introduction to Measurement Systems

Analytical Chemistry II

Unit 3: Introduction to Op- amps and Diodes

Chapter 5: Signal conversion

P a g e 1. Introduction

MECE 3320 Measurements & Instrumentation. Data Acquisition

Lab 12 Laboratory 12 Data Acquisition Required Special Equipment: 12.1 Objectives 12.2 Introduction 12.3 A/D basics

IT.MLD900 SENSORS AND TRANSDUCERS TRAINER. Signal Conditioning

BASIC ELECTRONICS PROF. T.S. NATARAJAN DEPT OF PHYSICS IIT MADRAS

Bridge Measurement Systems

Electronic Systems - B1 23/04/ /04/ SisElnB DDC. Chapter 2

ELECTRONIC SYSTEMS. Introduction. B1 - Sensors and actuators. Introduction

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

Data acquisition and instrumentation. Data acquisition

INSTRUMENTATION AND CONTROL TUTORIAL 3 SIGNAL PROCESSORS AND RECEIVERS

Onwards and Upwards, Your near space guide

SU QuarkNet Workshop 2012 Lab Activity 5 ELECTRONICS II: ADCs & DAQ

Electronics and Instrumentation Name ENGR-4220 Spring 1999 Section Experiment 4 Introduction to Operational Amplifiers

Appendix D Ideas for Term Projects

Analog to Digital Conversion

GSM BASED PATIENT MONITORING SYSTEM

T6+ Analog I/O Section. Installation booklet for part numbers: 5/4-80A-115 5/4-90A-115 5/4-80A /4-90A-1224

Analogue Signals. M J Brockway. February 5, 2018

ME 461 Laboratory #3 Analog-to-Digital Conversion

ET 438B Sequential Digital Control and Data Acquisition Laboratory 4 Analog Measurement and Digital Control Integration Using LabVIEW

Introduction. These two operations are performed by data converters : Analogue-to-digital converter (ADC) Digital-to-analogue converter (DAC)

Figure 4.1 Vector representation of magnetic field.

In this lecture. System Model Power Penalty Analog transmission Digital transmission

WebSeminar: Sept. 24, 2003

Embedded Control. Week 3 (7/13/11)

Lab assignment: Strain gauge

Measurement, Sensors, and Data Acquisition in the Two-Can System

PC-based controller for Mechatronics System

Ch 5 Hardware Components for Automation

Chapter 8. Representing Multimedia Digitally

Digital Sampling. This Lecture. Engr325 Instrumentation. Dr Curtis Nelson. Digital sampling Sample rate. Bit depth. Other terms. Types of conversion.

Piecewise Linear Circuits

A-D and D-A Converters

Sensors. Chapter 3. Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 3.1

Basic Microprocessor Interfacing Trainer Lab Manual

EE251: Tuesday October 10

Figure 1.1 Mechatronic system components (p. 3)

CHAPTER ELEVEN - Interfacing With the Analog World

The AD620 Instrumentation Amplifier and the Strain Gauge Building the Electronic Scale

Department of Mechanical and Aerospace Engineering. MAE334 - Introduction to Instrumentation and Computers. Final Examination.

ELG3336 Design of Mechatronics System

Lab E5: Filters and Complex Impedance

Module 9C: The Voltage Comparator (Application: PWM Control via a Reference Voltage)

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

AERO2705 Space Engineering 1 Week 7 The University of Sydney

Signal Conditioning Systems

LABsat Manual Fall 2005

UNIVERSITY OF CALIFORNIA College of Engineering Department of Electrical Engineering and Computer Sciences

Introduction. ELCT903, Sensor Technology Electronics and Electrical Engineering Department 1. Dr.-Eng. Hisham El-Sherif

Infrared Communications Lab

EE 233 Circuit Theory Lab 3: First-Order Filters

Signal Conditioning Fundamentals for PC-Based Data Acquisition Systems

The Operational Amplifier This lab is adapted from the Kwantlen Lab Manual

ni.com Sensor Measurement Fundamentals Series

The PmodIA is an impedance analyzer built around the Analog Devices AD bit Impedance Converter Network Analyzer.

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

UNIVERSITY OF NORTH CAROLINA AT CHARLOTTE Department of Electrical and Computer Engineering

Chapter 2 Analog-to-Digital Conversion...

Basic electronics Prof. T.S. Natarajan Department of Physics Indian Institute of Technology, Madras Lecture- 24

5. Transducers Definition and General Concept of Transducer Classification of Transducers

Differential Amplifier : input. resistance. Differential amplifiers are widely used in engineering instrumentation

Capacitive Touch Sensing Tone Generator. Corey Cleveland and Eric Ponce

University of Pennsylvania. Department of Electrical and Systems Engineering. ESE Undergraduate Laboratory. Analog to Digital Converter

Outline. Analog/Digital Conversion

2 Thermistor + Op-Amp + Relay = Sensor + Actuator

Last Time. P and N type semiconductors Diode internals Transistors NPN PNP

Signal Paths from Analog to Digital

Laboratory Project 1a: Power-Indicator LED's

Graphing Techniques. Figure 1. c 2011 Advanced Instructional Systems, Inc. and the University of North Carolina 1

EE 230 Lab Lab 9. Prior to Lab

University of Pittsburgh

Single-channel power supply monitor with remote temperature sense, Part 1

Silicon-Gate Switching Functions Optimize Data Acquisition Front Ends

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

EE401,EC401,DEE19,DETE19

BASIC ELECTRONICS PROF. T.S. NATARAJAN DEPT OF PHYSICS IIT MADRAS

GCSE Electronics. Scheme of Work

Analog I/O. ECE 153B Sensor & Peripheral Interface Design Winter 2016

Analog to Digital (ADC) and Digital to Analog (DAC) Converters

1. A transducer converts

BEATS AND MODULATION ABSTRACT GENERAL APPLICATIONS BEATS MODULATION TUNING HETRODYNING

BME/ISE 3512 Bioelectronics. Laboratory Five - Operational Amplifiers

Specifying A D and D A Converters

Voltage Current and Resistance II

GSM based Patient monitoring system

Introduction to Electronic Circuit for Instrumentation

ni.com Sensor Measurement Fundamentals Series

Transcription:

ANALOG INPUT Analog input involves sensing an electrical signal from some source external to the computer. This signal is generated as a result of some changing physical phenomenon such as air pressure, temperature, ph, vibration, etc. This signal is usually not the well defined on/off voltage you have studied in the digital section, but a voltage that changes continuously with time. As you know, the computer can only deal with digital signals, therefore, a process called Analog to Digital Conversion is used. This process is divided into a number of steps including: generation of the signal by a device we will refer to as a transducer or sensor, amplification or conditioning of the signal if needed, changing the analog signal to a digital signal that the computer can read and, repeating if necessary. The digital signal is composed of discrete voltages which are represented by the binary numbers 0 and 1. These digits are usually organized into groups called bytes or words A magnetic microphone generating an electrical signal is an example of an analog signal. The next illustration is an expanded view of this concept. ANALOG TO DIGITAL CONVERTER The analog to digital converter (ADC) is the heart of the sensing system. The modern ADC is usually a twenty pin integrated circuit (chip). This chip, along with supporting circuitry, is on an 1

interface card that plugs into the expansion slot of a computer or in a stand alone system that connects to the serial port. Analog to digital converters exist in a variety of configurations which determines their use. The most import characteristics that differentiate one ADC from another are resolution and speed. Other parameters such as voltage range and type (serial or parallel) are also factors that have to be considered. RESOLUTION You have probably seen metre sticks in a science lab that have a different scale on each side. One scale may be divided into centimetres and the other millimetres. If you are measuring the length of a room for some purpose, the centimetre side is adequate. If you wish to measure the diameter of a pencil, clearly this scale is useless. The millimetre side has a higher resolution and will give a more accurate measurement. The resolution of the ADC chip defines the smallest change in the input signal that can be measured accurately. Resolution is usually stated in bits. The number of bits (remember binary digit) is the number of consecutive 0's and 1's that the chip can manipulate at one time. Generally speaking, the greater the number of bits the ADC is rated at, the finer the resolution of the input signal. We can look at this concept more closely by comparing two of the more common ADC chips, one rated at 8 bits and the other at 12 bits. The 8 bit chip can resolve the input signal range into 2 8 or 256 parts. Most ADC chips operate over a voltage range of 0 to 5 volts. Therefore the finest resolution of this chip would be 5 V 256 = 0.020 V or 20 millivolts per division. By comparison, the 12 bit chip can resolve the input into 2 12 = 4096 parts. Again, 5 V 4096 =.0012 V or 1.2 mv per division. This may seem a bit confusing, therefore we will use a practical example. Consider that the voltage from a temperature sensor changes as the temperature goes up and down. This electronic thermometer is being used to measure a temperature range from 1 to 256 degrees Celsius. The 8 bit ADC can resolve the temperature range into 1 degree divisions. To prove this, consider the following calculation. Remember, the 8 bit can have 256 divisions. In terms of percent, 1 out of 256 works out to be.39%. Therefore. if we calculate.39% of 256 we will get 1 degree, which is the finest division of our thermometer. However if we used a 12 bit ADC we can get a resolution of 1 part in 4096 which works out to be 0.024% of the full scale. If we calculate 0.024% of 256 degrees, we get about.06 degrees as the finest division on our thermometer. What would be the finest division on our thermometer if we used a 16 bit ADC? Many of the interface cards used in high school science labs are 12 bit. The finer the resolution of the chips, the higher the cost. An 8 bit chip can be purchased for as little as $5.00, while a 12 bit may cost $20.00 or more.. 2

SPEED The second important characteristic of the Analog to Digital converter is the speed at which the chip can take samples of the input signal. This is called the sample rate and is measured in Hertz (samples per second). A sample is taken when the ADC determines the value of a given voltage (waveform) at a particular instant in time (this process is also called digitizing). An ADC with a speed of 25 kilohertz can sample an input signal 25 thousand times per second. The sample rate is determined by a characteristic called conversion time. This is the time it takes the ADC to convert the input voltage into the equivalent digital byte or word when commanded by the computer. The quicker the conversion time, the more samples that can be taken of a changing voltage. This is not important if you are sampling the atmospheric pressure every half hour but it becomes crucial when analyzing a fast changing signal such as a sound wave. An ADC that has a conversion time of 50 s (microseconds) has a sample rate ( frequency) of 20,000 hertz. This is calculated by using the following equation: If you have taken a Physics course this equation will be familiar as the relation between frequency and period. Again we will look at an example to illustrate this characteristic. The following is the actual output of a 12 bit ADC which was used to sense the signal coming from a small magnetic microphone. The electrical signal from this microphone varied with the intensity of the sound. The first graph on the next page shows a plot of sound intensity versus the times at which the samples were taken. Only the points are shown. To draw this graph, 700 samples or ordered pairs (sound intensity and time) were converted and stored. In the second graph the character showing the position of the points is erased and lines joining the points are drawn. From the x- axis it can be seen that the total time is 0.03 s. Therefore, to take 700 samples in 0.03 seconds means that the sample rate must have been at least 3

Some of the commercially available interface board for school use have ADC's rated at 40 kilohertz and above. Graph of sound intensity versus time. 700 points are shown. Note that the y-axis is unc and shows the 'raw' ADC output. (voltages converted to numbers between 0 and 4095) Graph showing sound wave (male voice) with point symbols erased and points joined 4

A good understanding of the sample rate is critical when using the ADC to capture and display a waveform. A waveform is the graph of a changing voltage versus time. The ADC will sample the value of the changing waveform of a signal at various points in time. The computer will store these points and a software application will graph them to reproduce the original waveform. The soft ware essentially joins the points with straight lines to display the graph. If the sample rate is too low, not enough points will be taken to reproduce the waveform accurately. To illustrate this problem we will look at a number of graphs that are the result of samples taken with a 12 bit ADC. The original waveform is a sine wave produced by an electronic signal generator. The first diagram shows the original wave, the next diagrams are a sequence where the number of samples taken are displayed on each graph. 5

It is clear that in the second graph, where 5 samples are taken, the reproduced waveform looks nothing like the first. As the sample rate increases the resulting wave becomes closer and closer to the original. The last graph shows 50 samples and here the shape of the sine wave is clearly visible. (The first graph of the original wave was reproduced using 512 samples!) The problem of having too slow a sample rate which results in an inaccurate representation of the original signal is called aliasing. OTHER FACTORS: VOLTAGE RANGE As already stated, most ADC chips have an input voltage range between 0 and 5 volts. If the electrical output of the transducer (sensor) in use varies widely between these values, the signal does not have to be modified. However if the output fluctuates over a tiny range it has to be amplified to be useful. For example, a typical magnetic microphone has a full scale output of about 0.005 volts (5 millivolts). As calculated previously, an 8 bit ADC can resolve a 5 volt range to about 20 millivolts. If you connected the microphone and yelled and shouted, t he ADC would not respond. This is somewhat analogous to a digital mass scales that has one digit in its display, 0-9 kilograms. If you place a feather on this scale, the display would still read 0. Only when at least 1 kilogram was placed on the scale would the display change. Even a 12 bit ADC with a resolution of just over 1 millivolt per division would only change by 4 or 5 out of a possible range of 4096. The amplifiers used are OP AMPS or operational amplifiers. These are simple, cheap, and work well. For the most part they are hidden from the user. The gain (amplification) of the op amp is usually set from the software that is used to control the ADC, however some ADC boards use switches. Somet imes the output of a sensor is above the ADC specification. In this case the OP AMP is used to 'deamplify' the output to a usable level. The schematic diagram of a typical op amp is shown below. 6

Typical op amp circuit. The amplification factor is determined by the ratio R2/R1. By changing the value of resistor R2 the degree of amplification of the input can be controlled. INPUT CHANNELS Many commercially available ADC's have more than one input channel. This means that the ADC board can be connected to more than one source of signals. The active channel is usually selected by the software. This process is called multiplexing. The ADC board you will use when you begin the activities provides 3 input channels, although the ADC chip itself has 8. TRANSDUCERS This is the front end of the apparatus. Any device that generates an electrical signal or modifies one in response to some external stimulus can be used as a transducer or sensor. Generally sensors fall into two categories. Those that produce their own electrical signal and those that modify a supplied voltage usually by a changing resistance. Examples of the former are silicon photovoltaic cells, magnetic microphones, wire coils and magnets, voltaic cells, thermocouples, and piezo crystals. Examples of the latter are cadmium sulphide photocells, thermistors, potentiometers, strain gauges, and silicon pressure cells. The most import characteristic of any sensor is its linearity. That is, how it produces or changes a voltage in response to the parameter it is measuring. To illustrate this property we can look at an example. If the output of a thermistor (temperature dependent resistor) is 0.5 v at 0 C, 0.8 v at 50 C and 0.9v at 100 C then the relation between voltage and temperature is clearly not linear. (A graph of these two variables would be curved). Special circuits must be used to modify the electrical output of the transducer so that it changes in a linear fashion with respect to the 7

physical phenomenon that causes the change. Most software assumes this to be the case when sensors are calibrated. If you are fabricating your own sensors, information on their characteristics is usually given by the manufacturer. For example, if you are building a position sensor using a potentiometer (volume control) be sure to check the specifications as to whet her it is a log or linear taper. Log taper potentiometers are used in audio equipment and, as the name implies, have an exponential relation between resistance and position. You will be using a position sensor in one of the activities. To further illustrate the concept of linearity in sensors consider the next graph. The data used to produce the plot was taken from a fact sheet supplied with a thermistor from Radio Shack. It is clear that the relation between temperature and resistance is not linear. Reference has been made to the word calibrated in the previous section. We need to explore the calibration of sensors and transducers. Remember a sensor produces or modifies an electrical signal. Let's look at an example. As mentioned, a thermistor is a device that changes its electrical resistance in response to a temperature change. If the thermistor is connected to a source of electrical potential (voltage), its output will be a voltage that changes with temperature. We might place the device in a bath of ice water and have the ADC measure the voltage as say 0.5 volts. We might then place it in a beaker of boiling water and have the ADC again measure the voltage as 1.5 volts. This is all well and fine until we tell someone that its a nice day outside and the temperature is 0.7 volts! Most existing software provides a method to equate the voltage output of the sensor to the actual physical parameter it is sensing, in this case temperature. This procedure is called calibration. In our example the temperature changed from 0 to 100 degrees. The voltage changed from 0.5 to 8

1.5 volts. We will plot these points on a graph and join them with a straight line. We do this only if we can be assured that the output of the sensor is linear. That is, all ordered pairs of temperature and voltage will occur along the line. To make use of this information, the software, either programmed by you or "off the shelf", must formulate a relation between the two variables, temperature and voltage. Because we are dealing with a straight line relationship, we can use the equations of linear graphs such as. The slope of the graph can be calculated: 9

Taking an ordered pair and substituting in the slope intercept form of the linear equation, we can calculate the intercept. We now have the final relation between the voltage that the ADC senses and the temperature. It is important to note that this relation is only valid for our imaginary thermistor. Another sensor would have a different relationship. This equation is usually saved as a calibration file by most commercial software and used when the actual temperature has to be reported. Now we can say that it is a fine day and the temperature is 20 degrees Celsius. 10

ANALOG OUTPUT In the previous section you investigated the theory and practice of Analog to Digital Conversion. The complementary process is of course called Digital to Analog Conversion. This involves the conversion of computer stored or generated data into a continuously changing output voltage through some appropriate interface device. (In actual fact, the computer's output is not continuously changing, but changes in small increments. The smaller the increment, the closer the approximation to a continuous voltage.) One of the most common illustrations of this technology is the compact disk for music or CD. In this device, tiny pits, which have been etched into an aluminum disk, are illuminated by a small diode laser. Depending on the presence or absence of these holes, a 0 or 1 is read by the circuitry. These binary digits or bits are then converted by a DAC (Digital to Analog Converter) to a varying voltage which is then amplified and presented to our ears as music. Other examples include speech synthesis and speed control of electric motors, The most important characteristics of the DAC are resolution, conversion speed and output voltage range. RESOLUTION Like its opposite, the ADC (Analog to Digital Converter), resolution is measured in bits. The most common DAC's currently in use are 12 bit chips. You have studied what this means in Section 3, but let's review it here. 2 12 = 4096 That means that the Digital to Analog converter can resolve the output voltage into 4096 parts, which corresponds to a resolution of 0.024%. CONVERSION SPEED This is how fast the DAC chip can accept a number (binary word) from the computer and output a corresponding voltage. Speeds of several hundred thousand conversions per second would be required for music CDs. OUTPUT VOLTAGE RANGE This is the range of voltages that can be generated by the DAC. Typical ranges include 0 to 5 volts and -5 to +5 volts. The larger the voltage range, the coarser the resolution for a given ADC chip. The Sunset AIB board which comes as part of the Vernier interface has two Digital to Analog converters, named DAC1 and DAC2. These are 12 bit chips and as configured, have an output 11

voltage range of -5 to +5 volts. The output is also linear with respect to the input. Therefore we can predict the following: M M M An input of 0 (decimal) by the computer will cause the output of the DAC to be -5 volts. An input of 2048 will result in an output voltage of 0 volts. An input of 4095 will result in an output of +5 volts. Remember, a 12 bit converter can divide the voltage range into 4096 parts (0-4095). The DACs on the AIB board can be controlled by using the OUT command from Quick Basic. The I/O addresses that are accessed are 822 and 823 for DAC1 and 828 and 829 for DAC 2. The DACs are controlled by registers. A register is a temporary memory storage area. The registers on the AIB board are 8 bit registers. In reviewing our binary numbers, 8 bits means 2 8 = 256. Therefore the largest number an 8 bit register can store is 255 (0 to 255 is 256 numbers). Because the DACs themselves are 12 bit (4096) devices, two 8 bit registers must be used to control them. When you send a decimal number to the DAC to cause it to output a voltage, you must first break the number down into two parts called the Low Byte and the High Byte. The method for doing this is shown next in an example. Example: If you want to input the decimal number 4000 to the DAC to cause it to output a voltage, you would divide 4000 by 256. The remainder, 160, is the low byte and the quotient, 15, is the high byte. These bytes are sent to the DAC using the OUT command. The DAC then outputs the corresponding voltage. You will use two Quick Basic operators to divide a number into the Low and High Bytes. These are: MOD which returns the remainder from a division and \ (Backslash) which is an int eger division. (It returns the whole number quotient without decimals or remainders.) 12

To program the example in Visual Basic, you would use the following. N = 4000 Lo% = N MOD 256 Hi% = N \ 256 OUT 822, Lo% OUT 823, Hi% (Lo% and Hi% are the High and Low Bytes) This small program would cause DAC 1 to output approximately +4.76 volts. 13