한글보드: PM2.5 미세 먼지센서 어댑터 포함 / GP2Y10

메카 2018-04-18 (수) 12:59 5년전 10988  

한글보드: 미세 먼지센서 (어댑터 포함) (Introduction)

미세먼지 센서와 미세먼지를 사용하기 위해 필요한 어댑터 모듈 및 케이블이 포함되어있는 세트 상품입니다.
PM2.5 미만의 초 미세먼지를 검출할 수 있는 광학식 공기 품질 센서이며, 적외선 방출 다이오드와 포토 트랜
지스터가 대각선으로 배치되어있어 공기중의 먼지를 감지하는 원리입니다. 공기 청정기, 미세먼지 측정기 등의
어플리케이션에 사용할 수 있으며, 보다 원활한 측정을 위해서는 팬모터 등을 이용하여 공기를 순환시켜줘야
합니다.

 

 

e4b6dcc5f40ccf4c4afa85b8b10f20fc_1524023 

 

사양 (Specification)

  • GP2Y10 기반 광학식 먼지센서

  • PM2.5 미만 초 미세먼지 검출

  • 어댑터 모듈 및 케이블 포함

  • 모듈을 통해 납땜 없이 사용 가능

  • 작동 전압: 5V ~ 7V

  • 작동 전류:최대 20mA

  • 측정 범위: 0~250ug/m3

  • 출력 유형: 아날로그 전압

  • 센싱 감도: 0.5V (100ug/m3)

  • 작동 온도: -10~65℃

  • 보관 온도: -20~80℃

  • 센서 크기: 46 x 34 x 17.7mm

  • 모듈 크기: 30 x 32.6mm

  • 총 무게: 약 23g





튜토리얼 (Tutorial -1/-2)

e4b6dcc5f40ccf4c4afa85b8b10f20fc_1524023
 

 

 

 

샘플 코드 (Sample Code - 1)

/*

 Standalone Sketch to use with a Arduino UNO and a

 Sharp Optical Dust Sensor GP2Y1010AU0F

*/

  

int measurePin = 0; //Connect dust sensor to Arduino A0 pin

int ledPower = 2;   //Connect 3 led driver pins of dust sensor to Arduino D2

  

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);

}

  

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);

  

  // 0 - 5V mapped to 0 - 1023 integer values

  // recover voltage

  calcVoltage = voMeasured * (5.0 / 1024.0);

  

  // linear eqaution taken from http://www.howmuchsnow.com/arduino/airquality/

  // Chris Nafis (c) 2012

  dustDensity = 0.17 * calcVoltage - 0.1;

  

  Serial.print("Raw Signal Value (0-1023): ");

  Serial.print(voMeasured);

  

  Serial.print(" - Voltage: ");

  Serial.print(calcVoltage);

  

  Serial.print(" - Dust Density: ");

  Serial.println(dustDensity); // unit: mg/m3

  

  delay(1000);

}

 

 

  

샘플 코드 (Sample Code - 2) / 평균 값 산출

 

/*

  Standalone Sketch to use with a Arduino UNO and a

  Sharp Optical Dust Sensor GP2Y1010AU0F

*/


int measurePin = 0; //Connect dust sensor to Arduino A0 pin

int ledPower = 2;   //Connect 3 led driver pins of dust sensor to Arduino D2


int samplingTime = 280;

int deltaTime = 40;

int sleepTime = 9680;


float voMeasured = 0;

float calcVoltage = 0;

float dustDensity = 0;


#define NUMREADINGS 10 // 평균내는 개수 수정

int readings[NUMREADINGS] = {0,};

int index = 0;

int total = 0;

int val = 0;


void setup() {

  Serial.begin(9600);

  pinMode(ledPower, 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);


  // 0 - 5V mapped to 0 - 1023 integer values

  // recover voltage

  calcVoltage = voMeasured * (5.0 / 1024.0);


  // linear eqaution taken from http://www.howmuchsnow.com/arduino/airquality/

  // Chris Nafis (c) 2012

  dustDensity = 0.17 * calcVoltage - 0.1;


  Serial.print("Raw Signal Value (0-1023): ");

  Serial.print(voMeasured);


  Serial.print(" - Voltage: ");

  Serial.print(calcVoltage);


  Serial.print(" - Dust Density: ");

  //Serial.println(dustDensity); // unit: mg/m3

  //Serial.println(dustDensity * 1000); // ug/m3


  total -= readings[index];

  readings[index] = dustDensity * 1000;

  total += readings[index];

  index++;


  if (index >= NUMREADINGS) {

    index = 0;

  }

  val = total / NUMREADINGS;

  Serial.println(val);

  delay(1000);

 

}



튜토리얼 (Tutorial -3)

e4b6dcc5f40ccf4c4afa85b8b10f20fc_1524023


샘플 코드 (Sample Code - 3)

 

//1602 LCD 세팅

#include <LiquidCrystal.h>               // LCD 라이브러리 포함

LiquidCrystal lcd(13, 12, 5, 4, 3, 2);   // LCD 핀 설정

 

//DHT11 온습도센서 세팅

#include "DHT.h"                // DHT11 라이브러리 포함

#define DHTPIN 7                // DHT11 연결핀

#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

 

//먼지센서 세팅

int LED = 11;

int DUST = 0;

int samplingTime = 280;

int deltaTime = 40;

int sleepTime = 9680;

float dustval = 0;

float voltage = 0;

float dustug = 0;

float dus = 0;

float a = 0;

 

void setup() {

  Serial.begin(9600);        // 시리얼 통신 시작

  lcd.begin(16, 2);           // 16x2 LCD 선언

  pinMode(LED, OUTPUT);  // 먼지센서 LED 핀 설정

}

void loop() {

  //먼지센서 코드

  digitalWrite(LED, LOW); // 적외선 LED ON

  delayMicroseconds(samplingTime);

  dustval = analogRead(DUST); //먼지센서 값 읽기

  delayMicroseconds(deltaTime);

  digitalWrite(LED, HIGH); // 적외선 LED OFF

  delayMicroseconds(sleepTime);

  voltage = dustval * (5.0 / 1024.0);  // 전압 구하기

  dustug = 0.17 * voltage - 0.1;      // ug 단위 변환

  dus = dustug * 1000;

  Serial.print("Dust Sensor Voltage: ");

  Serial.print(voltage);

  Serial.println("V");

  Serial.print("Dust Value: ");

  Serial.print(dus); // unit: mg/m3

  Serial.println("ug");

 

  //dht11 온습도센서 코드

  int h = dht.readHumidity();     // 습도 값 구하기

  int t = dht.readTemperature();  // 온도 값 구하기

  Serial.print("Humidity: ");

  Serial.print(h);

  Serial.println(" %\t");

  Serial.print("Temperature: ");

  Serial.print(t);

  Serial.println(" C");

 

  //1602 LCD 모듈 코드

  lcd.clear();

  analogWrite(6, 120);

  lcd.setCursor(0, 0);

  lcd.print("H: ");

  lcd.print(h);

  lcd.print(" %  ");

  lcd.print("T: ");

  lcd.print(t);

  lcd.print(" C");

  lcd.setCursor(0, 1);

  lcd.print("Dust: ");

  if (dus > 0) {

    a = dus;

    lcd.print(a);

  }

  else {

    lcd.print(a);

  }

  lcd.print("ug");

 

 

  //RGB LED 모듈 코드

  if (a < 35) {                 // 좋음

    analogWrite(9, 0);

    analogWrite(10, 20);

  }

  if (a > 35 & a < 75) {    // 나쁨

    analogWrite(9, 30);

    analogWrite(10, 3);

  }

  if (a > 75) {                // 매우나쁨

    analogWrite(9, 20);

    analogWrite(10, 0);

  }

  delay(1000);

}

 

 


 

 

 

판매처 - 메카솔루션 (http://mechasolution.com)  /   디스트리뷰터 문의 -

메카리워즈 Image Map

만두 2019-04-14 (일) 23:38 4년전
미세먼지 어댑터 프리징 파일 공유 가능할까요~~^^?
주소

모바일 버전으로 보기