How to Build a Simple DIY Air Quality Sensor with an Arduino

Building your own air quality sensor with an Arduino is a fun electronics project that allows you to measure the air quality in your home or office. With just a few common components, I can make a simple device to monitor airborne particles and volatile organic compounds. Here is a step-by-step guide on how I built my own DIY air quality sensor.

Selecting the Sensor Components

To build the air quality sensor, I needed to select the right components to detect particles and gases. Here are the main parts I used:

Particle Sensor

Gas Sensor

Microcontroller

LCD Display

Circuit Design and Construction

With my components selected, the next step was to wire up the circuit on a breadboard and solderless prototyping board.

Wiring the Particle Sensor

The PMS5003 particle sensor uses a serial UART interface to communicate with the Arduino. I connected the 5V power and ground pins to the Arduino's power rails. The Tx and Rx pins were connected to the Arduino's Rx and Tx pins.

Connecting the Gas Sensor

The MQ135 gas sensor has 4 pins - heater power, ground, analog out, and digital out. I connected the heater power and ground to 5V and ground respectively. The analog out pin was connected to an analog input pin on the Arduino.

LCD Display Wiring

The LCD display module has 16 pins. I connected the VCC and ground pins to power and ground. The VO pin was wired to a potentiometer to adjust contrast. Finally, the RS, Enable, D4-D7 pins were connected to Arduino pins defined in the code.

Uploading the Code

With the circuit wired up, I uploaded the air quality sensor code to the Arduino using the Arduino IDE software on my computer.

Enclosure and Power

To complete the project, I needed to add a power source and enclose the project in a protective case.

Power Options

For this build, I am powering the Arduino and sensor circuit using a standard 9V DC wall adapter plugged into the power jack on the Arduino Uno board.

Alternatively, I could power it with a 9V battery or via the USB connection when plugged into a computer.

Enclosure

To protect the air quality sensor, I mounted the Arduino, breadboard, and sensors inside an electronics project enclosure box. I drilled holes for the LCD display and gas sensor to be mounted externally.

Testing and Calibration

Once assembled, I tested the DIY air quality sensor by sampling different conditions:

I adjusted the sensitivity thresholds and calibrated the gas sensor baseline for clean air. Overall, the sensors responded as expected in detecting particles and volatile gases in real-time.

Conclusion

Building your own air quality sensor with an Arduino is an enjoyable and educational electronics project. With common components like Particle/gas sensors, LCD display, and Arduino, I was able to make an effective DIY device to measure indoor air quality. This simple air monitor can be expanded and modified by adding WiFi connectivity, data logging, and custom 3D printed enclosures.