Escolar Documentos
Profissional Documentos
Cultura Documentos
DEEPAK GUPTA
EM TESTED
EM TESTED
J1
10
11
12
13
14
15
16
J2
1
2
3
4
5
6
7
8
9
VCC
A
VCC ADC0804 H H
R4 B A
10K
R5
R2 U1 8051 CON6A
VCC U2
1 2 39 21 18 6 10K
3 38 P0.0/AD0 P2.0/A8 22 17
DB0 +IN 7
4 37 P0.1/AD1 P2.1/A9 23 16
DB1 -IN VCC
P0.2/AD2 P2.2/A10 DB2 9
5 36 24 15
6 35
P0.3/AD3 P2.3/A11
25 14
DB3 VREF/2
P0.4/AD4 P2.4/A12 DB4 R3
7 34 26 13 4 C1 150pf
8 33
P0.5/AD5 P2.5/A13
27 12
DB5 CLKIN 19 10K
P0.6/AD6 P2.6/A14 DB6 CLKR
9 32 28 11
P0.7/AD7 P2.7/A15 DB7
2
1 10 5
RD 3
RESISTOR SIP9 P1.0 P3.0/RXD INTR W/R
2 11 1
22pf
AGND
P1.1 P3.1/TXD CS
3 12
GND
P1.2 P3.2/INTO
4 13 20 VCC
P1.3 P3.3/INT1 VCC/VREF
5 14
P1.4 P3.4/T0
6 15
P1.5 P3.5/T1
Y1 7 16
10
8
P1.6 P3.6/WR
8 17
22pf P1.7 P3.7/RD
CRYSTAL
19 30
X1 ALE
18 29
X2 PSEN
vcc
31
EA
9
RST
GND
10uf
40
VCC
20
8.2k
interruptor hardware reset. when Vin is Vref, the output is 11111111 (255
ADC0804 decimal).
The output of the pressure transducer is an analog For input voltages between 0 and Vref, the output
signal .To interface with the microcontroller it is increases linearly with Vin; therefore, we can
needed to change this signal in to digital value develop a simple ratio for the ADC:
because the microcontroller and other digital Solving for output gives the following:
devices works on the digital data . For this purpose where
ADC is used. We used an IC(ADC0804) which output = decimal output value of an 8-bit ADC
gave an 8 bit digital value for the input analog Vin = analog input voltage to the ADC
valued signal. ADC0804 is used to convert analog Vref = ADC reference voltage
voltage produced from differential pressure To start the conversion process, a start-conversion
transducer to digital signal. The analog voltages pulse is sent to the ADC. The ADC then samples the
from 0 to 5v are converted using adc-0804 to analog input and converts it to binary. When
digital number from 0 to 255. completed, the ADC activates the data-ready
Analog signals are very common inputs to output. This signal can be used to alert the
embedded systems – Most transducers and sensors computer to read in the binary data.
are analog. Special devices needed to interface the Figure shows an 8-bit ADC (ADC0804).
analog systems to digital systems. ADC (Analog to Packaged as a 20-pin DIP, this device can operate
Digital Converter) is used between signal input and on a single 5-Vdc power supply and requires an
the embedded system. DAC (Digital to Analog external resistor and capacitor to complete the
Converter) between embedded system and analog ADC circuit. The start-conversion pulse is applied
to pin 3 (WR), and the data-ready signal comes
from pin 5 (INTR). This particular ADC can be
output 255 connected in a free-running mode where it
= (for 8 bits)
Vin Vref performs one conversion after the other as fast as it
can. Notice also that the pin labeled Vref/2 (pin 9)
Solving for output gives the following must be set at half of the actual Vref. For example, if
the requirements call for an analog voltage range
Vin X 255 of 0-5 Vdc, then pin 9 would be set to 2.5 Vdc. The
Output = Vref time to complete a conversion is approximately
100 µs (micro-seconds), making it almost 700
times slower than the DAC0808
signal output.An analog-to-digital converter (ADC) MQ303A Alcohol Sensor
is a circuit that converts an analog voltage into a MQ303A is semiconductor sensor is for Alcohol
digital word. A typical ADC consists of a single IC detection,It has good sensitivity and fast response
with a few support components.Analog-to-digital
conversion is a more complicated process (than for Model No. MQ303A
the DAC), and the hardware requires some Sensor Type Semiconductor
conversion time, which is typically in the Standard Encapsulation Metal
microsecond range. The conversion time required Detection Gas Alcohol
depends on the type of ADC, the applied clock Concentration 20-1000ppm Alcohol
frequency, and the number of bits being converted. Heater Voltage V H 0.9V ± 0.1V AC or DC
≤6V DC
The input Vin can be any voltage between 0 V and Loop Voltage Vc
Load, ResistanceR L Adjustable
Vref. When Vin is 0 Vdc, the output is 00000000;
Heater, Resistance R H 4.5Ω ± 0.5 Ω(Room Tem.)
Heater Current IH 120±20mA
Vref
Heater Power PH ≤ 140 mW
Sensor, Consumption, PS ≤10 mW
Start conversion Data ready
Sensing, Resistance, Rs 4KΩ-400KΩ(in air)
Clock
Sensitivity S Rs(in air)/Rs(125ppmAlcohol)≥3
ADC Digital
Vin (analog voltage input) Slope α 0.50 ± 0.15(R300ppm/R100ppm Alcohol)
output
Tem. Humidity 20℃±2℃;65%±5%RH
Standard test circuit Vc:3.0 V±0.1 V DC ;VH: 0.9 V±0.1 V DC
Preheat time Over 48 hours
CONSTRUCTION
ret
delay:
mov r1,#255
l2: mov r0,#255
l1: djnz r0,l1
djnz r1,l2
ret
command:
clr p1.2
mov p0,r1
setb p1.0
call delay
clr p1.0
ret
data2:
setb p1.2
to alcohol,suitable for portable alcohol detector. mov p0,r4
setb p1.0
Features call delay
* High sensitivity clr p1.0
* Fast response and resume ret
* Long life and low cost data1:
* Mini Size setb p1.2
mov p0,r3
Code setb p1.0
org 0X00 call delay
mov r1,#38H clr p1.0
call command ret
mov r1,#0EH epr:
call command setb p1.2
mov r1,#06H mov p0,r2
call command setb p1.0
mov r1,#01H call delay
call command clr p1.0
start: ret
clr p3.5 conversion:
nop mov b,#10
setb p3.5 div ab
wait:jb p3.2,wait mov r2,b
acall read mov b,#10
acall conversion div ab
call data2 orl a,#30h
call data1 mov r4,a
call epr mov a,b
call delay mov r1,#01H orl a,#30h
call command mov r3,a
call delay mov a,r2
jmp start orl a,#30h
read: mov r2,a
clr p3.4 ret
mov a,p2 end
mov 30h,a
setb p3.4