'Sharp'에 해당되는 글 1건

  1. 2017.03.31 Hardware | Sharp GP2Y1010AU0F dust sensor

Hardware | Sharp GP2Y1010AU0F dust sensor

|

1. 시작하기

원래 Arduino 를 시작하게 된 동기는, 깨끗한 공기속에서 생활하고 싶었습니다.


그렇기 위해서는 병원 침상 위에 설치되어 있는 O2 발생기 같은 것도 필요하겠지만,

일단 상태를 아는 것이 우선입니다.


그래서 sensor 류를 알아보기 시작한거죠.


이번에는 Sharp Optical Dust Sensor 인 GP2Y1010AU0F 에 대해서 알아보겠습니다.


이번에도 AliExpress 에서 도움을 주셨습니다.

Sharp 사의 부품인데, 알리에서 활발히 판매되고 있습니다.






2. specification

PDF 파일입니다.


gp2y1010au_e.pdf


우선 두번째 그림을 참조하여 리드의 번호를 확인합니다.



실제 회로 구성시 필요한 capacitor 와 resister 정보 및 연결도 입니다.





3. Arduino 와 연결


Sharp / Arduino

- 1 (V-LED) / 3.3V (150 Ohm in between)

- 2 (LED-GND) / GND

- 3 (LED) / D12

- 4 (S-GND) / GND

- 5 (Vo) / A6

- 6 (Vcc) / 3.3V (Direct)







4. Sketch

참고 사이트 : http://arduinodev.woofex.net/2012/12/01/standalone-sharp-dust-sensor/

/*
 Standalone Sketch to use with a Arduino Fio and a
 Sharp Optical Dust Sensor GP2Y1010AU0F
 
 Blog: http://arduinodev.woofex.net/2012/12/01/standalone-sharp-dust-sensor/
 Code: https://github.com/Trefex/arduino-airquality/
 
 For Pin connections, please check the Blog or the github project page
 Authors: Cyrille Médard de Chardon (serialC), Christophe Trefois (Trefex)
 Changelog:
   2012-Dec-01:  Cleaned up code
 
 This work is licensed under the
 Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
 To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
 or send a letter to Creative Commons, 444 Castro Street, Suite 900,
 Mountain View, California, 94041, USA.
*/
 
int measurePin = 6;
int ledPower = 12;
 
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 - 3.3V mapped to 0 - 1023 integer values
  // recover voltage
  calcVoltage = voMeasured * (3.3 / 1024);
 
  // 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);
 
  delay(1000);
}

그래프로 그려보면, Signal Value 가 너무 높아서 Dust Density 가 잘 보이지 않습니다.


그래서 다른 값들은 comment out 하고, "dustDensity = 0.17 * calcVoltage - 0.1" 부분을,

1000배인 "dustDensity = (0.17 * calcVoltage - 0.1) * 1000" 로 바꾸면 볼만 해 집니다.



5. 결과

중간에 그래프가 높이 올라간 것은 먼지털이게를 옆에서 털있기 때문이예요.




FIN

이제 뭘하지?

'Hardware' 카테고리의 다른 글

Hardware | Transistor Tester  (0) 2017.05.01
Hardware | BMR-C1 heatsink  (0) 2017.04.26
Hardware | Arduino nano 조립기  (0) 2017.03.31
Hardware | GeForce GTX 560 Ti 수리 실패기  (0) 2017.03.16
Hardware | BME280 sensor  (0) 2017.03.09
And
prev | 1 | next