Arduino dust and smoke sensor PM2.5 experiment

Arduino dust and smoke sensor PM2.5 experiment

hardware preparation

GP2Y1014AU dust sensor module
insert image description here
150 ohm resistor
220uf capacitor

Technical Parameters
GP2Y1014AU Dust Sensor Module
• Power supply voltage: DC5±2V
• Working current: 20mA (peak value)
• Sensitivity: 0.5V/(0.1mg/m3)
• Minimum particle detection value: 0.8 microns
• Voltage in clean air: 0.9V Typical value
• Operating temperature: -10~65℃
• Storage temperature: -20~80℃
• Service life: 5 years
• Dimensions: 46mm×30mm×17.6mm
• Weight: 15g

Voltage range: VoH(V) — Output voltage when clean: Voc(V).
Convert this into dust concentration:
detection range of dust concentration (mg/m3) = possible detection range (variable output voltage range (V)) ÷ detection sensitivity: K(V/(0.1 mg/m3).
Smoke detection In the case of detection, the judgment value is as follows:
Judgment value = detected concentration (mg/m3) ÷ 10 ×K(V/(0.1 mg/m3) + output voltage (V) when clean

Detected concentration: 0.2 (mg/m3) When judging K: TYP 0.5 (V/(0.1 mg/m3)
When dust-free Output voltage: 0.9 (V) Judgment value = (0.2×10)×0.5+ 0.9 = 1.9V

wiring

I wired the color as shown above

PM2.5 Arduino
Blue - connected to the positive pole of the capacitor 5V
Green - connect to the negative pole of the capacitor GND
White 11
yellow GND
black A5
red 5V
Capacitor positive 5V
Capacitor negative GND

( resistor is connected in series with the positive pole of the capacitor )

Pin wiring: When the wiring port is on the left (from left to right)
Blue line: V-LED-Arduino 5V and 150 ohm resistor connect to the positive pole of the 220uf capacitor
Green line: LED-GND-Arduino GND connects to the negative pole of the 220uf capacitor
White line: LED -Arduino Digital Pin to ledPower can be customized to connect to 11
Yellow wire: S-GND Arduino GND to 220uf capacitor negative
black wire: Vo-Arduino Analog A5
Red wire: Vcc-Arduino 5V and 150 ohm resistor to 220uf capacitor positive

You can refer to the figure below ( from )
insert image description here

code section

int measurePin = A5;            
int ledPower = 11;              
 
unsigned int samplingTime = 280;
unsigned int deltaTime = 40;
unsigned int sleepTime = 9680;
 
float voMeasured = 0;
float calcVoltage = 0;
float dustDensity = 0;
 
void setup(){
    
    
  Serial.begin(9600);
  pinMode(ledPower,OUTPUT);
}
 
void loop(){
    
    
  digitalWrite(ledPower,LOW);
  delayMicroseconds(samplingTime);
 
  voMeasured = analogRead(measurePin);
 
  delayMicroseconds(deltaTime);
  digitalWrite(ledPower,HIGH);
  delayMicroseconds(sleepTime);
 
  calcVoltage = voMeasured*(5.0/1024);
  dustDensity = 0.17*calcVoltage-0.1;
 
  if ( dustDensity < 0)
  {
    
    
    dustDensity = 0.00;
  }
 
  Serial.print("空气质量数值:");
  Serial.println(voMeasured);
  
 /*
  Serial.print("当前实时电压电压:");
  Serial.println(calcVoltage); */
 
  Serial.print("P.M2.5浓度:");
  Serial.print(dustDensity);
  Serial.println("%");
 
  delay(1000);
}

Show results

Air index standard

air quality control

air index air quality
3000+ very poor
1050-3000 poor
300-1050 generally
150-300 better
75-150 very good
0-75 very good

With smoke Under
insert image description here
normal conditions without smoke
insert image description here

Guess you like

Origin blog.csdn.net/weixin_50679163/article/details/119841470