PM2.5_laser_dust_sensor_SKU_SEN0177-DFRobot

文章推薦指數: 80 %
投票人數:10人

wiki:This is a PM2.5 and PM10 air quality sensor for Arduino. It uses laser to detect air particle within 0.3 to 10 microns. HOME COMMUNITY FORUM BLOG EDUCATION HOME FORUM BLOG Introduction PM2.5laserdustsensorisadigitaluniversalparticleconcentrationsensor,itcanbeusedtoobtainthenumberofsuspendedparticulatematterinaunitvolumeofairwithin0.3to10microns,namelytheconcentrationofparticulatematter,andoutputwithdigitalinterface,alsocanoutputqualitydataofperparticle.TheAirQualitysensorscanbeembeddedinavarietyofconcentrationsofenvironment-relatedinstrumentssuspendedparticulatematterintheair,toprovidetimelyandaccurateconcentrationdata. Howitworks? Thispm2.5sensorusesalaserscatteringtheory.Andnamelythescatteringoflaserirradiationintheairsuspendedparticles,whilecollectingthescatteredlightataspecificangle,toobtainthescatteringintensityversuswithtimecurve.Afterthemicroprocessordatacollection,gettherelationshipbetweenthetimedomainandfrequencydomainbyFouriertransform,andthenthroughaseriesofcomplexalgorithmstoobtainthenumberofparticlesintheequivalentparticlesizeandvolumeunitsofdifferentsize.Eachfunctionalblockdiagramofthesensorportionasshown: Specification Operatingvoltage:4.95~5.05V Maximumelectriccurrent:120mA Measuringpmdiameter:0.3-1.0,1.0-2.5,2.5-10(um) Measuringpmrange:0~999ug/m3 Standbycurrent:≤200uA Responsetime:≤10s Operatingtemperaturerange:-20~50C Operatinghumidityrange:0~99%RH Maximumsize:65×42×23(mm) MTBF:>=5years Quickresponse Standardserialinputwordoutput Second-ordermulti-pointcalibrationcurve Theminimumsizeof0.3micronresolution Powersupplyqualityrequirements: Voltageripple:lessthan100mV. Thepowersupplyvoltagestability:4.95~5.05V. Powersupply:morethan1W(5V@200mA). Theupperandlowerelectricvoltagesurgeislessthan50%ofthesystempowersupplyvoltage. Connection SensorPin ArduinoPin FunctionDescription Pin1 VCC PositivePower Pin2 GND NegativePower Pin3 SET Modesetting(Morehereoflater) Pin4 RXD receiveserialportpin(3.3Vlevel) Pin5 TXD Transferringserialportpin(3.3Vlevel) Pin6 RESET Reset Pin7/8 NC NUll *SET:* SET=1,themoduleworksincontinuoussamplingmode,itwilluploadthesampledataaftertheendofeachsampling.(Thesamplingresponsetimeis1S) SET=0,themoduleentersalow-powerstandbymode. RESET:leaveitemptyisOK. Tutorial ConnectionDiagram IfyouhaveanIOexpansionshield,youcansimplyinsertthePM2.5sensoradapterontoit,andyoucanusetheserialtomonitorthedata. IfyouhavenoIOexpansionshield,youcanfollowthewiringdiagramtodowiring. SampleCode NOTE:ThiscodecanonlybeverifiedinArduinoIDE1.6.xorabove. //****************************** //*Abstract:ReadvalueofPM1,PM2.5andPM10ofairquality // //*Version:V3.1 //*Author:Zuyang@HUST //*ModifiedbyCainforArduinoHardwareSerialportcompatibility //*Date:March.25.2016 //****************************** #include #defineLENG31//0x42+31bytesequalto32bytes unsignedcharbuf[LENG]; intPM01Value=0;//definePM1.0valueoftheairdetectormodule intPM2_5Value=0;//definePM2.5valueoftheairdetectormodule intPM10Value=0;//definePM10valueoftheairdetectormodule voidsetup() { Serial.begin(9600);//useserial0 Serial.setTimeout(1500);//settheTimeoutto1500ms,longerthanthedatatransmissionperiodictimeofthesensor } voidloop() { if(Serial.find(0x42)){//starttoreadwhendetect0x42 Serial.readBytes(buf,LENG); if(buf[0]==0x4d){ if(checkValue(buf,LENG)){ PM01Value=transmitPM01(buf);//countPM1.0valueoftheairdetectormodule PM2_5Value=transmitPM2_5(buf);//countPM2.5valueoftheairdetectormodule PM10Value=transmitPM10(buf);//countPM10valueoftheairdetectormodule } } } staticunsignedlongOledTimer=millis(); if(millis()-OledTimer>=1000) { OledTimer=millis(); Serial.print("PM1.0:"); Serial.print(PM01Value); Serial.println("ug/m3"); Serial.print("PM2.5:"); Serial.print(PM2_5Value); Serial.println("ug/m3"); Serial.print("PM10:"); Serial.print(PM10Value); Serial.println("ug/m3"); Serial.println(); } } charcheckValue(unsignedchar*thebuf,charleng) { charreceiveflag=0; intreceiveSum=0; for(inti=0;i #include #defineLENG31//0x42+31bytesequalto32bytes unsignedcharbuf[LENG]; intPM01Value=0;//definePM1.0valueoftheairdetectormodule intPM2_5Value=0;//definePM2.5valueoftheairdetectormodule intPM10Value=0;//definePM10valueoftheairdetectormodule SoftwareSerialPMSerial(10,11);//RX,TX voidsetup() { PMSerial.begin(9600); PMSerial.setTimeout(1500); Serial.begin(9600); } voidloop() { if(PMSerial.find(0x42)){ PMSerial.readBytes(buf,LENG); if(buf[0]==0x4d){ if(checkValue(buf,LENG)){ PM01Value=transmitPM01(buf);//countPM1.0valueoftheairdetectormodule PM2_5Value=transmitPM2_5(buf);//countPM2.5valueoftheairdetectormodule PM10Value=transmitPM10(buf);//countPM10valueoftheairdetectormodule } } } staticunsignedlongOledTimer=millis(); if(millis()-OledTimer>=1000) { OledTimer=millis(); Serial.print("PM1.0:"); Serial.print(PM01Value); Serial.println("ug/m3"); Serial.print("PM2.5:"); Serial.print(PM2_5Value); Serial.println("ug/m3"); Serial.print("PM10:"); Serial.print(PM10Value); Serial.println("ug/m3"); Serial.println(); } } charcheckValue(unsignedchar*thebuf,charleng) { charreceiveflag=0; intreceiveSum=0; for(inti=0;i



請為這篇文章評分?