ADC
WHAT IS ANALOG AND DIGITAL
SIGNAL?
ANALOG SIGNAL:-
A quantity that varies continuously with time is
known as a Analog signal.
DIGITAL SIGNAL:-
It is a signal that represents a sequence of discrete
values. In other words it has only two values
LOGIC ‘0’ OR LOGIC ‘1’
Examples of analog signals:
 Thermometer – mercury height rises as temperature
rises
 Car Speedometer – Needle moves farther right as
you accelerate
 Stereo – Volume increases as you turn the knob.
Examples of digital signals:
 Light switch can be either on or off
 Door to a room is either open or closed
Most of the signal that we want to process are analog
i.e.: they are continuous and can take inifinite no. of values
x(t)
t
Analog Signal
IMPORTANCE OF ADC
 Physical quantities to be measured are in analog form
 Microcontroller understands only digital values
Digital systems require discrete digital data
ADC converts an analog information into a
digital information
Digital System?Analog Digital
Why ADC ?
Examples of A/D Applications
 Microphones - take your voice varying pressure waves in the air
and convert them into varying electrical signals
 Strain Gauges - determines the amount of strain (change in
dimensions) when a stress is applied
 Thermocouple – temperature measuring device converts thermal
energy to electric energy
 Voltmeters
 Digital Multimeters
CHOOSING A PERFECT ADC
Parameters to be considered while choosing a ADC
 SPEED
 RESOLUTION
 ACCURACY
 STABILITY
t
Ts
Q
xq(t)
Accuracy
t
Ts
xq(t) Higher Sampling rate
t
Q
xq(t)
Higher Resolution
Accuracy of A/D Conversion
There are two ways to best improve accuracy of A/D
conversion:
 increasing the resolution which improves the
accuracy in measuring the amplitude of the analog
signal.
 increasing the sampling rate which increases the
maximum frequency that can be measured.
Types of ADCs
•Flash ADC
•Sigma-delta ADC
•Dual slope converter
•Successive approximation converter
•Parallel Comparator ADC
ADC Resolution Comparison
0 5 10 15 20 25
Sigma-Delta
Successive Approx
Flash
Dual Slope
Resolution (Bits)
Type Speed (relative) Cost (relative)
Dual Slope Slow Med
Flash Very Fast High
Successive Appox Medium – Fast Low
Sigma-Delta Slow Low
ADC Types Comparison
SUCCESSIVE APPROXIMATION ADC
Successive Approximation ADC
 A Successive Approximation Register (SAR) is added to
the circuit
 Instead of counting up in binary sequence, this
register counts by trying all values of bits starting with
the MSB and finishing at the LSB.
 The register monitors the comparators output to see if
the binary count is greater or less than the analog
signal input and adjusts the bits accordingly
 Sets MSB
 Converts MSB to
analog using DAC
 Compares guess to
input
 Set bit
 Test next bit
SAR DAC
Out
VIN
-
+
Successive Approximation
1000 0000
Is Vin > ½ ADC range?
0100 0000
If no, then test next bit
Successive Approximation
Advantages
 Capable of high speed and
reliable
 Medium accuracy compared
to other ADC types
 Good tradeoff between speed
and cost
 Capable of outputting the
binary number in serial (one
bit at a time) format.
Disadvantages
 Higher resolution successive
approximation ADC’s will be
slower
 Speed limited to ~5Msps
INSTRUCTIONS FOR ADC
 Init_Adc();
 Int Analog_Read(A0);
PROGRAM
#define F_CPU 16000000
#include <avr/io.h>
#include "Ilabslib_16.h"
#include <util/delay.h>//COM14
int main(void)
{
Lcd_Init();
Lcd_Clrscr();
Lcd_Goto(2,1);
Init_Adc();
while(1)
{
int value1= Analog_Read(A0);
Lcd_Clrscr();
Lcd_Write_Int(value1);
_delay_ms(200);
}
}
#define F_CPU 16000000
#include <avr/io.h>
#include "Ilabslib_16.h"
#include <util/delay.h>//COM14
int main(void)
{
Lcd_Init();
Lcd_Clrscr();
Lcd_Goto(2,1);
Init_Adc();
while(1)
{
{
int value1= Analog_Read(A0);
Lcd_Clrscr();
Lcd_Write_Int(value1);
_delay_ms(200);
Serial_Write_Int(value1);
Serial_Write_String("t");
}
}

simple ADC Interfacing

  • 1.
  • 3.
    WHAT IS ANALOGAND DIGITAL SIGNAL? ANALOG SIGNAL:- A quantity that varies continuously with time is known as a Analog signal. DIGITAL SIGNAL:- It is a signal that represents a sequence of discrete values. In other words it has only two values LOGIC ‘0’ OR LOGIC ‘1’
  • 4.
    Examples of analogsignals:  Thermometer – mercury height rises as temperature rises  Car Speedometer – Needle moves farther right as you accelerate  Stereo – Volume increases as you turn the knob. Examples of digital signals:  Light switch can be either on or off  Door to a room is either open or closed
  • 5.
    Most of thesignal that we want to process are analog i.e.: they are continuous and can take inifinite no. of values x(t) t Analog Signal IMPORTANCE OF ADC  Physical quantities to be measured are in analog form  Microcontroller understands only digital values
  • 6.
    Digital systems requirediscrete digital data ADC converts an analog information into a digital information Digital System?Analog Digital Why ADC ?
  • 7.
    Examples of A/DApplications  Microphones - take your voice varying pressure waves in the air and convert them into varying electrical signals  Strain Gauges - determines the amount of strain (change in dimensions) when a stress is applied  Thermocouple – temperature measuring device converts thermal energy to electric energy  Voltmeters  Digital Multimeters
  • 8.
    CHOOSING A PERFECTADC Parameters to be considered while choosing a ADC  SPEED  RESOLUTION  ACCURACY  STABILITY
  • 9.
    t Ts Q xq(t) Accuracy t Ts xq(t) Higher Samplingrate t Q xq(t) Higher Resolution
  • 10.
    Accuracy of A/DConversion There are two ways to best improve accuracy of A/D conversion:  increasing the resolution which improves the accuracy in measuring the amplitude of the analog signal.  increasing the sampling rate which increases the maximum frequency that can be measured.
  • 11.
    Types of ADCs •FlashADC •Sigma-delta ADC •Dual slope converter •Successive approximation converter •Parallel Comparator ADC
  • 12.
    ADC Resolution Comparison 05 10 15 20 25 Sigma-Delta Successive Approx Flash Dual Slope Resolution (Bits) Type Speed (relative) Cost (relative) Dual Slope Slow Med Flash Very Fast High Successive Appox Medium – Fast Low Sigma-Delta Slow Low ADC Types Comparison
  • 13.
  • 14.
    Successive Approximation ADC A Successive Approximation Register (SAR) is added to the circuit  Instead of counting up in binary sequence, this register counts by trying all values of bits starting with the MSB and finishing at the LSB.  The register monitors the comparators output to see if the binary count is greater or less than the analog signal input and adjusts the bits accordingly
  • 15.
     Sets MSB Converts MSB to analog using DAC  Compares guess to input  Set bit  Test next bit SAR DAC Out VIN - + Successive Approximation 1000 0000 Is Vin > ½ ADC range? 0100 0000 If no, then test next bit
  • 16.
    Successive Approximation Advantages  Capableof high speed and reliable  Medium accuracy compared to other ADC types  Good tradeoff between speed and cost  Capable of outputting the binary number in serial (one bit at a time) format. Disadvantages  Higher resolution successive approximation ADC’s will be slower  Speed limited to ~5Msps
  • 18.
    INSTRUCTIONS FOR ADC Init_Adc();  Int Analog_Read(A0);
  • 19.
    PROGRAM #define F_CPU 16000000 #include<avr/io.h> #include "Ilabslib_16.h" #include <util/delay.h>//COM14 int main(void) { Lcd_Init(); Lcd_Clrscr(); Lcd_Goto(2,1); Init_Adc(); while(1) { int value1= Analog_Read(A0); Lcd_Clrscr(); Lcd_Write_Int(value1); _delay_ms(200); } }
  • 20.
    #define F_CPU 16000000 #include<avr/io.h> #include "Ilabslib_16.h" #include <util/delay.h>//COM14 int main(void) { Lcd_Init(); Lcd_Clrscr(); Lcd_Goto(2,1); Init_Adc(); while(1) {
  • 21.