適用:Arduino STM 51開發板
感測器使用在清潔空氣中電導率較低的二氧化錫(SnO2)。
當環境中存在酒精氣體,感測器的電導率隨濃度的增加而增大
應用:酒精檢測,
如機動車駕駛人員及其他嚴禁酒後作業人員的現場檢測,
工地場所公安 乙醇蒸汽氣體的檢測
規格:
1.主要芯片:LM393 、ZYMQ-3 氣體傳感器
2.電源指示和TTL信號輸出指示
(當輸出低電平時信號燈亮,可直接接單片機或繼電器模組)
3.類比量輸出電壓,濃度越高電壓越高。
4.輸入電壓:DC5V 功耗(電流):150mA
5.輸出信號
DO輸出:TTL數字量0和1(0.1和3.3V)TTL輸出有效信號為低電平
AO輸出:0.1-0.3V(相對無污染),最高濃度電壓4V左右
6.有四個螺絲孔便於安裝
7.產品外形尺寸:35.5(L)*22.5(W)*23(H)
提醒:感測器通電後,需要預熱20S左右,測量的資料才穩定
感測器發熱屬於正常現象,因為內部有電熱絲但燙手就不正常
接線方式:
1、VCC:接電源正極(5V)
2、GND:接電源負極
3、DO:TTL開關信號輸出
4、AO:類比信號輸出
產地:中國
出貨清單: MQ3感測模組一片 塑膠袋包裝
參考程式:
/* MQ-3 Alcohol Sensor Circuit with Arduino */
const int AOUTpin=A0;
//the AOUT pin of the alcohol sensor goes into analog pin A0 of the arduino
const int ledPin=13;
//the anode of the LED connects to digital pin D13 of the arduino
int i,alco_high,alco_low,mapped,data[200];
void setup() {
Serial.begin(115200);//sets the baud rate
pinMode(AOUTpin, INPUT);
//sets the pin as an input to the arduino
for(i=2;i<=5;i++)
{
pinMode(i,OUTPUT);
//sets the pin as an output of the arduino
}
}
void loop()
{
alco_high=0; // initially alcohol level is zero
alco_low = 1023; // low threshold is 1023
for(i=200; i>0; i--){
data[i] = data[i-1]; // decrement of data
if(data[i]>alco_high)
alco_high=data[i];
if(data[i]
alco_low=data[i];
}
data[0]= analogRead(AOUTpin);//reads the analaog value from the alcohol sensor's AOUT pin
mapped=map(data[0],0,1023,0,600);
Serial.print("Alcohol value: ");
Serial.println(mapped);//prints the alcohol value
delay(100);
if((alco_high-alco_low)>150){
if(data[0] > (alco_high-.95*(alco_high-alco_low)))//this is true if the read is greater than 95% of the span
digitalWrite(2, HIGH);
else
digitalWrite(2,LOW);
if(data[0] > (alco_high-.9*(alco_high-alco_low)))
digitalWrite(3, HIGH);
else
digitalWrite(3,LOW);
if(data[0] > (alco_high-.8*(alco_high-alco_low)))
digitalWrite(4, HIGH);
else
digitalWrite(4,LOW);
if(data[0] > (alco_high-.7*(alco_high-alco_low)))
digitalWrite(5, HIGH);
else
digitalWrite(5,LOW);
}
else
{
for(i=2;i<=5;i++)
digitalWrite(i,0);
}}