SlideShare a Scribd company logo
1 of 9
Direct Analog-To-Microcontroller Interfacing

This paper will demonstrate how signals from analog sensors can be directly interfaced to any
digitalembedded system even though they may not be equipped with an on-chip ADC (Analog-
to-Digital Converter),comparator or OP amp (Operational Amplifier). With only two resistors
and one capacitor, we willpresent a solution that allows analog voltages to be measured directly
using only a few digital I/O-pins.The digital target system requirements are minimized and
limited to only two digital I/O-pins (with tristatecapability). No ADC, comparators, timers or
capture modules are necessary. The extremely modesthardware requirements make it a suitable
solution also for CPLDs/FPGAs (Complex Programmable Logicdevices/Field Programmable
Gate Arrays). Since this solution will allow even the simplest embeddedsystem to be interfaced
to analog voltage sensors, it has the potential of reducing design costs considerably.The proposed
design is for DC or low-frequency signals and compared to other similar solution, thisdesign
needs no embedded analog blocks at all.

The techniques of interfacing analog sensors directly to digitalembedded systems without the use
of embedded ADCs or complexsignal conditioning electronics was developed in the mid-
1990s.These techniques may be divided into two categories. One class ofinterfaces focused on
passive sensors (i.e. resistive, capacitive andbridge sensors). Pioneering work was presented by
Cox,Richey, Baker and Bierl. The other class is focused on sensors with analog voltage
outputsand Peter et al. that these sensors couldbe interfaced without using the embedded SAR
ADC (SuccessiveApproximation Register) of a typical microcontroller. If only thecontroller has
an embedded comparator, a Sigma Delta can be implemented with only a few passive
components. Thishas later been confirmed and demonstrated by several, both inmicrocontrollers
and in FPGAs (with embedded or externalcomparators). The analog-to-digital conversion is a
multi-step process. This is controlled in firmware by polling the comparator’s output. If the
comparator’s output is high the I/O-pin is reset and if it is low the I/O-pin is set.It is slow
(limited bandwidth) and most of all, it only works for embedded systems with integrated
comparators, which indicates that it requires a relatively advanced (expensive) micro-controller
and excludes inherently digital systems such as CPLDs and FPGAs. The solution presented in
this work, uses only two I/O-pins but has the advantage of not requiring a comparator; the
technique can be implemented also in FPGAs.

Block Diagram
//in this i am using adc0808 for selecting adc channel & 8 bit
data pin for lcd data selection bit




#include <reg51.h>

#include "lcd.h"



sbit ADD_A = P2^0;

sbit ADD_B = P2^1;

sbit ADD_C = P2^2;

sbit clk= P2^3;    //for clock

sbit ALE = P2^4;   //adress latch enable

sbit OE = P2^5;           //output enable

sbit SC = P2^6; //start convertion

sbit EOC = P2^7; //end convertion
sfr input=0x80; //0x80 is the adress of port 0 of 8051,it act as a sensor o/p & microcontroller i/p




//function prototype

void channel_selection(unsigned char channel);

unsigned char read_adc(unsigned char channel_area);

void sensor_display(unsigned char var);




void timer0() interrupt 1 // Function to generate clock of frequency 500KHZ using Timer 0 interrupt.

{

clk=~clk;

}

void channel_selection(unsigned char channel)

{

        if(channel==0)

        {

                ADD_C=0; ADD_B=0;ADD_A=0;

        }

        else if(channel==1)

        {

                ADD_C=0; ADD_B=0;ADD_A=1;
}

else if(channel==2)

{

        ADD_C=0; ADD_B=1;ADD_A=0;

}

else if(channel==3)

{

        ADD_C=0; ADD_B=1;ADD_A=1;

}

else if(channel==4)

{

        ADD_C=1; ADD_B=0;ADD_A=0;

}

else if(channel==5)

{

        ADD_C=1; ADD_B=0;ADD_A=1;

}

else if(channel==6)

{

        ADD_C=1; ADD_B=1;ADD_A=0;

}

else

{

        ADD_C=1; ADD_B=1;ADD_A=1;

}
}



unsigned char read_adc(unsigned char channel_area)

    {

    unsigned char ch=0;

             channel_selection(channel_area);

             EOC=1; //end of convertion high

              OE=0; //output enable low

             ALE=0; //adress latch enable low

             delay(2);

             ALE = 1; //ALE high

             delay(2);

             SC=0;       //start convertion pin low

             delay(2);

             SC = 1; //start convertion pin high

             delay(2);

             ALE = 0; //adress latch enable low

             delay(2);

             SC = 0; //start convertion pin low

             while(EOC==1); //wait for EOC pin is high

        OE = 1;

        delay(2);

             ch=input;

        OE = 0;

             return (ch);
}

void sensor_display(unsigned char var)

{



               if(var<10)

               {

                       lcd_data(var+'0');

                       lcd_data(' ');

                       lcd_data(' ');

               }

               else if((var>=10)&& (var<100))

               {

                       lcd_data((var/10)+'0');

                       lcd_data((var%10)+'0');

                       lcd_data(' ');

                       lcd_data(' ');

               }

               else if(var>=100)

               {

                       lcd_data((var/100)+'0');

                       lcd_data(((var/10)%10)+'0');

                       lcd_data((var%10)+'0');

               }

}
void main()

{

unsigned int y,z;

lcd_init();

lcd_command(0x0c);

input=0xff;         //as port 0 bydefult low we have to made as high

TMOD=0x22; //timer0 setting for generating clock of 500KHz using interrupt enable mode.

TH0=0xFD;

IE=0x82;

TR0=1;

LCDGotoXY(0,0);

lcd_string("direct analog");

delay(200);

while(1)

{



              y=read_adc(7);       //huminity sensor

              z=read_adc(6); //tempareture sensor

              y=y*1.95;

              z=z*1.95;

    delay(25);

              LCDGotoXY(0,0);

              lcd_string("humd:    ");

              LCDGotoXY(5,0);

              sensor_display(y);
delay(25);

LCDGotoXY(8,0);

lcd_string("Temp:    ");

LCDGotoXY(13,0);

sensor_display(z);

delay(25);

              if( (y>=15)     )

      {

                      lcd_command(0x0c);         //dispaly on cursor off

                      LCDGotoXY(0,1);

                      lcd_string("hum->hig ");

                      delay(40);

              }

              else

              {

              lcd_command(0x0c);       //dispaly on cursor off

              LCDGotoXY(0,1);

              lcd_string("hum->nom");

              delay(40);

              }

              if( z>=40)

      {

                      lcd_command(0x0c);         //dispaly on cursor off

                      LCDGotoXY(9,1);

                      lcd_string(" T hig   ");
delay(40);

    }

    else

    {

    lcd_command(0x0c);        //dispaly on cursor off

    LCDGotoXY(9,1);

    lcd_string(" T noml ");

    delay(40);

    }

    lcd_command(0x02);

}

}

More Related Content

What's hot

Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical FileSoumya Behera
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesRicardo Castro
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECERamesh Naik Bhukya
 
Home automation system
Home automation system Home automation system
Home automation system Hira Shaukat
 
CODING IN ARDUINO
CODING IN ARDUINOCODING IN ARDUINO
CODING IN ARDUINOS Ayub
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manualSanthosh Poralu
 
94257825 bao-cao-pld
94257825 bao-cao-pld94257825 bao-cao-pld
94257825 bao-cao-pldbuianhminh
 
برمجة الأردوينو - اليوم الثاني
برمجة الأردوينو - اليوم الثانيبرمجة الأردوينو - اليوم الثاني
برمجة الأردوينو - اليوم الثانيAhmed Sakr
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IOT Academy
 
Embedded system design psoc lab report
Embedded system design psoc lab reportEmbedded system design psoc lab report
Embedded system design psoc lab reportRamesh Naik Bhukya
 
04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)antonio michua
 
8051-mazidi-solution
8051-mazidi-solution8051-mazidi-solution
8051-mazidi-solutionZunAib Ali
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuatorsEueung Mulyana
 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Eueung Mulyana
 
Etapes fab-venti-v2
Etapes fab-venti-v2Etapes fab-venti-v2
Etapes fab-venti-v2Jonah Marrs
 

What's hot (20)

Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECE
 
DHow2 - L6 VHDL
DHow2 - L6 VHDLDHow2 - L6 VHDL
DHow2 - L6 VHDL
 
Lampiran 1.programdocx
Lampiran 1.programdocxLampiran 1.programdocx
Lampiran 1.programdocx
 
Home automation system
Home automation system Home automation system
Home automation system
 
CODING IN ARDUINO
CODING IN ARDUINOCODING IN ARDUINO
CODING IN ARDUINO
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
94257825 bao-cao-pld
94257825 bao-cao-pld94257825 bao-cao-pld
94257825 bao-cao-pld
 
FINISHED_CODE
FINISHED_CODEFINISHED_CODE
FINISHED_CODE
 
برمجة الأردوينو - اليوم الثاني
برمجة الأردوينو - اليوم الثانيبرمجة الأردوينو - اليوم الثاني
برمجة الأردوينو - اليوم الثاني
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
 
Embedded system design psoc lab report
Embedded system design psoc lab reportEmbedded system design psoc lab report
Embedded system design psoc lab report
 
Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31
 
04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)
 
8051-mazidi-solution
8051-mazidi-solution8051-mazidi-solution
8051-mazidi-solution
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Etapes fab-venti-v2
Etapes fab-venti-v2Etapes fab-venti-v2
Etapes fab-venti-v2
 

Viewers also liked

28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...
28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...
28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...Organización política
 
CLUSTER AHORRO - Microgeneración con Autoconsumo Solar
CLUSTER AHORRO - Microgeneración con Autoconsumo SolarCLUSTER AHORRO - Microgeneración con Autoconsumo Solar
CLUSTER AHORRO - Microgeneración con Autoconsumo SolarJoan Trilla Melé
 
Dilequepormi score midi
Dilequepormi  score midiDilequepormi  score midi
Dilequepormi score midiPipe Zpata
 
창의적 발상 컬러배스
창의적 발상 컬러배스창의적 발상 컬러배스
창의적 발상 컬러배스youngeun21
 
Deborah Y. Strauss, D.V.M: Caring For Your Pets Through The Winter
Deborah Y. Strauss, D.V.M: Caring For Your Pets Through The WinterDeborah Y. Strauss, D.V.M: Caring For Your Pets Through The Winter
Deborah Y. Strauss, D.V.M: Caring For Your Pets Through The WinterDeborah Y. Strauss D.V.M
 
Coloquio cumplicidades bairro, apresentação Maria Manuela Mendes
Coloquio cumplicidades bairro, apresentação Maria Manuela MendesColoquio cumplicidades bairro, apresentação Maria Manuela Mendes
Coloquio cumplicidades bairro, apresentação Maria Manuela MendesCeact Ual
 
Coloquio cumplicidades bairro, apresentação Margarida tavares da Conceição
Coloquio cumplicidades bairro, apresentação Margarida tavares da ConceiçãoColoquio cumplicidades bairro, apresentação Margarida tavares da Conceição
Coloquio cumplicidades bairro, apresentação Margarida tavares da ConceiçãoCeact Ual
 
2013-03-21 What can provenance do for me?
2013-03-21 What can provenance do for me?2013-03-21 What can provenance do for me?
2013-03-21 What can provenance do for me?Stian Soiland-Reyes
 
Seminario anestesiología alva huaraj, rosa alejandra 1
Seminario anestesiología alva huaraj, rosa alejandra 1Seminario anestesiología alva huaraj, rosa alejandra 1
Seminario anestesiología alva huaraj, rosa alejandra 1Rosa Alva
 
The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013Mathias Strandberg
 
Manual de-precos-e-servicos-digitais-apadi
Manual de-precos-e-servicos-digitais-apadiManual de-precos-e-servicos-digitais-apadi
Manual de-precos-e-servicos-digitais-apadiNapoleão Furbino
 
La familia y su función socializadora subir
La familia y su función socializadora subirLa familia y su función socializadora subir
La familia y su función socializadora subirTaniada
 

Viewers also liked (20)

Last Minute Gift Ideas
Last Minute Gift IdeasLast Minute Gift Ideas
Last Minute Gift Ideas
 
Livelihood SriLanka
Livelihood SriLankaLivelihood SriLanka
Livelihood SriLanka
 
Great giraffe
Great giraffeGreat giraffe
Great giraffe
 
28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...
28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...
28 08 2014 - Firma del Convenio Veracruz-SEDESOL, Turismo-CDI en el marco de ...
 
Internet
InternetInternet
Internet
 
CLUSTER AHORRO - Microgeneración con Autoconsumo Solar
CLUSTER AHORRO - Microgeneración con Autoconsumo SolarCLUSTER AHORRO - Microgeneración con Autoconsumo Solar
CLUSTER AHORRO - Microgeneración con Autoconsumo Solar
 
Dilequepormi score midi
Dilequepormi  score midiDilequepormi  score midi
Dilequepormi score midi
 
Abradi cargos salarios_sud
Abradi cargos salarios_sudAbradi cargos salarios_sud
Abradi cargos salarios_sud
 
창의적 발상 컬러배스
창의적 발상 컬러배스창의적 발상 컬러배스
창의적 발상 컬러배스
 
Deborah Y. Strauss, D.V.M: Caring For Your Pets Through The Winter
Deborah Y. Strauss, D.V.M: Caring For Your Pets Through The WinterDeborah Y. Strauss, D.V.M: Caring For Your Pets Through The Winter
Deborah Y. Strauss, D.V.M: Caring For Your Pets Through The Winter
 
Coloquio cumplicidades bairro, apresentação Maria Manuela Mendes
Coloquio cumplicidades bairro, apresentação Maria Manuela MendesColoquio cumplicidades bairro, apresentação Maria Manuela Mendes
Coloquio cumplicidades bairro, apresentação Maria Manuela Mendes
 
Coloquio cumplicidades bairro, apresentação Margarida tavares da Conceição
Coloquio cumplicidades bairro, apresentação Margarida tavares da ConceiçãoColoquio cumplicidades bairro, apresentação Margarida tavares da Conceição
Coloquio cumplicidades bairro, apresentação Margarida tavares da Conceição
 
2013-03-21 What can provenance do for me?
2013-03-21 What can provenance do for me?2013-03-21 What can provenance do for me?
2013-03-21 What can provenance do for me?
 
Seminario anestesiología alva huaraj, rosa alejandra 1
Seminario anestesiología alva huaraj, rosa alejandra 1Seminario anestesiología alva huaraj, rosa alejandra 1
Seminario anestesiología alva huaraj, rosa alejandra 1
 
The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013
 
Manual de-precos-e-servicos-digitais-apadi
Manual de-precos-e-servicos-digitais-apadiManual de-precos-e-servicos-digitais-apadi
Manual de-precos-e-servicos-digitais-apadi
 
La familia y su función socializadora subir
La familia y su función socializadora subirLa familia y su función socializadora subir
La familia y su función socializadora subir
 
PATANJALI
PATANJALIPATANJALI
PATANJALI
 
JannaBrancato_Resume
JannaBrancato_ResumeJannaBrancato_Resume
JannaBrancato_Resume
 
Resume
ResumeResume
Resume
 

Similar to Direct analog

Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptsatish 486
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxSANTIAGO PABLO ALBERTO
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller Swapnil2515
 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for recordG Lemuel George
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768Omkar Rane
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Svet Ivantchev
 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorDaniel Roggen
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfforwardcom41
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prognikhil dixit
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Omkar Rane
 
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docxajoy21
 

Similar to Direct analog (20)

Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor ppt
 
Uart
UartUart
Uart
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
Codigo
CodigoCodigo
Codigo
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
 
Pwm wave
Pwm wave Pwm wave
Pwm wave
 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for record
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
 
Arduino: Arduino lcd
Arduino: Arduino lcdArduino: Arduino lcd
Arduino: Arduino lcd
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational Processor
 
Tdm to vo ip 2
Tdm to vo ip 2Tdm to vo ip 2
Tdm to vo ip 2
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prog
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
Em s7 plc
Em s7 plcEm s7 plc
Em s7 plc
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148
 
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
 

Recently uploaded

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

Direct analog

  • 1. Direct Analog-To-Microcontroller Interfacing This paper will demonstrate how signals from analog sensors can be directly interfaced to any digitalembedded system even though they may not be equipped with an on-chip ADC (Analog- to-Digital Converter),comparator or OP amp (Operational Amplifier). With only two resistors and one capacitor, we willpresent a solution that allows analog voltages to be measured directly using only a few digital I/O-pins.The digital target system requirements are minimized and limited to only two digital I/O-pins (with tristatecapability). No ADC, comparators, timers or capture modules are necessary. The extremely modesthardware requirements make it a suitable solution also for CPLDs/FPGAs (Complex Programmable Logicdevices/Field Programmable Gate Arrays). Since this solution will allow even the simplest embeddedsystem to be interfaced to analog voltage sensors, it has the potential of reducing design costs considerably.The proposed design is for DC or low-frequency signals and compared to other similar solution, thisdesign needs no embedded analog blocks at all. The techniques of interfacing analog sensors directly to digitalembedded systems without the use of embedded ADCs or complexsignal conditioning electronics was developed in the mid- 1990s.These techniques may be divided into two categories. One class ofinterfaces focused on passive sensors (i.e. resistive, capacitive andbridge sensors). Pioneering work was presented by Cox,Richey, Baker and Bierl. The other class is focused on sensors with analog voltage outputsand Peter et al. that these sensors couldbe interfaced without using the embedded SAR ADC (SuccessiveApproximation Register) of a typical microcontroller. If only thecontroller has an embedded comparator, a Sigma Delta can be implemented with only a few passive components. Thishas later been confirmed and demonstrated by several, both inmicrocontrollers and in FPGAs (with embedded or externalcomparators). The analog-to-digital conversion is a multi-step process. This is controlled in firmware by polling the comparator’s output. If the comparator’s output is high the I/O-pin is reset and if it is low the I/O-pin is set.It is slow (limited bandwidth) and most of all, it only works for embedded systems with integrated comparators, which indicates that it requires a relatively advanced (expensive) micro-controller and excludes inherently digital systems such as CPLDs and FPGAs. The solution presented in this work, uses only two I/O-pins but has the advantage of not requiring a comparator; the technique can be implemented also in FPGAs. Block Diagram
  • 2. //in this i am using adc0808 for selecting adc channel & 8 bit data pin for lcd data selection bit #include <reg51.h> #include "lcd.h" sbit ADD_A = P2^0; sbit ADD_B = P2^1; sbit ADD_C = P2^2; sbit clk= P2^3; //for clock sbit ALE = P2^4; //adress latch enable sbit OE = P2^5; //output enable sbit SC = P2^6; //start convertion sbit EOC = P2^7; //end convertion
  • 3. sfr input=0x80; //0x80 is the adress of port 0 of 8051,it act as a sensor o/p & microcontroller i/p //function prototype void channel_selection(unsigned char channel); unsigned char read_adc(unsigned char channel_area); void sensor_display(unsigned char var); void timer0() interrupt 1 // Function to generate clock of frequency 500KHZ using Timer 0 interrupt. { clk=~clk; } void channel_selection(unsigned char channel) { if(channel==0) { ADD_C=0; ADD_B=0;ADD_A=0; } else if(channel==1) { ADD_C=0; ADD_B=0;ADD_A=1;
  • 4. } else if(channel==2) { ADD_C=0; ADD_B=1;ADD_A=0; } else if(channel==3) { ADD_C=0; ADD_B=1;ADD_A=1; } else if(channel==4) { ADD_C=1; ADD_B=0;ADD_A=0; } else if(channel==5) { ADD_C=1; ADD_B=0;ADD_A=1; } else if(channel==6) { ADD_C=1; ADD_B=1;ADD_A=0; } else { ADD_C=1; ADD_B=1;ADD_A=1; }
  • 5. } unsigned char read_adc(unsigned char channel_area) { unsigned char ch=0; channel_selection(channel_area); EOC=1; //end of convertion high OE=0; //output enable low ALE=0; //adress latch enable low delay(2); ALE = 1; //ALE high delay(2); SC=0; //start convertion pin low delay(2); SC = 1; //start convertion pin high delay(2); ALE = 0; //adress latch enable low delay(2); SC = 0; //start convertion pin low while(EOC==1); //wait for EOC pin is high OE = 1; delay(2); ch=input; OE = 0; return (ch);
  • 6. } void sensor_display(unsigned char var) { if(var<10) { lcd_data(var+'0'); lcd_data(' '); lcd_data(' '); } else if((var>=10)&& (var<100)) { lcd_data((var/10)+'0'); lcd_data((var%10)+'0'); lcd_data(' '); lcd_data(' '); } else if(var>=100) { lcd_data((var/100)+'0'); lcd_data(((var/10)%10)+'0'); lcd_data((var%10)+'0'); } }
  • 7. void main() { unsigned int y,z; lcd_init(); lcd_command(0x0c); input=0xff; //as port 0 bydefult low we have to made as high TMOD=0x22; //timer0 setting for generating clock of 500KHz using interrupt enable mode. TH0=0xFD; IE=0x82; TR0=1; LCDGotoXY(0,0); lcd_string("direct analog"); delay(200); while(1) { y=read_adc(7); //huminity sensor z=read_adc(6); //tempareture sensor y=y*1.95; z=z*1.95; delay(25); LCDGotoXY(0,0); lcd_string("humd: "); LCDGotoXY(5,0); sensor_display(y);
  • 8. delay(25); LCDGotoXY(8,0); lcd_string("Temp: "); LCDGotoXY(13,0); sensor_display(z); delay(25); if( (y>=15) ) { lcd_command(0x0c); //dispaly on cursor off LCDGotoXY(0,1); lcd_string("hum->hig "); delay(40); } else { lcd_command(0x0c); //dispaly on cursor off LCDGotoXY(0,1); lcd_string("hum->nom"); delay(40); } if( z>=40) { lcd_command(0x0c); //dispaly on cursor off LCDGotoXY(9,1); lcd_string(" T hig ");
  • 9. delay(40); } else { lcd_command(0x0c); //dispaly on cursor off LCDGotoXY(9,1); lcd_string(" T noml "); delay(40); } lcd_command(0x02); } }