Difference between revisions of "Dust Sensor"

From Waveshare Wiki
Jump to: navigation, search
m (Text replacement - "{{#urlget:amazon|default}}=display" to "{{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}=display")
Line 7: Line 7:
 
|category=[[:Category:Modules|Modules]], [[:Category:Sensors|Sensors]]
 
|category=[[:Category:Modules|Modules]], [[:Category:Sensors|Sensors]]
 
|brand=Waveshare
 
|brand=Waveshare
|{{#urlget:amazon|default}}=display
+
|{{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}=display
 
|website_cn=[http://www.waveshare.net/shop/dust-sensor.htm 网站]
 
|website_cn=[http://www.waveshare.net/shop/dust-sensor.htm 网站]
 
|website_en=[http://www.waveshare.com/dust-sensor.htm Website]
 
|website_en=[http://www.waveshare.com/dust-sensor.htm Website]

Revision as of 13:33, 12 May 2022

Dust Sensor
Dust-Sensor

Dust Sensor, A simple Air Monitor
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

  • Onboard sharp GP2Y1010AU0F, detecting fine particles larger than 0.8μm in diameter, even like cigarette smoke.
  • Low power consumption, analog voltage output, the output level is linear with dust density.
  • Embedded voltage boost circuit to support a wide range of power supplies.

Specifications

  • Sensitivity : 0.5V/(100μg/m3)
  • Measurement range: 500μg/m3
  • Power: 2.5V~5.5V
  • Operating current : 20mA(max)
  • Operating temperature: -10℃~65℃
  • Storage temperature: -20℃~80℃
  • Life time: 5 years
  • Dimension : 63.2mm×41.3mm×21.1mm
  • Mounting holes size: 2.0mm
  • Air hole size: 9.0mm

Sensor Characteristics

The output voltage of the module is proportional to dust density in the range of 0 to 0.5mg/m3.
Dust Sensor- (1).png

Control principle

  • Enable the internal infrared emitting diode by setting the pin ILED to HIGH.
  • Wait 0.28ms, then the external controller starts to sample the voltage from the pin AOUT of the module. Notes that the output wave will take 0.28ms to reach steady-state after the internal infrared emitting diode is enabled.

Dust Sensor- (2).png

Pinouts

PIN Description
VCC 2.5V-5.5V
GND Power ground
AOUT Analog data output
ILED Driver pin of internal LED

Get Started at Pico

If you are the first time o use the Pico, you need to first learn how to get started at the Pico before you run other examples.
The Pico supports C and the Micropython which requires different firmware.
In most of the examples archives (Demo codes), we provide a Micropython firmware (uf2 file), we recommend you to use the provided firmware to test the board. Because the codes may run abnormally with different firmware.
If the board is tested to be workable, you can also download the newest firmware from Raspberry Pi and do further programming.

Hardware Connection

Sensor Pico Description
VCC 3.3V Power input
GMD GND Power ground
AOUT GP26 Analog data output
ILED GP22 Driver pin of internal LED
Dust-Sensor-Pico 1.jpg

Download examples

Use the Raspberry Pi as the host device. Open a terminal and run the following commands to download the example.

sudo apt-get install p7zip-full
cd ~
sudo wget  https://www.waveshare.com/w/upload/2/2a/Dust-Sensor-code.7z
7z x Dust-Sensor-code.7z -o./Dust-Sensor-code

Examples

C codes

  • go into the c directory
cd ~/Dust-Sensor-code/Pico/c/build
  • Add the path of SDK
export PICO_SDK_PATH=../../pico-sdk
Note that if the path of your SDK is different, you need to modify the command and use the correct path to export
  • Generate Makefile and build
cmake ..
make -j9
  • After building, a uf2 file is generated
  • Press and hold the button of Pico, connect it to Raspberry Pi then release the button.
  • Copy/Drag the uf2 file to the portable disk (RPI-RP2) recognized
cp main.uf2 /media/pi/RPI-RP2/

Micropython codes

  • Flash the Micropython firmware first
  • Open the Thonny IDE (Menu->Programming->Thonny Python IDE).
  • 【Optional】If the Thonny IDE in the Raspberry Pi is not the new version that supports Pico, please upgrade it first.
sudo apt upgrade thonny
  • Configure Interpreter, choose Tools->Options... -> Interpreter, choose MicroPython(Raspberry Pi Pico) and the ttyACM0 port.
400
  • Click File -> Open.. and browser the Micropython codes (Dust Sensor.py) to run the codes

Expected result

  • The dust data are printed to serial port:
Dust Sensor- (3).jpg

Reference:

Air quality criterion
PM2.5
density value(μg/m3)
Air quality index
AQI
Air quality level Air quality evaluation
0-35 0-50 Excellent
35-75 51-100 Average
75-115 101-150 Light pollution
115-150 151-200 Moderate pollution
150-250 201-300 Heavy pollution
250-500 ≥300 Serious pullution

The STM32 examples are based on the STM32F103RBT6 and the STM32H743. The connection provided below is based on the STM32F103RB. If you need to use other STM32 boards, you may need to change the hardware connection and port the code yourself.

Use with STM32

Hardware connection

Sensor STM32 Description
VCC 3.3V Power input
GMD GND Power ground
AOUT PA6 Analog output
ILED PA7 Driver pin of internal LED
Dust-Sensor-STM32 1.jpg

Examples

The examples are developed based on the HAL libraries. Download the Demo codes archive to your PC. Unzip and find the STM32 project from Dust-Sensor-code\STM32\STM32F103RB\MDK-ARM.

  • Open the Dust Sensor.uvprojx file by Keil
  • Build and the project
  • Program the project to your STM32 board.
  • Connect the UART1 of your STM32 board to the PC and check the serial data by SSCOM software.
Dust Sensor- (3).jpg

Reference:

Air quality criterion
PM2.5
density value(μg/m3)
Air quality index
AQI
Air quality level Air quality evaluation
0-35 0-50 Excellent
35-75 51-100 Average
75-115 101-150 Light pollution
115-150 151-200 Moderate pollution
150-250 201-300 Heavy pollution
250-500 ≥300 Serious pullution

The Arduino example is written for the Arduino UNO. If you want to connect it to other Arduino boards, you may need to change the connection.

Use with Arduino

Hardware connection

Sensor Arduino Description
VCC 5V Power input
GMD GND Power ground
AOUT A0 Analog data output
ILED D7 Drive pin of the internal LED
Dust-Sensor-Arduino 1.jpg

Examples

  • How to Install Arduino IDE
  • Download the demo codes to your PC and unzip
  • Install the Arduino IDE in your PC
  • Go into Dust-Sensor-code/Arduino/Dust_Sensor
  • Run the Dust_Senosr.ino file
  • Select the correct Board and the Port
MQ5 Arduino 1.jpg
  • Build the project and upload it to the board.
  • Open the serial monitor of the Arduino IDE or the SSCOM software and check the serial data.
Dust Sensor- (3).jpg

Reference:

Air quality criterion
PM2.5
density value(μg/m3)
Air quality index
AQI
Air quality level Air quality evaluation
0-35 0-50 Excellent
35-75 51-100 Average
75-115 101-150 Light pollution
115-150 151-200 Moderate pollution
150-250 201-300 Heavy pollution
250-500 ≥300 Serious pullution

FAQ

Support

Support

If you require technical support, please go to the Support page and open a ticket.