SlideShare a Scribd company logo
1 of 26
“KEYBOARD,DAC AND SENSOR INTERFACING”
PROF. ASHISH B PANDYA
INTERFACE 4×4 MATRIX KEYPAD WITH AVR
ATmega 32 MICROCONTROLLER
 Keyboard is used in our ATM Machine, Computer, Mobile Phone
etc.
 what is the maximum keyboard size which can be interfaced with
8051 microcontroller
 The answer is 16*16 as 8051 (AT89C51) has 32 I/O pins
 Typically one port pin is required to read a digital input into the
controller.
 When there are a lot of digital input that has to be read, it is not
feasible to allocate one pin for each of them.
 This is when a matrix keypad arrangement is used to reduce the
pin count
 Therefore, the number of pins that are required to interface a
given number of inputs decreases with increase in the order of
the matrix.
If The Matrix Is 2×2, You Will Need 2 Pins For
The Rows And 2 Pins For The Columns In
Such A Case There Is No Difference In The
Cost Of Reading That Many Inputs. But If You
Consider A 10×10 Matrix You Will Just Need
20 Pins (10 For The Rows And 10 For The
Columns) To Read 100 Digital Inputs.
 Initially all switches are assumed to be released. So there is no
connection between the rows and columns.
 When any one of the switches are pressed, the corresponding rows
and columns are connected (short circuited).
 This will drive that column pin (initially high) low. Using this logic,
the button press can be detected. The colors red and black is for
logic high and low respectively.
Step 1:
 The first step involved in interfacing the matrix keypad is to write all
logic 0’s to the rows and all logic 1’s to the columns. In the image,
black line symbolizes logic 0 and red line symbolizes logic 1.
 For now let us assume that, the circled key is pressed and see how
the key press can be detected by a software routine.
Step 2:
 Now the software has to scan the pins connected to columns of the
keypad. If it detects a logic 0 in any one of the columns, then a key
press was made in that column. This is because the event of the
switch press shorts the C2 line with R2. Hence C2 is driven low.
Step 3:
 Once the column corresponding to the key pressed is located, the
next thing that the software has to do is to start writing logic 1’s to
the rows sequentially (one after the other) and check if C2 become
high.
 The logic is that if a button in that row was pressed, then the value
written to that row will be reflected in determined column (C2) as
they are short circuited.
Step 4:
 The procedure is followed till C2 goes high with logic high is written
to a row. In this case, a logic high to the second row will be reflected
in the second column.
 Note: color of the lines indicate the logic values they return
 We already know the key press happened at column 2. Now we
have detected that the key is in row 2. So, the position of the key in
the matrix is (2,2)
This section will show how to interface a DAC (digital-to-
analog converter) to the 8051
DAC INTERFACING
 Digital-to-analog (DAC) converter :
The digital-to-analog converter (DAC) is a device widely used to
convert digital pulses to analog signals
 MC1408 DAC (or DAC808) :
In the MC1408 (DAC0808), the digital inputs are converted to
current (Iout), and by connecting a resistor to the Iout pin, we convert
the result to voltage. The total current provided by the Iout pin is a
function of the binary numbers at the D0-D7 inputs of the DAC0808
and the reference current (Iref), and is as follows
where D0 is the LSB, D7 is the MSB for the inputs, and Iref is the input current that
must be applied to pin 14.
GENERATING A SINE WAVE
 To generate a sine wave, we first need a table whose values
represent the magnitude of the sine of angles between 0 and 360
degrees. The values for the sine function vary from -1.0 to +1.0 for
0 – to 360- ° angles. Therefore, to achieve the full-scale 10 V
output, we use the following equation.
 Vout of DAC for various angles is calculated and shown:
INTERFACING TEMPERATURE
SENSOR
a thermistor responds to temperature change by
changing resistance
 A thermistor responds to temperature change by changing
resistance
 Its response is not linear
 The complexity associated with writing software for such nonlinear
devices has led many manufacturers to market the linear
temperature sensor
LM34 and LM35 Temperature Sensors
 The sensors of the LM34/LM35 series are precision integrated-
circuit temperature sensors
 The output voltage is linearly proportional to the Fahrenheit/Celsius
temperature
 The LM34/LM35 requires no external calibration since it is
inherently calibrated
 It outputs 10 mV for each degree of Fahrenheit/Celsius
temperature
Signal Conditioning and Interfacing LM35
Signal conditioning is a widely used term in the world
of data acquisition
 It is the conversion of the signals (voltage, current, charge,
capacitance, and resistance) produced by transducers to
voltage, which is sent to the input of an A-to-D converter
 Signal conditioning can be a current-to-voltage conversion or a signal
amplification
 The thermistor changes resistance with temperature
Signal conditioning and interfacing the LM35 to
the 8051

More Related Content

Similar to Analog to Digital .pptx

05 analog control_sp15
05 analog control_sp1505 analog control_sp15
05 analog control_sp15
John Todora
 
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
 
Interfacing to the analog world
Interfacing to the analog worldInterfacing to the analog world
Interfacing to the analog world
Islam Samir
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
satyamsinha37
 

Similar to Analog to Digital .pptx (20)

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
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051
 
adc dac converter
adc dac converteradc dac converter
adc dac converter
 
Bt0064 logic design2
Bt0064 logic design2Bt0064 logic design2
Bt0064 logic design2
 
05 analog control_sp15
05 analog control_sp1505 analog control_sp15
05 analog control_sp15
 
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
 
B sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lcktB sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lckt
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]
 
Interfacing to the analog world
Interfacing to the analog worldInterfacing to the analog world
Interfacing to the analog world
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
 
INTERFACING ANALAOG TO DIGITAL CONVERTER (ADC0808/09) TO 8051 MICROCONTROLLER
 INTERFACING ANALAOG TO DIGITAL CONVERTER (ADC0808/09) TO 8051 MICROCONTROLLER   INTERFACING ANALAOG TO DIGITAL CONVERTER (ADC0808/09) TO 8051 MICROCONTROLLER
INTERFACING ANALAOG TO DIGITAL CONVERTER (ADC0808/09) TO 8051 MICROCONTROLLER
 
Microcontrollers
MicrocontrollersMicrocontrollers
Microcontrollers
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2
 
ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTOR
 
Adc dac converter
Adc dac converterAdc dac converter
Adc dac converter
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital Conversion
 

Recently uploaded

Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...
IJECEIAES
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
Sampad Kar
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
Madan Karki
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
IJECEIAES
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
BalamuruganV28
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
rahulmanepalli02
 

Recently uploaded (20)

Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Lab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxLab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docx
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Students
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 

Analog to Digital .pptx

  • 1. “KEYBOARD,DAC AND SENSOR INTERFACING” PROF. ASHISH B PANDYA
  • 2. INTERFACE 4×4 MATRIX KEYPAD WITH AVR ATmega 32 MICROCONTROLLER  Keyboard is used in our ATM Machine, Computer, Mobile Phone etc.  what is the maximum keyboard size which can be interfaced with 8051 microcontroller  The answer is 16*16 as 8051 (AT89C51) has 32 I/O pins
  • 3.  Typically one port pin is required to read a digital input into the controller.  When there are a lot of digital input that has to be read, it is not feasible to allocate one pin for each of them.  This is when a matrix keypad arrangement is used to reduce the pin count  Therefore, the number of pins that are required to interface a given number of inputs decreases with increase in the order of the matrix.
  • 4. If The Matrix Is 2×2, You Will Need 2 Pins For The Rows And 2 Pins For The Columns In Such A Case There Is No Difference In The Cost Of Reading That Many Inputs. But If You Consider A 10×10 Matrix You Will Just Need 20 Pins (10 For The Rows And 10 For The Columns) To Read 100 Digital Inputs.
  • 5.
  • 6.  Initially all switches are assumed to be released. So there is no connection between the rows and columns.  When any one of the switches are pressed, the corresponding rows and columns are connected (short circuited).  This will drive that column pin (initially high) low. Using this logic, the button press can be detected. The colors red and black is for logic high and low respectively.
  • 7. Step 1:  The first step involved in interfacing the matrix keypad is to write all logic 0’s to the rows and all logic 1’s to the columns. In the image, black line symbolizes logic 0 and red line symbolizes logic 1.  For now let us assume that, the circled key is pressed and see how the key press can be detected by a software routine.
  • 8. Step 2:  Now the software has to scan the pins connected to columns of the keypad. If it detects a logic 0 in any one of the columns, then a key press was made in that column. This is because the event of the switch press shorts the C2 line with R2. Hence C2 is driven low.
  • 9. Step 3:  Once the column corresponding to the key pressed is located, the next thing that the software has to do is to start writing logic 1’s to the rows sequentially (one after the other) and check if C2 become high.  The logic is that if a button in that row was pressed, then the value written to that row will be reflected in determined column (C2) as they are short circuited.
  • 10. Step 4:  The procedure is followed till C2 goes high with logic high is written to a row. In this case, a logic high to the second row will be reflected in the second column.  Note: color of the lines indicate the logic values they return
  • 11.  We already know the key press happened at column 2. Now we have detected that the key is in row 2. So, the position of the key in the matrix is (2,2)
  • 12.
  • 13. This section will show how to interface a DAC (digital-to- analog converter) to the 8051 DAC INTERFACING
  • 14.  Digital-to-analog (DAC) converter : The digital-to-analog converter (DAC) is a device widely used to convert digital pulses to analog signals  MC1408 DAC (or DAC808) : In the MC1408 (DAC0808), the digital inputs are converted to current (Iout), and by connecting a resistor to the Iout pin, we convert the result to voltage. The total current provided by the Iout pin is a function of the binary numbers at the D0-D7 inputs of the DAC0808 and the reference current (Iref), and is as follows
  • 15. where D0 is the LSB, D7 is the MSB for the inputs, and Iref is the input current that must be applied to pin 14.
  • 16.
  • 17. GENERATING A SINE WAVE  To generate a sine wave, we first need a table whose values represent the magnitude of the sine of angles between 0 and 360 degrees. The values for the sine function vary from -1.0 to +1.0 for 0 – to 360- ° angles. Therefore, to achieve the full-scale 10 V output, we use the following equation.
  • 18.  Vout of DAC for various angles is calculated and shown:
  • 19.
  • 20. INTERFACING TEMPERATURE SENSOR a thermistor responds to temperature change by changing resistance
  • 21.  A thermistor responds to temperature change by changing resistance  Its response is not linear  The complexity associated with writing software for such nonlinear devices has led many manufacturers to market the linear temperature sensor
  • 22. LM34 and LM35 Temperature Sensors  The sensors of the LM34/LM35 series are precision integrated- circuit temperature sensors  The output voltage is linearly proportional to the Fahrenheit/Celsius temperature  The LM34/LM35 requires no external calibration since it is inherently calibrated  It outputs 10 mV for each degree of Fahrenheit/Celsius temperature
  • 23.
  • 24. Signal Conditioning and Interfacing LM35 Signal conditioning is a widely used term in the world of data acquisition  It is the conversion of the signals (voltage, current, charge, capacitance, and resistance) produced by transducers to voltage, which is sent to the input of an A-to-D converter  Signal conditioning can be a current-to-voltage conversion or a signal amplification  The thermistor changes resistance with temperature
  • 25.
  • 26. Signal conditioning and interfacing the LM35 to the 8051