This optical dust sensor can measure the air quality by measuring on air particles/dust. The Air Quality Index (IAQ) is fairly easy to determine using an Arduino (or ESP32, ESP8266) and a DSM501 sensor. The DSM501A is a detector capable of measuring the presence of fine particles in suspension in the atmosphere according to PM2.5 and PM10 standards.
The DSM501A is a very economical sensor which can be used as a base to build an air quality measurement station connected with an ESP8266. The DSM501A is able to carry out measurements to the PM2.5 and PM10 standards. That is, it is capable of detecting particles whose diameter is less than 2.5 μm for PM2.5 and less than 1 μm for PM1.0.
Pinout of the connector:
Tutorial can be found here.