SlideShare a Scribd company logo
1 of 33
CONCEPT OF ANALOG VS DIGITAL IN
ARDUINO
Terminology
Analog: continuously valued signal, such as temperature or speed with infinite possible
values in between.
Digital: discretely valued signal such as integers, encoded in binary
Analog Signal
Analog signal – directly measurable quantities in terms of some other quantity. It can
have infinite number of values and varies continuously with time. Analog signal is usually
represented by sine wave.
Examples
human voice. When we speak, we use air to transmit an analog signal. Electrical signal
from an audio tape, can also be in analog form
Digital Signal
Digital Signal – have only two states. For digital computers, we refer to binary states, 0
and 1. 1 = ON, 0 = OFF. It is also known as a square wave or clock signal
Example:
a low pulse or no pulse represents a "0" and a high or pulse indicates a "1". The
illustration is an example of how digital signals may look.
Analog-to-Digital Conversion Principle
 The basic principle of operation is to use the comparator principle to determine
whether to turn on bit of the binary number output
 It is typical for an ADC to use a Digital-to-Analog conversion (DAC) to determine one of
the inputs to the comparator.
 When we interface sensors to the microcontroller, the output of the sensor many of the
times is analog in nature. But microcontroller processes digital signals.
 Hence, we use ADC in between sensor and microcontroller. It converts an analog
signal into digital and gives it to the microcontroller. The function that you use to obtain
the value of an analog signal is analogRead(pin).
 The Arduino does not have a built-in digital-to-analog converter (DAC), but it can
pulse-width modulate (PWM) a digital signal to achieve some of the functions of an
analog output. The function used to output a PWM signal is analogWrite(pin, value).
Analog-to-Digital Conversion Principle
These logical values are nothing more than a signal can only assume 0V and a max
voltage which is 5V
Although the Arduino can read and write these digital signals , not all devices work with
digital logic.
Potentiometer. It is manually adjustable variable resistor that acts as a variable voltage
divider.
Example, reading the values from a pot. It can be control the output voltage of
potentiometer by changing the knob position. The pot can be vary from 0 up to 1023
reading value.
Analog-to-Digital Conversion Principle
Analog Components
How to read analog values?
ADC is a piece of hardware that converts analog values to digital values.
The sine wave is range between 0 and 5 Volt. The analog signal is continuous in time
and it is necessary to convert this into a flow of digital values.
How to read analog values?
Consider a set of time instances in a given interval. This is call as SAMPLING. In other
words, take a sample from time to time. The number of samples acquired per second =
sampling rate.
How to change the analog value of each sample into a digital value?
How to read analog values?
The signal is divided into 2 horizontal sections. For each sample, if it’s analog values
falls into upper section, it is converted into digital value, 1. if the value falls the bottom
section, the digital value is 0
How to read analog values?
The signal is divided into 2 horizontal sections. For each sample, if it’s analog values
falls into upper section, it is converted into digital value, 1. if the value falls the bottom
section, the digital value is 0
How to read analog values?
The signal is divided into 2 horizontal sections. For each sample, if it’s analog values
falls into upper section, it is converted into digital value, 1. if the value falls the bottom
section, the digital value is 0
How to read analog values?
The signal is divided into 2 horizontal sections. For each sample, if it’s analog values
falls into upper section, it is converted into digital value, 1. if the value falls the bottom
section, the digital value is 0
How to read analog values?
How to read analog values?
Conversion happen here! The first sample falls into the upper region = 1
Signal converted : 1
How to read analog values?
The second sample falls into the bottom region so it’s a 0
Signal converted : 1 0
How to read analog values?
The last sample falls into the bottom region which correspond to digital value 0
Signal converted : 1 0 0
How to read analog values?
Analog signal already converted to digital with 1 bit accuracy. This process is called
Quantization
Signal converted : 1 0 0
The Arduino has set of functionalities that allow the
conversion of analog values to digital values. It contains:
 10 bit of ADC
 6 separate inputs ; can convert the value between 0 and
5 volts on the Arduino to digital value that range
between 0 to 1023
 Function that interacts with ADC, analogRead(pin)
READING A POTENTIOMETER
Tutorial
Material needed:
Wiring connection
Code
Discussion
1. What is the maximum value of potentiometer when connected to 3.3V?
2. Discuss among your friends, why it happen?
3. What happen if change 3.3V to 5V? Discuss, what is the output result of maximum
value potentiometer and why it happen?
PULSE WIDTH MODULATION
(PWM)
Introduction
Pulse Width Modulation (PWM) is a digital technology that uses the amount of power
delivered to a device that can be changed. It generates analogue signals by using a
digital source. A PWM signal is basically a square wave which is switched between on
and off state. The duty cycle and frequency of a PWM signal determine its behavior.
Duty Cycle in PWM
The duty cycle of the PWM signal refers to the ratio of the time that the signal is in a
high(on) state over the total time it takes to complete one cycle. It is commonly
expressed as a percentage or a ratio.
Which pins of Arduino support PWM?
Not all pins of Arduino support PWM. On the Uno board, the pins are specifically marked
with a ~ symbol.
As can be seen from the picture, only pins 3,5,6,9,10 and
11 can support PWM. The frequency of the square wave
is 490 Hz (about 2 ms time period) on all pins except 5
and 6, on which it is 980 Hz (about 1s time period).
APPLICATION OF PWM
LED brightening followed by dimming
connect an LED to a PWM pin, and keep increasing the duty cycle on that pin, thereby
increasing the voltage on that pin. Thus, the LED will keep getting brighter, till the max
duty cycle (100) is reached. note that an 8-bit number is used to represent the duty
cycle. Thus, the duty cycle can vary from 0 to 255. Thus, the value of 255 corresponds to
duty cycle of 100%. 127 represents ~50% duty cycle, and so on.
circuit diagram
Code

More Related Content

Similar to Chapter 9.pptx

Sensors And Actuators
Sensors And ActuatorsSensors And Actuators
Sensors And ActuatorsJinesh Patel
 
Introduction to digital signal processing 2
Introduction to digital signal processing 2Introduction to digital signal processing 2
Introduction to digital signal processing 2Hossam Hassan
 
MODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxMODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxManjunathtv2
 
Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsNiket Chandrashekar
 
Unit IV DA & AD Convertors and Phase Locked Loop
Unit IV  DA & AD Convertors and Phase Locked LoopUnit IV  DA & AD Convertors and Phase Locked Loop
Unit IV DA & AD Convertors and Phase Locked LoopDr.Raja R
 
adcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxadcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxshivraj3252
 
Digital transmission & analog Digital to conversion
Digital transmission &  analog Digital to conversionDigital transmission &  analog Digital to conversion
Digital transmission & analog Digital to conversionChAwais15
 
Analog and digital signals
Analog and digital signalsAnalog and digital signals
Analog and digital signalsteja reddy
 
adc dac converter
adc dac converteradc dac converter
adc dac converterGaurav Rai
 
Meeting w9 chapter 3 part 2
Meeting w9   chapter 3 part 2Meeting w9   chapter 3 part 2
Meeting w9 chapter 3 part 2Hattori Sidek
 
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
 
Data acquisition system
Data acquisition systemData acquisition system
Data acquisition systemgirishgandhi4
 
ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORAnil Yadav
 
The iot academy_embeddedsystems_training_basicselectronicspart2
The iot academy_embeddedsystems_training_basicselectronicspart2The iot academy_embeddedsystems_training_basicselectronicspart2
The iot academy_embeddedsystems_training_basicselectronicspart2The IOT Academy
 

Similar to Chapter 9.pptx (20)

Sensors And Actuators
Sensors And ActuatorsSensors And Actuators
Sensors And Actuators
 
Introduction to digital signal processing 2
Introduction to digital signal processing 2Introduction to digital signal processing 2
Introduction to digital signal processing 2
 
Computer hardware
Computer hardware Computer hardware
Computer hardware
 
MODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxMODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptx
 
Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter Fundamentals
 
Unit IV DA & AD Convertors and Phase Locked Loop
Unit IV  DA & AD Convertors and Phase Locked LoopUnit IV  DA & AD Convertors and Phase Locked Loop
Unit IV DA & AD Convertors and Phase Locked Loop
 
adcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxadcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptx
 
Digital transmission & analog Digital to conversion
Digital transmission &  analog Digital to conversionDigital transmission &  analog Digital to conversion
Digital transmission & analog Digital to conversion
 
Analog and digital signals
Analog and digital signalsAnalog and digital signals
Analog and digital signals
 
ADC - Types (Analog to Digital Converter)
ADC - Types (Analog to Digital Converter)ADC - Types (Analog to Digital Converter)
ADC - Types (Analog to Digital Converter)
 
adc dac converter
adc dac converteradc dac converter
adc dac converter
 
Lecture 08
Lecture 08Lecture 08
Lecture 08
 
Meeting w9 chapter 3 part 2
Meeting w9   chapter 3 part 2Meeting w9   chapter 3 part 2
Meeting w9 chapter 3 part 2
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Adc convertors
Adc convertorsAdc convertors
Adc convertors
 
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
 
Lec2
Lec2Lec2
Lec2
 
Data acquisition system
Data acquisition systemData acquisition system
Data acquisition system
 
ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTOR
 
The iot academy_embeddedsystems_training_basicselectronicspart2
The iot academy_embeddedsystems_training_basicselectronicspart2The iot academy_embeddedsystems_training_basicselectronicspart2
The iot academy_embeddedsystems_training_basicselectronicspart2
 

More from AnisZahirahAzman (15)

Chapter 6.pdf
Chapter 6.pdfChapter 6.pdf
Chapter 6.pdf
 
Chapter 4.pdf
Chapter 4.pdfChapter 4.pdf
Chapter 4.pdf
 
Chapter 10.pdf
Chapter 10.pdfChapter 10.pdf
Chapter 10.pdf
 
Chapter 3.pdf
Chapter 3.pdfChapter 3.pdf
Chapter 3.pdf
 
Chapter 2.pdf
Chapter 2.pdfChapter 2.pdf
Chapter 2.pdf
 
Chapter 1.pdf
Chapter 1.pdfChapter 1.pdf
Chapter 1.pdf
 
Chapter 2.pdf
Chapter 2.pdfChapter 2.pdf
Chapter 2.pdf
 
Chapter 1.pdf
Chapter 1.pdfChapter 1.pdf
Chapter 1.pdf
 
Chapter 1.pdf
Chapter 1.pdfChapter 1.pdf
Chapter 1.pdf
 
Chapter 13.pptx
Chapter 13.pptxChapter 13.pptx
Chapter 13.pptx
 
IoT Protocol Stack.pdf
IoT Protocol Stack.pdfIoT Protocol Stack.pdf
IoT Protocol Stack.pdf
 
connecting smart object in IoT.pptx
connecting smart object in IoT.pptxconnecting smart object in IoT.pptx
connecting smart object in IoT.pptx
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptx
 
introduction to c.pptx
introduction to c.pptxintroduction to c.pptx
introduction to c.pptx
 
component of c language.pptx
component of c language.pptxcomponent of c language.pptx
component of c language.pptx
 

Recently uploaded

Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 

Chapter 9.pptx

  • 1. CONCEPT OF ANALOG VS DIGITAL IN ARDUINO
  • 2. Terminology Analog: continuously valued signal, such as temperature or speed with infinite possible values in between. Digital: discretely valued signal such as integers, encoded in binary
  • 3. Analog Signal Analog signal – directly measurable quantities in terms of some other quantity. It can have infinite number of values and varies continuously with time. Analog signal is usually represented by sine wave. Examples human voice. When we speak, we use air to transmit an analog signal. Electrical signal from an audio tape, can also be in analog form
  • 4. Digital Signal Digital Signal – have only two states. For digital computers, we refer to binary states, 0 and 1. 1 = ON, 0 = OFF. It is also known as a square wave or clock signal Example: a low pulse or no pulse represents a "0" and a high or pulse indicates a "1". The illustration is an example of how digital signals may look.
  • 5. Analog-to-Digital Conversion Principle  The basic principle of operation is to use the comparator principle to determine whether to turn on bit of the binary number output  It is typical for an ADC to use a Digital-to-Analog conversion (DAC) to determine one of the inputs to the comparator.  When we interface sensors to the microcontroller, the output of the sensor many of the times is analog in nature. But microcontroller processes digital signals.  Hence, we use ADC in between sensor and microcontroller. It converts an analog signal into digital and gives it to the microcontroller. The function that you use to obtain the value of an analog signal is analogRead(pin).  The Arduino does not have a built-in digital-to-analog converter (DAC), but it can pulse-width modulate (PWM) a digital signal to achieve some of the functions of an analog output. The function used to output a PWM signal is analogWrite(pin, value).
  • 6. Analog-to-Digital Conversion Principle These logical values are nothing more than a signal can only assume 0V and a max voltage which is 5V Although the Arduino can read and write these digital signals , not all devices work with digital logic.
  • 7. Potentiometer. It is manually adjustable variable resistor that acts as a variable voltage divider. Example, reading the values from a pot. It can be control the output voltage of potentiometer by changing the knob position. The pot can be vary from 0 up to 1023 reading value. Analog-to-Digital Conversion Principle
  • 9. How to read analog values? ADC is a piece of hardware that converts analog values to digital values.
  • 10. The sine wave is range between 0 and 5 Volt. The analog signal is continuous in time and it is necessary to convert this into a flow of digital values. How to read analog values?
  • 11. Consider a set of time instances in a given interval. This is call as SAMPLING. In other words, take a sample from time to time. The number of samples acquired per second = sampling rate. How to change the analog value of each sample into a digital value? How to read analog values?
  • 12. The signal is divided into 2 horizontal sections. For each sample, if it’s analog values falls into upper section, it is converted into digital value, 1. if the value falls the bottom section, the digital value is 0 How to read analog values?
  • 13. The signal is divided into 2 horizontal sections. For each sample, if it’s analog values falls into upper section, it is converted into digital value, 1. if the value falls the bottom section, the digital value is 0 How to read analog values?
  • 14. The signal is divided into 2 horizontal sections. For each sample, if it’s analog values falls into upper section, it is converted into digital value, 1. if the value falls the bottom section, the digital value is 0 How to read analog values?
  • 15. The signal is divided into 2 horizontal sections. For each sample, if it’s analog values falls into upper section, it is converted into digital value, 1. if the value falls the bottom section, the digital value is 0 How to read analog values?
  • 16. How to read analog values? Conversion happen here! The first sample falls into the upper region = 1 Signal converted : 1
  • 17. How to read analog values? The second sample falls into the bottom region so it’s a 0 Signal converted : 1 0
  • 18. How to read analog values? The last sample falls into the bottom region which correspond to digital value 0 Signal converted : 1 0 0
  • 19. How to read analog values? Analog signal already converted to digital with 1 bit accuracy. This process is called Quantization Signal converted : 1 0 0
  • 20. The Arduino has set of functionalities that allow the conversion of analog values to digital values. It contains:  10 bit of ADC  6 separate inputs ; can convert the value between 0 and 5 volts on the Arduino to digital value that range between 0 to 1023  Function that interacts with ADC, analogRead(pin)
  • 24. Code
  • 25. Discussion 1. What is the maximum value of potentiometer when connected to 3.3V? 2. Discuss among your friends, why it happen? 3. What happen if change 3.3V to 5V? Discuss, what is the output result of maximum value potentiometer and why it happen?
  • 27. Introduction Pulse Width Modulation (PWM) is a digital technology that uses the amount of power delivered to a device that can be changed. It generates analogue signals by using a digital source. A PWM signal is basically a square wave which is switched between on and off state. The duty cycle and frequency of a PWM signal determine its behavior.
  • 28. Duty Cycle in PWM The duty cycle of the PWM signal refers to the ratio of the time that the signal is in a high(on) state over the total time it takes to complete one cycle. It is commonly expressed as a percentage or a ratio.
  • 29. Which pins of Arduino support PWM? Not all pins of Arduino support PWM. On the Uno board, the pins are specifically marked with a ~ symbol. As can be seen from the picture, only pins 3,5,6,9,10 and 11 can support PWM. The frequency of the square wave is 490 Hz (about 2 ms time period) on all pins except 5 and 6, on which it is 980 Hz (about 1s time period).
  • 31. LED brightening followed by dimming connect an LED to a PWM pin, and keep increasing the duty cycle on that pin, thereby increasing the voltage on that pin. Thus, the LED will keep getting brighter, till the max duty cycle (100) is reached. note that an 8-bit number is used to represent the duty cycle. Thus, the duty cycle can vary from 0 to 255. Thus, the value of 255 corresponds to duty cycle of 100%. 127 represents ~50% duty cycle, and so on.
  • 33. Code

Editor's Notes

  1. NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image.