Introduction: Fine Dust Sensor Device

About: My name is seonwoo, young maker who has maker movement and fair experience from 2014. I participated in the first maker fair in 2014 with my work with my parents. I live in Seoul, South Korea and I enjoy makin…

What is fine dust?

Step 1: What Is Dust

It is dust with very small particle size. It is classified into fine dust (diameter less than 10ym) and ultrafine dust (diameter less than 2.5ym) depending on the diameter of dust.

Hazard of fine dust on human body

Because fine particles are small, they accumulate in the lungs, but they can enter the blood through the pesos and cause a variety of complex diseases.

The reason is 'not visible to the eye, intuitively unable to confirm the current state' because.
If I can confirm the amount of fine dust in the space that I am now, I will be able to manage the health of fine dust a little more.

Step 2: Step1 : How to Make Dust Check Sensor

For the first time, I will design the shell of the outer surface with AutoCode. (I will put up my design ~)

This is a design file for AutoCAD, you can print it out and paste it as shown in the picture above.

Step 3: Step2 : Connect the Wires

Please connect the lines as shown in this site. Arduino mega, Brad board and fine dust sensor, LED.

Step 4: Step3 : Coding



// OLED display TWI address #define OLED_ADDR 0x3C

Adafruit_SSD1306 display(-1);

#if (SSD1306_LCDHEIGHT != 64) #error("Height incorrect, please fix Adafruit_SSD1306.h!"); #endif

// dot int DIN = 7; // DIN pin of MAX7219 module int CLK = 6; // CLK pin of MAX7219 module int CS = 5; // CS pin of MAX7219 module int maxInUse = 1; MaxMatrix m(DIN, CS, CLK, maxInUse); char A[] = {4, 8, B01111110, B00010001, B00010001, B01111110, }; char B[] = {4, 8, B01111111, B01001001, B01001001, B00110110, }; char smile01[] = {8, 8, B00111100, B01000010, B10010101, B10100001, B10100001, B10010101, B01000010, B00111100 }; char smile02[] = {8, 8, B00111100, B01000010, B10010101, B10010001, B10010001, B10010101, B01000010, B00111100 }; char smile03[] = {8, 8, B00111100, B01000010, B10100101, B10010001, B10010001, B10100101, B01000010, B00111100 };

//dust int measurePin = A3; int ledPower = 12;

unsigned int samplingTime = 280; unsigned int deltaTime = 40; unsigned int sleepTime = 9680;

float voMeasured = 0; float calcVoltage = 0; float dustDensity = 0;

void setup() { m.init(); // MAX7219 initialization m.setIntensity(8); // initial led matrix intensity, 0-15 //dust Serial.begin(9600); pinMode(ledPower,OUTPUT); // oled // initialize and clear display display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR); display.clearDisplay(); display.display();

// display a pixel in each corner of the screen display.drawPixel(0, 0, WHITE); display.drawPixel(127, 0, WHITE); display.drawPixel(0, 63, WHITE); display.drawPixel(127, 63, WHITE); }

void loop() { //dust 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.println("Raw Signal Value (0-1023):"); Serial.println(voMeasured);

Serial.println("Voltage:"); Serial.println(calcVoltage);

Serial.println("Dust Density:"); Serial.println(dustDensity); // display a line of text display.clearDisplay(); display.display(); display.setTextSize(2); display.setTextColor(WHITE); display.setCursor(7,13); display.print("DUST :"); display.setCursor(25,37); display.print(dustDensity); display.setCursor(80,37); display.print("mg"); // unit: mg/m3

// update display with all of the above graphics display.display();

delay(1000); // Seting the LEDs On or Off at x,y or row,column position m.clear();

if(0.0 <= dustDensity && dustDensity <= 0.1) { m.writeSprite(0, 0, smile01); delay(1000); } if(0.1 < dustDensity && dustDensity <= 0.35) { m.writeSprite(0, 0, smile02); delay(1000); } if(0.35 < dustDensity) { m.writeSprite(0, 0, smile03); delay(1000); } }