Labs / Electronic modules

GraftSense: An Open Version of Adapter Module for Particulate Matter Concentration Detection Based on PMS5003T

Author: Li Zisheng · Source: FreakStudio open documentation, v1.1 · License: CC BY 4.0

Contents
PMS5003T C7 C6 PM2.5/PM10 UART/I2C
PMS5003T LED1 R2 C1 C7 U1 5V

I. Module Introduction

The particulate matter concentration detection adapter module based on PMS5003T is a level conversion and power supply adaptation board designed for the PMS5003T particulate matter sensor. It adopts the laser scattering principle to realize three-channel particulate matter concentration detection of PM1.0, PM2.5 and PM10, with a minimum identifiable particle size of 0.3μm, a measurement range of 0~500μg/m³, and an error of ≤±10μg/m³ in the low concentration section;This module has a built-in 5V-to-3.3V power supply circuit and reset circuit, which converts the 5V power supply and UART level of the sensor to 3.3V logic, and can directly communicate with 3.3V MCU. It supports two operating modes: active reporting and passive query, with an average power consumption of approximately 100mW, and is suitable for embedded scenarios such as air quality monitoring and environment detection.

II. Introduction to Major Chips

PMS5003T is a digital particulate matter sensor based on the laser scattering principle, which can simultaneously detect the concentrations of PM1.0, PM2.5 and PM10. It features a minimum identifiable particle size of 0.3μm, a measurement range of 0~500μg/m³, communicates via UART, supports both active reporting and passive query modes, and is suitable for air quality monitoring scenarios.

2.1 Chip Overview

PMS5003T 0.3
1 PMS5003T

2.2 Pin Definition

PIN1 PIN2 PIN3 5V 3.3V 2.2 PMS5003T
PMS5003T PIN4 PIN8 3.3V PIN5 PIN6 PIN7

2.3 Functional Block Diagram

None.

2.4 Performance Parameters

PMS5003T can detect particulate matters with a size of 0.3~10μm, PM2.5 has a measurement range of 0~500μg/m³(maximum ≥1000μg/m³), a resolution of 1μg/m³, and is powered by 5V, UART communication, a fast response time ≤10s, and a mean time between failures ≥3 years, making it suitable for high-precision air quality monitoring.

PMS5003T 1 0.3 1.0 2.5 10 50 98 0.5 0
PMS5003T
PMS5003T 20 PM2.5 TXXXXX30 1 9 600 70

The PMS5003T series sensors feature excellent output consistency for 20℃ room-temperature PM2.5 concentration measurements: as the number of measurements increases for multiple sensors, the concentration gradually drops from approximately 600μg/m³ to around 70μg/m³, with all curves showing highly consistent trends, which demonstrates sound measurement consistency.

PMS5003T 43 PM2.5 4-2 10 TXXXX30 9 1 20 400

PMS5003T series sensors in and 43 ℃ high temperature environment PM2.5 concentration output consistency, multiple sensors with the increase of measurement times, the concentration from about 400μg/m ³ gradually decreased to about 60μg/m ³, each curve trend highly coincide, reflecting good high temperature measurement consistency.

PMS5003T 4-3 5 PM2.5 TXXXX30 9 10 1 15 400

PMS5003T series sensors in - 5 ℃ low temperature environment PM2.5 concentration output consistency, multiple sensors with the increase of measurement times, the concentration from about 400μg/m ³ gradually decreased to about 50μg/m ³, the curve trend highly coincide, reflecting good low temperature measurement consistency.

30 PM2.5 TXXXX30 PMS5003T

PMS5003T series sensors' 30-day long-term continuous operation PM2.5 concentration output consistency: for multiple sensors, as the number of measurements increases, the concentration gradually drops from approximately 500μg/m³ to around 50μg/m³, with all curves showing highly consistent trends, which demonstrates excellent long-term operational stability and measurement consistency.

10 0 14 40 60 PMS5003T

PMS5003T The absolute value of the maximum consistency deviation of the sensor shows a " U -shaped" curve with temperature changes. The deviation is the smallest (about 10%) in the range of 20-40 ℃, and the deviation increases slightly (about 14-15%) at low temperature (-10 ℃) and high temperature (60 ℃), maintaining good temperature stability as a whole.

2.5 Reference Circuit

PMS5003T PMS1003/3003/5003 PMS5003 10K 2.7
PMS5003T 3.3V 5V PIN7 PIN8 30

2.6 Chip Configuration

None.

PMS5003T adopts UART communication, with the default baud rate of 9600bps, no parity, and 1 stop bit, and supports two transmission protocols, namely active mode and passive mode:

PM55003 9600bps 1 32 0x42 0xd4 2x13+2 PM1.0 PM2.5 PM10
12 13 0.1 10um 1 2
9600bps 1 0xe2 0xe1 0xe4

2.8 PCB Routing Precautions

None.

III. Circuit Engineering

3.1 Circuit Source Engineering

To obtain the circuit source project, please follow the official account [Freak Embedded].

3.2 Module Usage Instructions

The schematic diagram of this module is shown below:

SCH_Particulate Matter Detection Adapter Module Based on PMS5003T-V1.0.0_2026-03-25.pdf 2.3 MB

PMS5003T PM2.5 LED1 5V

This module provides a serial port UART interface MRX and MTX: here M stands for master, meaning the MCU 's RX corresponds to the module' s TX; when in use, please ensure that the communication parameters of the microcontroller's UART interface are consistent with those of the module, so as to stably implement the read and write operations for the PMS5003T sensor's PM1.0, PM2.5, PM10 concentration data and configuration parameters through this interface. It is suitable for embedded scenarios such as air quality monitoring and environmental detection, and provides reliable particulate matter concentration data interaction capability for the system.

The module is equipped with an on-board RST reset button, which can be pressed to reset the module when necessary.

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and the particle concentration detection adapter module based on the PMS5003T uses the UART interface to communicate with the main controller.

Here, we first use the HY2.0-4P connection cable to connect the module to the GraftPort-RP2040 development board's UART0 interface, and connect the cable interface of the particulate matter concentration detection module to the adapter module:

GraftPort-RP2040 HY2.0-4P

The module connections are shown in the following table:

Development Board Pins

Module Pins

Description

Pin 16

MTX

UART data transmission line, corresponding to the transmit pin of the development board

Pin 17

MRX

UART data transmission line, corresponding to the receiving pin of the development board

Here, we need to search for the relevant driver packages on uPyPI: https://upypi.net/zh/

106

Enter pms5003t_driver to search, and the following will be displayed:

pms5003t_driver 1.8.0

Click to copy the local installation command:

pms5003t_driver 1.0.0 2024 03 31

Import the module driver library code via the mip tool. Below are the usage commands for the mpremote tool:

mpremote mip install https://upypi.net/pkgs/pms5003t_driver/1.0.0

Import the MicroPython driver code for the PMS5003T-based particulate matter concentration detection adapter module, then copy the following main.py code into our project:

# Python env   : MicroPython v1.23.0
# -*- coding: utf-8 -*-
# @Time    : 2026/3/27 PM 5:00
# @Author  : Kevin Köck
# @File    : main.py
# @Description : PMS5003 air quality sensor test program, demonstrating active/passive mode switching and power-saving mode

# ======================================== Import Modules =========================================

import machine

# import pms5003
import uasyncio as asyncio
import pms5003

# ======================================== Global Variables ============================================

# Get the event loop object
loop = asyncio.get_event_loop()

# Default delay parameter (unused)
_DEFAULT_MS = 20

# PMS5003 sensor instance
pm = None
# Async lock for multi-task synchronization
lock = asyncio.Lock()

# ======================================== Functions ============================================


async def printit():
    """
    Print the sensor's current measurement data
    Args: None

    Raises: None

    Notes: This function is registered as a callback on the sensor and is called automatically when new data arrives

    ==========================================
    Print current measurement data of sensor
    Args:None

    Raises:None

    Notes:This function is registered as callback, called automatically when new data arrives
    """
    pm.print()


import time


async def idle():
    """
    Idle task, sleeps periodically
    Args: None

    Raises: None

    Notes: Not used in the main program, reserved

    ==========================================
    Idle task, periodically sleeps
    Args:None

    Raises:None

    Notes:Not used in main program, reserved
    """
    while True:
        await asyncio.sleep(2)
        time.sleep_ms(5)


async def testing():
    """
    Test sensor mode switching
    Wait 120 seconds, then enter active mode; wait another 120 seconds, then switch to passive mode (power saving disabled); finally enable power-saving mode
    Args: None

    Raises: None

    Notes: Demonstrates sensor behavior in different modes

    ==========================================
    Test sensor mode switching
    Wait 120 seconds, switch to active mode, then after 120 seconds switch to passive mode (eco off), finally enable eco mode
    Args:None

    Raises:None

    Notes:Demonstrates sensor behavior in different modes
    """
    await asyncio.sleep(120)
    while pm._sleeping_state is False:
        await asyncio.sleep_ms(100)
    print("")
    print("")
    print("----------------------------------------------------------")
    print("")
    print("Setting to active mode while sleeping")
    print("")
    print("----------------------------------------------------------")
    print("")
    print("")
    asyncio.create_task(pm.setActiveMode())
    await asyncio.sleep(120)
    print("")
    print("")
    print("----------------------------------------------------------")
    print("")
    print("Setting to passive mode whithout sleeping with 20s interval")
    print("")
    print("----------------------------------------------------------")
    print("")
    print("")
    pm.setEcoMode(False)
    asyncio.create_task(pm.setPassiveMode(20))
    await asyncio.sleep(120)
    print("")
    print("")
    print("----------------------------------------------------------")
    print("")
    print("Activating EcoMode, interval will be adapted to 60s")
    print("")
    print("----------------------------------------------------------")
    print("")
    print("")
    pm.setEcoMode(True)


def start():
    """
    Initialize the sensor and start the main loop
    Args: None

    Raises: None

    Notes: Configure UART, create the PMS5003 instance, register the callback, start the test task, and run the event loop

    ==========================================
    Initialize sensor and start main loop
    Args:None

    Raises:None

    Notes:Configure UART, create PMS5003 instance, register callback, start test task and run event loop
    """
    uart = machine.UART(0, tx=16, rx=17, baudrate=9600)
    global pm
    pm = pms5003.PMS5003(uart, lock, active_mode=False, interval_passive_mode=60)
    pms5003.set_debug(True)
    pm.registerCallback(printit)
    asyncio.create_task(testing())
    asyncio.get_event_loop().run_forever()


# ======================================== Custom Classes ============================================

# ======================================== Initialization configuration ===========================================

# Wait for the system to stabilize
time.sleep(3)
# Print initialization complete message
print("FreakStudio: PMS5003 sensor driver initialized")

# ========================================  Main Program  ============================================

start()

Burn the code, open the terminal, and the output is as follows:

PMS5003T 228 PM1.0 PM2.5 PM10

We can see the terminal print out the particulate matter concentration and AQI data.

4. Drivers

pms5003t_driver-1.0.0.zip 19 KB

None.

VI. Revision History

Document Version

Date of Revision

Modifier

Modify Content

v1.0

2026-03-25

Ling Gaoxing

Initialize the document

v1.0.1

2026-04-05

Li Zisheng

No photos for the homepage have been taken, the production files have not been exported yet, and all other items have been sorted out.

v1.0.2

2026-04-14

Li Zisheng

Modified main.py.

v1.0.3

2026-04-21

Li Zisheng

The production documents have not been exported yet, while all the rest have been sorted out.

v1.1

2026-04-23

Xin Ruili

Create an open version of the document, based on the internal document version v1.0.3.

VII. Relevant Materials

7.1 Chip Datasheet

PMS5003 Particulate Matter Sensor Chinese Manual V2.3 .pdf 838 KB

7.2 PCB Silkscreen Specific Icons

PMS5003 PM2.5 1 2 3 4 5 7.2