SlideShare ist ein Scribd-Unternehmen logo
1 von 34
INTERFACING TO THE ANALOG WORLD
Prepared by:

Islam Samir
AGENDA
The importance of signals.
 Why do we process signals?
 Continuous VS Discrete.
 Analog signals VS digital signals.
 How to convert an analog signal into digital?
 S/H, Quantization, Encoding.

WHAT ARE SIGNALS?


Signals are mathematical functions that represents an
electrical quantity (voltage, current ..etc).



These quantity carries information in one of its
parameters [amplitude, frequency ..etc].
WHY DO WE PROCESS SIGNALS?

1.
2.

We’ve to process these signals in an appropriate way to:
Extract the information that they carry.
To get them in a better form (filtering).
CONTINUOUS VS DISCRETE

-


-

-

Continuous Signals:
Signals that are defined for all
time instants.
Discrete signals:
Signals that are defined only for
certain time instants: T, 2T, 3T,
….etc.
(T) is the sampling time of the
original continuous signal.
ANALOG SIGNALS


For analog signals, the voltage - or current - can take any
value and the system is supposed to respond to this value.



Information is represented by changing the signal’s voltage,
current, frequency, or total charge.

 The amplitude of an analog signal can take any value.
THE RULE OF TRANSDUCERS (SENSORS)




Information is converted from some other physical form
(sound, light, temperature ..etc) to an electrical signal
by a transducer.
The processing system (analog or digital) can then take
the right decision based on the electrical quantity that
it monitors, which represents the corresponding
physical quantity.
DIGITAL SIGNALS




Digital signals are discretized in time, and quantized in
amplitude.
The time interval between each number and the next is Ts.
Digital signals are the only type of signals that can be processed by
digital systems.

Sensor

Signal
Conditioning

Analog Continuoustime signal

ADC
Digital signal

We use the (signal conditioning circuitry + ADC) to convert an analog
continous-time signal into a digital signal.
DIGITAL SIGNALS


A digital computer can only deal with binary values, these
values change in a limited range due to the limited word
length.

Ex. For an 8-bit register

28 ) values only.
 It can hold one of 256 (
So, digital signals can take one of certain values only
(Quantized).
DIGITAL SIGNALS
-

The hardware that converts an analog signal to digital needs
time to quantize this signal and encode it. Also we need time
for the required processing.

-

We use a (Sample & Hold) circuit that takes samples of the
original continuous signal every time interval (Ts), where:
Ts> hardware delay + processing delay



So, digital signals are discretized in time.

 Digital signals are discretized in both time and
amplitude.
ANALOG VS DIGITAL
Analog signals

Digital signals

The signal’s amplitude can take
any value.

The signal’s amplitude is limited to
a certain range of values.
(Quantized)

Can be discrete or continuous in
time.

Always discrete in time.
HOW TO CONVERT ANALOG SIGNALS TO
DIGITAL?
HOW TO CONVERT ANALOG SIGNALS TO
DIGITAL?
LPF: Low pass filter
S/H: Sample and hold circuit.
X(t): Analog signal to be converted.
X(kTs): Sampled signal.
Xq(kTs): Quantized signal.
HOW TO CONVERT ANALOG SIGNALS TO
DIGITAL?
1.

LPF: The signal is filtered and band limited to 0.5 Fs, in
order to avoid aliasing. (Review sampling theorem)

 Fs≥2Fm
[Nyquist rate]
Fm: the max. signal frequency.
-

1.

2.

If the sampled signal is not band limited, aliasing will occur.
This will result:
The digital signal produced is not representing the original
analog signal.
If we tried to reproduce the analog signal it’ll be distorted.
HOW TO CONVERT ANALOG SIGNALS TO
DIGITAL?
1.
a)

b)

(S/H):
To convert the continuous signal to a discrete signal.
This is done for two reasons:
A time is required for the ADC to quantize and encode the
coming sample.
A time is required to do the required processing on this
sample.
HOW TO CONVERT ANALOG SIGNALS TO
DIGITAL?
Quantizer:
Due to the limited word length of any digital computer , the
sample’s value must be within a certain range according to
the number of bits used to represent the sample.
Ex. If we used an 8 – bit ADC
The sample can take one of 256 values.
3.

 The quantizer has to approximate every sample to
the nearest level.
HOW TO CONVERT ANALOG SIGNALS TO
DIGITAL?
4.
-

Encoder:
After quantization, the quantized sample must be encoded
to the corresponding binary value by an encoder.

Usually, the quantizer and the encoder are implemented by
the same hardware.
The use of quantization introduces an error between the
input signal and the signal at the quantizer output.
quantization error or (e)
-

, where: e = X(t) – Xq(kTs)
Example.

Discrete & analog signal

Discrete & quantized signal
(Digital signal)
ANALOG-TO-DIGITAL CONVERTER


1.
2.

-

The ADC converts an analog sample into the corresponding
digital value according to:
The (Full-scale) voltage. (called also Vref).
The number of bits.

The conversion can be: unipolar (0  +Vfs)
or bipolar (-Vfs  (+Vfs-1LSB)).
or (Vref-)  (Vref +).
ANALOG-TO-DIGITAL CONVERTER


In an A/D converter, Q = 1 LSB.

 Q determines the resolution of the system, that is, the lowest
change in voltage that will produce a code change.
Dynamic range:

-

It’s the minimum number of voltage levels needed to
represent a certain voltage signal, according to the range of
this signal and the required resolution.
Ex. 4-bit ADC , Vref=10v (Unipolar)

 note that the analog value represented by the all-ones code is
not full-scale (FS), but (FS – 1 LSB).
Transfer function of a 3-bit ADC (Unipolar)

-

There is a range of analog input voltage over which the ADC
will produce a given output code; this range is the
quantization uncertainty and is equal to 1 LSB.
Ex. 4-bit ADC (Bipolar)

-

In order to maintain perfect symmetry about midscale, the allzeros code (0000) representing negative full-scale (–FS) is not
normally used in computation.
Transfer function of a 3-bit ADC (Bipolar)

-

Most ADC ICs are unipolar. To monitor both positive and
negative voltage values, use a level shifter circuit before the
ADC.
SIGNAL CONDITIONING


Typical sensors yield low-amplitude analog signals that need to be
amplified and then digitized by means of an (A/D) converter.



To adapt the analog signal to the range of expected amplitude at the
input of the A/D converter, a signal conditioner is used.

Ex. If the analog signal in the range: [-20mv  20mv]
and the ADC is [0v  5v]
-

The number of values that represent this analog range is small, so
that the quantization noise will be large.

-

If we amplified the signal by (*100) , it’ll be in the range: [-2v  2v]

and the quantization noise is reduced.
SIGNAL CONDITIONING
-

If the analog signal can be +ve or –ve, use a shift up circuit (adder) to
make it in the range [0v  Vref v].
Ex.

- We wish to measure a temperature between (–40°C, 60°C) with a
resolution of (0.5°C). How many bits does the A/D converter need?
If we use a sensor with a sensitivity of (1 mV/°C) and an A/D

converter with an input range between (0 V, 5 V), how much gain is
necessary?
1- DR= (60-(-40))/0.5 = 200


We need 200 level at least to represent the output (8-bits).

2- G = 5v/100mv = 50

Or, G= (5v - 0v)/ (60mv – (-40mv)) = 50


We need to shift up the analog voltage 40mv before converting it
by the ADC.
THE PIC’S ADC
-

It’s a 10-bit, SAR ADC, with eight multiplexed inputs.

-

It can sample and process signals as fast as 25 kHz or so
accurately.

-

The analog input charges a sample and hold capacitor. The
output of the sample and hold capacitor is the input into the
converter.

-

The A/D module has high and low voltage reference input that
is software selectable to some combination of VDD, VSS, RA2,
or RA3.
THE PIC’S ADC
THE PIC’S ADC


Acquisition time: After the analog input channel is selected
(changed), you have to wait for this time before the conversion can
be started.



Conversion time: The A/D conversion requires a minimum 12TAD
per 10-bit conversion. (Tad min.=16Âľs)



How can we get (Tad)?



The four possible options for TAD are: 2Tosc, 8Tosc, 32Tosc,
Internal A/D module RC oscillator.



If you use Tosc to get Tad, ensure that Tad is greater than 16Âľs.
Registers and bits:


A/D Result High Register (ADRESH)



A/D Result Low Register (ADRESL)



The ADRESH:ADRESL registers contain the 10-bit result of the A/D
conversion.



A/D Control Register0 (ADCON0): controls the operation of the A/D
module.



A/D Control Register1 (ADCON1): configures the functions of the
port pins. The port pins can be configured as analog inputs (RA3 can
also be the voltage reference), or as digital I/O.



(GO/DONE~) bit (ADCON0<2>): cleared when the conversion is
done.



ADIF: set when the conversion is done.


These steps should be followed for doing an A/D
Conversion:

1. Configure the A/D module:
• Configure analog pins/voltage reference and digital I/O (ADCON1)
• Select A/D input channel (ADCON0)
• Select A/D conversion clock (ADCON0)

• Turn on A/D module (ADCON0)
Select the format of the result to be right-justified or left justified.


If you’ll take only

the most significant
8-bits, choose
left justified.
2. Configure A/D interrupt (if desired):

• Clear ADIF bit
• Set ADIE bit
• Set PEIE bit
• Set GIE bit
3. Wait the required acquisition time. (at least 20Âľs)
4. Start conversion:
• Set GO/DONE bit (ADCON0)
5. Wait for A/D conversion to complete, by either:
• Polling for the GO/DONE bit to be cleared

OR
• Waiting for the A/D interrupt
6. Read A/D result register pair
(ADRESH: ADRESL), clear bit ADIF if required.
7. for the next conversion, go to step 1 or step 2, as required.

Weitere ähnliche Inhalte

Was ist angesagt?

Full custom digital ic design of priority encoder
Full custom digital ic design of priority encoderFull custom digital ic design of priority encoder
Full custom digital ic design of priority encoderVishesh Thakur
 
Ultrasonic Sensor
Ultrasonic SensorUltrasonic Sensor
Ultrasonic SensorJeran Rai
 
BPSK modulation using CD 4016
BPSK modulation using CD 4016 BPSK modulation using CD 4016
BPSK modulation using CD 4016 MOHAMMAD HANNAN
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devicesISMT College
 
Instrumentation system
Instrumentation systemInstrumentation system
Instrumentation systemCKSunith1
 
Frequency Shit Keying(FSK) modulation project report
Frequency Shit Keying(FSK) modulation project reportFrequency Shit Keying(FSK) modulation project report
Frequency Shit Keying(FSK) modulation project reportMd. Rayid Hasan Mojumder
 
Successive Approximation ADC
Successive Approximation ADC Successive Approximation ADC
Successive Approximation ADC AbhayDhupar
 
Dual Input Balanced Output diffrential amp by Ap
Dual Input Balanced Output diffrential amp by ApDual Input Balanced Output diffrential amp by Ap
Dual Input Balanced Output diffrential amp by ApEr. Ashish Pandey
 
Logiq e9 with xd clear - transducer guide
Logiq e9 with xd clear - transducer guide Logiq e9 with xd clear - transducer guide
Logiq e9 with xd clear - transducer guide Madhuka Perera
 
Fire fighting robot ppt
Fire fighting robot pptFire fighting robot ppt
Fire fighting robot pptathmeg
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converterShazid Reaj
 
Distance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic SensorDistance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic SensorEdgefxkits & Solutions
 
Design & Check Cyclic Redundancy Code using VERILOG HDL
Design & Check Cyclic Redundancy Code using VERILOG HDLDesign & Check Cyclic Redundancy Code using VERILOG HDL
Design & Check Cyclic Redundancy Code using VERILOG HDLijsrd.com
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontrolleraviban
 
Ditial to Analog Converter
Ditial to Analog ConverterDitial to Analog Converter
Ditial to Analog ConverterGauravsinh Parmar
 
Top 45 visteon interview questions and answers pdf
Top 45 visteon interview questions and answers pdfTop 45 visteon interview questions and answers pdf
Top 45 visteon interview questions and answers pdfselinasimpson13
 
Multiplexer & de multiplexer
Multiplexer & de multiplexerMultiplexer & de multiplexer
Multiplexer & de multiplexervishalgohel12195
 
4.programmable dma controller 8257
4.programmable dma controller 82574.programmable dma controller 8257
4.programmable dma controller 8257MdFazleRabbi18
 

Was ist angesagt? (20)

Full custom digital ic design of priority encoder
Full custom digital ic design of priority encoderFull custom digital ic design of priority encoder
Full custom digital ic design of priority encoder
 
Ultrasonic Sensor
Ultrasonic SensorUltrasonic Sensor
Ultrasonic Sensor
 
BPSK modulation using CD 4016
BPSK modulation using CD 4016 BPSK modulation using CD 4016
BPSK modulation using CD 4016
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devices
 
Instrumentation system
Instrumentation systemInstrumentation system
Instrumentation system
 
Frequency Shit Keying(FSK) modulation project report
Frequency Shit Keying(FSK) modulation project reportFrequency Shit Keying(FSK) modulation project report
Frequency Shit Keying(FSK) modulation project report
 
Successive Approximation ADC
Successive Approximation ADC Successive Approximation ADC
Successive Approximation ADC
 
Dual Input Balanced Output diffrential amp by Ap
Dual Input Balanced Output diffrential amp by ApDual Input Balanced Output diffrential amp by Ap
Dual Input Balanced Output diffrential amp by Ap
 
Logiq e9 with xd clear - transducer guide
Logiq e9 with xd clear - transducer guide Logiq e9 with xd clear - transducer guide
Logiq e9 with xd clear - transducer guide
 
Fire fighting robot ppt
Fire fighting robot pptFire fighting robot ppt
Fire fighting robot ppt
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
 
Distance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic SensorDistance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic Sensor
 
E.s unit 6
E.s unit 6E.s unit 6
E.s unit 6
 
Design & Check Cyclic Redundancy Code using VERILOG HDL
Design & Check Cyclic Redundancy Code using VERILOG HDLDesign & Check Cyclic Redundancy Code using VERILOG HDL
Design & Check Cyclic Redundancy Code using VERILOG HDL
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
 
Ditial to Analog Converter
Ditial to Analog ConverterDitial to Analog Converter
Ditial to Analog Converter
 
Top 45 visteon interview questions and answers pdf
Top 45 visteon interview questions and answers pdfTop 45 visteon interview questions and answers pdf
Top 45 visteon interview questions and answers pdf
 
Multiplexer & de multiplexer
Multiplexer & de multiplexerMultiplexer & de multiplexer
Multiplexer & de multiplexer
 
4.programmable dma controller 8257
4.programmable dma controller 82574.programmable dma controller 8257
4.programmable dma controller 8257
 
Assignment#7b
Assignment#7bAssignment#7b
Assignment#7b
 

Ähnlich wie Interfacing to the analog world

ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORAnil Yadav
 
Fundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.pptFundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.pptBEVARAVASUDEVAAP1813
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital ConversionSyed Umair
 
ADC & DAC
ADC & DACADC & DAC
ADC & DACwewe mahir
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital ConvertersAnas Smarty
 
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptxnaveen088888
 
MODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxMODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxManjunathtv2
 
86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-ppt86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-pptGovindaChandraBehera1
 
Chap 3. signal processing elemnt part three
Chap 3. signal processing elemnt part threeChap 3. signal processing elemnt part three
Chap 3. signal processing elemnt part threeYemaneBayray
 
Analog to digital conversion
Analog to digital conversionAnalog to digital conversion
Analog to digital conversionEngr Ahmad Khan
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital convertershrutishreya14
 
simple ADC Interfacing
simple ADC Interfacingsimple ADC Interfacing
simple ADC InterfacingVarad Manglekar
 
analog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptanalog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptdaredevil15082004
 
Introduction to digital signal processing 2
Introduction to digital signal processing 2Introduction to digital signal processing 2
Introduction to digital signal processing 2Hossam Hassan
 
Sensors And Actuators
Sensors And ActuatorsSensors And Actuators
Sensors And ActuatorsJinesh Patel
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Guhan k
 

Ähnlich wie Interfacing to the analog world (20)

ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTOR
 
Fundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.pptFundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.ppt
 
ADC - Types (Analog to Digital Converter)
ADC - Types (Analog to Digital Converter)ADC - Types (Analog to Digital Converter)
ADC - Types (Analog to Digital Converter)
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital Conversion
 
ADC & DAC
ADC & DACADC & DAC
ADC & DAC
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
 
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
 
MODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxMODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptx
 
86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-ppt86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-ppt
 
Chap 3. signal processing elemnt part three
Chap 3. signal processing elemnt part threeChap 3. signal processing elemnt part three
Chap 3. signal processing elemnt part three
 
Analog to digital conversion
Analog to digital conversionAnalog to digital conversion
Analog to digital conversion
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 
simple ADC Interfacing
simple ADC Interfacingsimple ADC Interfacing
simple ADC Interfacing
 
Chapter 9.pptx
Chapter 9.pptxChapter 9.pptx
Chapter 9.pptx
 
analog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptanalog to digital adn digital to analog .ppt
analog to digital adn digital to analog .ppt
 
Adc &amp;dac ppt
Adc &amp;dac pptAdc &amp;dac ppt
Adc &amp;dac ppt
 
Introduction to digital signal processing 2
Introduction to digital signal processing 2Introduction to digital signal processing 2
Introduction to digital signal processing 2
 
Sensors And Actuators
Sensors And ActuatorsSensors And Actuators
Sensors And Actuators
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]
 
Adc ee223
Adc ee223Adc ee223
Adc ee223
 

Mehr von Islam Samir

Interrupts
InterruptsInterrupts
InterruptsIslam Samir
 
I/O Ports
I/O Ports I/O Ports
I/O Ports Islam Samir
 
Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIslam Samir
 
4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architectures4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architecturesIslam Samir
 

Mehr von Islam Samir (6)

USART
USARTUSART
USART
 
Timers
TimersTimers
Timers
 
Interrupts
InterruptsInterrupts
Interrupts
 
I/O Ports
I/O Ports I/O Ports
I/O Ports
 
Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and Microcontrollers
 
4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architectures4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architectures
 

KĂźrzlich hochgeladen

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 

KĂźrzlich hochgeladen (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Interfacing to the analog world

  • 1. INTERFACING TO THE ANALOG WORLD Prepared by: Islam Samir
  • 2. AGENDA The importance of signals.  Why do we process signals?  Continuous VS Discrete.  Analog signals VS digital signals.  How to convert an analog signal into digital?  S/H, Quantization, Encoding. 
  • 3. WHAT ARE SIGNALS?  Signals are mathematical functions that represents an electrical quantity (voltage, current ..etc).  These quantity carries information in one of its parameters [amplitude, frequency ..etc].
  • 4. WHY DO WE PROCESS SIGNALS?  1. 2. We’ve to process these signals in an appropriate way to: Extract the information that they carry. To get them in a better form (filtering).
  • 5. CONTINUOUS VS DISCRETE  -  - - Continuous Signals: Signals that are defined for all time instants. Discrete signals: Signals that are defined only for certain time instants: T, 2T, 3T, ….etc. (T) is the sampling time of the original continuous signal.
  • 6. ANALOG SIGNALS  For analog signals, the voltage - or current - can take any value and the system is supposed to respond to this value.  Information is represented by changing the signal’s voltage, current, frequency, or total charge.  The amplitude of an analog signal can take any value.
  • 7. THE RULE OF TRANSDUCERS (SENSORS)   Information is converted from some other physical form (sound, light, temperature ..etc) to an electrical signal by a transducer. The processing system (analog or digital) can then take the right decision based on the electrical quantity that it monitors, which represents the corresponding physical quantity.
  • 8. DIGITAL SIGNALS   Digital signals are discretized in time, and quantized in amplitude. The time interval between each number and the next is Ts.
  • 9. Digital signals are the only type of signals that can be processed by digital systems. Sensor Signal Conditioning Analog Continuoustime signal ADC Digital signal We use the (signal conditioning circuitry + ADC) to convert an analog continous-time signal into a digital signal.
  • 10. DIGITAL SIGNALS  A digital computer can only deal with binary values, these values change in a limited range due to the limited word length. Ex. For an 8-bit register 28 ) values only.  It can hold one of 256 ( So, digital signals can take one of certain values only (Quantized).
  • 11. DIGITAL SIGNALS - The hardware that converts an analog signal to digital needs time to quantize this signal and encode it. Also we need time for the required processing. - We use a (Sample & Hold) circuit that takes samples of the original continuous signal every time interval (Ts), where: Ts> hardware delay + processing delay  So, digital signals are discretized in time.  Digital signals are discretized in both time and amplitude.
  • 12. ANALOG VS DIGITAL Analog signals Digital signals The signal’s amplitude can take any value. The signal’s amplitude is limited to a certain range of values. (Quantized) Can be discrete or continuous in time. Always discrete in time.
  • 13. HOW TO CONVERT ANALOG SIGNALS TO DIGITAL?
  • 14. HOW TO CONVERT ANALOG SIGNALS TO DIGITAL? LPF: Low pass filter S/H: Sample and hold circuit. X(t): Analog signal to be converted. X(kTs): Sampled signal. Xq(kTs): Quantized signal.
  • 15. HOW TO CONVERT ANALOG SIGNALS TO DIGITAL? 1. LPF: The signal is filtered and band limited to 0.5 Fs, in order to avoid aliasing. (Review sampling theorem)  Fs≥2Fm [Nyquist rate] Fm: the max. signal frequency. - 1. 2. If the sampled signal is not band limited, aliasing will occur. This will result: The digital signal produced is not representing the original analog signal. If we tried to reproduce the analog signal it’ll be distorted.
  • 16. HOW TO CONVERT ANALOG SIGNALS TO DIGITAL? 1. a) b) (S/H): To convert the continuous signal to a discrete signal. This is done for two reasons: A time is required for the ADC to quantize and encode the coming sample. A time is required to do the required processing on this sample.
  • 17. HOW TO CONVERT ANALOG SIGNALS TO DIGITAL? Quantizer: Due to the limited word length of any digital computer , the sample’s value must be within a certain range according to the number of bits used to represent the sample. Ex. If we used an 8 – bit ADC The sample can take one of 256 values. 3.  The quantizer has to approximate every sample to the nearest level.
  • 18. HOW TO CONVERT ANALOG SIGNALS TO DIGITAL? 4. - Encoder: After quantization, the quantized sample must be encoded to the corresponding binary value by an encoder. Usually, the quantizer and the encoder are implemented by the same hardware. The use of quantization introduces an error between the input signal and the signal at the quantizer output. quantization error or (e) - , where: e = X(t) – Xq(kTs)
  • 19. Example. Discrete & analog signal Discrete & quantized signal (Digital signal)
  • 20. ANALOG-TO-DIGITAL CONVERTER  1. 2. - The ADC converts an analog sample into the corresponding digital value according to: The (Full-scale) voltage. (called also Vref). The number of bits. The conversion can be: unipolar (0  +Vfs) or bipolar (-Vfs  (+Vfs-1LSB)). or (Vref-)  (Vref +).
  • 21. ANALOG-TO-DIGITAL CONVERTER  In an A/D converter, Q = 1 LSB.  Q determines the resolution of the system, that is, the lowest change in voltage that will produce a code change. Dynamic range: - It’s the minimum number of voltage levels needed to represent a certain voltage signal, according to the range of this signal and the required resolution.
  • 22. Ex. 4-bit ADC , Vref=10v (Unipolar)  note that the analog value represented by the all-ones code is not full-scale (FS), but (FS – 1 LSB).
  • 23. Transfer function of a 3-bit ADC (Unipolar) - There is a range of analog input voltage over which the ADC will produce a given output code; this range is the quantization uncertainty and is equal to 1 LSB.
  • 24. Ex. 4-bit ADC (Bipolar) - In order to maintain perfect symmetry about midscale, the allzeros code (0000) representing negative full-scale (–FS) is not normally used in computation.
  • 25. Transfer function of a 3-bit ADC (Bipolar) - Most ADC ICs are unipolar. To monitor both positive and negative voltage values, use a level shifter circuit before the ADC.
  • 26. SIGNAL CONDITIONING  Typical sensors yield low-amplitude analog signals that need to be amplified and then digitized by means of an (A/D) converter.  To adapt the analog signal to the range of expected amplitude at the input of the A/D converter, a signal conditioner is used. Ex. If the analog signal in the range: [-20mv  20mv] and the ADC is [0v  5v] - The number of values that represent this analog range is small, so that the quantization noise will be large. - If we amplified the signal by (*100) , it’ll be in the range: [-2v  2v] and the quantization noise is reduced.
  • 27. SIGNAL CONDITIONING - If the analog signal can be +ve or –ve, use a shift up circuit (adder) to make it in the range [0v  Vref v].
  • 28. Ex. - We wish to measure a temperature between (–40°C, 60°C) with a resolution of (0.5°C). How many bits does the A/D converter need? If we use a sensor with a sensitivity of (1 mV/°C) and an A/D converter with an input range between (0 V, 5 V), how much gain is necessary? 1- DR= (60-(-40))/0.5 = 200  We need 200 level at least to represent the output (8-bits). 2- G = 5v/100mv = 50 Or, G= (5v - 0v)/ (60mv – (-40mv)) = 50  We need to shift up the analog voltage 40mv before converting it by the ADC.
  • 29. THE PIC’S ADC - It’s a 10-bit, SAR ADC, with eight multiplexed inputs. - It can sample and process signals as fast as 25 kHz or so accurately. - The analog input charges a sample and hold capacitor. The output of the sample and hold capacitor is the input into the converter. - The A/D module has high and low voltage reference input that is software selectable to some combination of VDD, VSS, RA2, or RA3.
  • 31. THE PIC’S ADC  Acquisition time: After the analog input channel is selected (changed), you have to wait for this time before the conversion can be started.  Conversion time: The A/D conversion requires a minimum 12TAD per 10-bit conversion. (Tad min.=16Âľs)  How can we get (Tad)?  The four possible options for TAD are: 2Tosc, 8Tosc, 32Tosc, Internal A/D module RC oscillator.  If you use Tosc to get Tad, ensure that Tad is greater than 16Âľs.
  • 32. Registers and bits:  A/D Result High Register (ADRESH)  A/D Result Low Register (ADRESL)  The ADRESH:ADRESL registers contain the 10-bit result of the A/D conversion.  A/D Control Register0 (ADCON0): controls the operation of the A/D module.  A/D Control Register1 (ADCON1): configures the functions of the port pins. The port pins can be configured as analog inputs (RA3 can also be the voltage reference), or as digital I/O.  (GO/DONE~) bit (ADCON0<2>): cleared when the conversion is done.  ADIF: set when the conversion is done.
  • 33.  These steps should be followed for doing an A/D Conversion: 1. Configure the A/D module: • Configure analog pins/voltage reference and digital I/O (ADCON1) • Select A/D input channel (ADCON0) • Select A/D conversion clock (ADCON0) • Turn on A/D module (ADCON0) Select the format of the result to be right-justified or left justified.  If you’ll take only the most significant 8-bits, choose left justified.
  • 34. 2. Configure A/D interrupt (if desired): • Clear ADIF bit • Set ADIE bit • Set PEIE bit • Set GIE bit 3. Wait the required acquisition time. (at least 20Âľs) 4. Start conversion: • Set GO/DONE bit (ADCON0) 5. Wait for A/D conversion to complete, by either: • Polling for the GO/DONE bit to be cleared OR • Waiting for the A/D interrupt 6. Read A/D result register pair (ADRESH: ADRESL), clear bit ADIF if required. 7. for the next conversion, go to step 1 or step 2, as required.

Hinweis der Redaktion

  1. دايما في كل السيشنز بحاول أركز علي الكونسبتس المطعلقة ب بريفرال معين وامتا نستخدمه ال اوبريشن بتاعته بعد كده بنتكلم عن ازاي ال بريفرال ده بيشتغل جوه الكونترولر انهارده حنعمل كده برده لما نتكلم عن ال ا تو دي حنشرح الكونسبتس المهمة زي السجنال كوندشننج والسامبلنج فريكوينسي وغيرها وبعد كده في الاخر خالص حنتكلم عن ال ا تو دي