준호씨의 블로그

아두이노 - 먼지센서 간단 제작 정리 본문

메이커

아두이노 - 먼지센서 간단 제작 정리

준호씨 2017. 5. 16. 08:22
반응형

인터넷 예제 보고 대충 만들어 본 건데 측정 값이 제대로 나오는 건지, 센서의 스팩이 어떤지는 아직 꼼꼼히 따져보지는 않았음

인터넷 예제를 참고 했고 보드는 Arduino Leonardo 사용

조립

측정값

소스코드

int ledPower = 12;
int measurePin = A0;
int samplingTime = 280;
int deltaTime = 40;
int sleepTime = 9680;
float voMeasured = 0;
float calcVoltage = 0;
float dustDensity = 0;
void setup() {
Serial.begin(9600);
pinMode(ledPower,OUTPUT);
pinMode(4, OUTPUT);
}
void loop() {
digitalWrite(ledPower, LOW); // power on the LED
delayMicroseconds(samplingTime);
voMeasured = analogRead(measurePin); // read the dust value
delayMicroseconds(deltaTime);
digitalWrite(ledPower, HIGH); // turn the LED off
delayMicroseconds(sleepTime);
calcVoltage = voMeasured * (3.3/1024);
dustDensity = (0.17 * calcVoltage - 0.1) * 1000;
Serial.print("Raw Signal Value (0-1023): ");
Serial.print(voMeasured);
Serial.print(" - Voltage: ");
Serial.print(calcVoltage);
Serial.print(" - Dust density [ug/m3]: ");
Serial.println(dustDensity);
delay(1000);
}
view raw dust.ino hosted with ❤ by GitHub


사용부품

아두이노 레오나르도

먼지센서 SHARP GP2Y1010AU0F
https://www.sparkfun.com/datasheets/Sensors/gp2y1010au_e.pdf

저항
R=150Ω
띠 5개
갈초검검갈
1 5 0 x1 +-1%

* 첫째자리 1
* 둘째자리 5
* 셋째자리 0
* 배수 x1
* 오차 +-1%


저항의 몸통 색
갈색 허용 전력 1/4 (0.25) 와트
파란색 허용 전력 1/6와트


C=220μ


참고

만원으로 미세먼지 측정기 자작하기. 2016.04.04
http://ilikesan.com/563

Standalone: Sharp Dust Sensor
http://arduinodev.woofex.net/2012/12/01/standalone-sharp-dust-sensor/
https://github.com/Trefex/arduino-airquality/blob/master/Module_Dust-Sensor/dustSensor/dustSensor.ino

관련글

아두이노 - 먼지 센서 + LCD


반응형
Comments