Skip to the content
PCBKitNew board
2 layers49.5 × 59.7 mmPm sensor UART, the printed circuit board in 3D

Pm sensor UART

ondras12345/pm-sensor

SPS30-based PM2.5 particulate matter sensor with RS485

Size
49.5 × 59.7 mm
Copper layers
2
Thickness
1.6 mm
Parts
38
Nets
38
Pads
121
Tracks, vias
244, 8
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
31 Jan 2025
Updated
20 Oct 2025

Overview

Pm sensor UART is an open-source printed circuit board by ondras12345, from the ondras12345/pm-sensor repository on GitHub, published under the MIT licence. It is a 2-layer board of 49.5 × 59.7 mm with 38 parts on 38 nets, routed with 244 tracks and 8 vias.

It is built around the ATTINY2313A-PU, THVD1400DRL and AZ1117H-3.3TRE1, with the 0ZCF0150FF2C, 54601-908WPLF and SM712-02HTG among its other parts. Its parts include 11 capacitors, 6 resistors, 4 ICs, 4 connectors and 2 diodes. It belongs with the interfaces and adapters and sensors and measurement boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

6

README

README.md

Particulate Matter Sensor

An SPS30-based outdoor particulate matter sensor for Home Assistant.

3D model of custom PCB and SPS30 sensor in a 3D printed enclosure 3D view of assembled PCB 3D view of assembled PCB Photograph of installed outdoor particulate matter sensor

This repository contains hardware designs and firmware for a PCB that connects to the UART interface on an SPS-30 sensor and allows it to be used via a half-duplex RS-485 link. It is designed to be put in one enclosure with the sensor and receive both power and commands via a standard UTP cable with RJ-45 connectors (but it does not use Ethernet).

The PCB is populated with a switch mode power supply module, an RS-485 transceiver and an ATtiny2313 microcontroller. The data out pin of the transceiver is connected straight to the SPS-30's Rx pin, the SPS-30's Tx pin is connected to the Rx pin of the MCU, and the MCU's Tx is connected to the transceivers data input.

In normal mode, the transceiver is put in receive mode, and the remote master is free to send any commands to the sensor. When the sensor sends a response, the bytes are buffered in the MCU. The MCU then switches the transceiver to transmit mode and empties its buffer. Finally, the normal (receive) mode is restored, and the device is ready to receive the next command from the master.

The Sensirion UART protocol is half-duplex in nature, so the use of a half-duplex physical link should not introduce any issues.

The software directory contains a program that makes a Linux server with a USB to RS485 converter to talk to the sensor and periodically publish readings to an MQTT topic, where they can be picked up by Home Assistant.

Notes

Design goals

  • No nontrivial firmware without OTA in the attic.
    • I have already made one device that requires me to stand on a ladder while flashing firmware. I'm not making that mistake again.
    • This means no custom modbus converters (thats not a trivial firmware task), no CC2530 zigbee, ...
  • No Wi-Fi
    • Either wired (preferred, power will need wires anyways) or zigbee.

Communication interface

  • The sensor has I2C and UART.
  • I2C: there is an esphome library, but the MCU would have to be within 10 cm of the sensor.
  • UART: master-slave, we can probably make it work half-duplex over RS-485 based on the 0x7E start/stop byte
    • UART is fixed @ 115200 baud
    • need UART-friendly crystal: 3.6864 MHz

Choice of microcontroller

  • I needed an ATtiny with UART. While the ATtiny2313 is seriously outdated, I have several of them in stock, so I chose to use it.

Motivation

  • In the winter, the outside air in our village is often polluted with wood smoke. I wanted my Home Assistant instance to be able to detect this and suggest the best time to open the windows.

Parts

38
QtyValueFootprintReferences
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
4NetTie_2Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderNT1, NT2, NT3, NT4
3100nCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC6, C9, C11
310kResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR1, R2, R5
210Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR3, R6
218pCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC7, C8
222u / 10VCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC2, C4
10ZCF0150FF2CFuse:Fuse_2920_7451Metric_Pad2.10x5.45mm_HandSolderF1
110u / 10VCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC3
110u / 50VCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC1
1120 / 0.25WResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR4
11uCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC10
13.6864M-49S-SRCrystal:Crystal_HC49-U_VerticalY1
154601-908WPLFondra:RJ45_54601-908WPLFJ3
1ATTINY2313A-PUPackage_DIP:DIP-20_W7.62mmU3
1AVR-ISP-6Connector_IDC:IDC-Header_2x03_P2.54mm_VerticalJ4
1AZ1117H-3.3TRE1Package_TO_SOT_SMD:SOT-223-3_TabPin2U2
1Conn_01x08_PinConnector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ2
1N7805-1PVondra:N78xx-xPVU1
1NS25-W5PConnector_Molex:Molex_KK-254_AE-6410-05A_1x05_P2.54mm_VerticalJ1
1RAD 1000/50 RM5 SKCapacitor_THT:CP_Radial_D13.0mm_P5.00mmC5
1SM712-02HTGPackage_TO_SOT_SMD:SOT-23D2
1SMAJ28A-13-FDiode_SMD:D_SMA_HandsolderingD1
1SolderJumper_2_BridgedJumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP1
1THVD1400DRPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU4

Questions

How big is the Pm sensor UART PCB?

It measures 49.5 × 59.7 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Pm sensor UART use?

38 parts, built around the ATTINY2313A-PU, THVD1400DRL, AZ1117H-3.3TRE1 and 0ZCF0150FF2C. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Pm sensor UART KiCad files?

From the ondras12345/pm-sensor repository on GitHub, at the commit this page was made from: the board is hardware/pm-sensor-UART/pm-sensor-UART.kicad_pcb and its schematic hardware/pm-sensor-UART/pm-sensor-UART.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Pm sensor UART design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers94 × 87.6 mmCNC relays, the printed circuit board in 3D

    CNC relays

    ondras12345/CNC

    My CNC 1610 and Stepcraft model 600 configuration and CNC-related notes

    100 partsMIT
  • 2 layers99.7 × 31.8 mmVetrnik wind sensor, the printed circuit board in 3D

    Vetrnik wind sensor

    ondras12345/vetrnik

    Electronics for heating water with power from a 2 kW wind turbine

    41 parts
  • 2 layers116 × 30 mmMulticdc LEDs, the printed circuit board in 3D

    Multicdc LEDs

    ondras12345/multicdc

    RP2040-based 6-channel USB to UART converter with Zephyr RTOS

    37 parts1MIT
  • 2 layers457.4 × 132 mmSP110Duo, the printed circuit board in 3D

    SP110Duo

    printsmith/keyboards

    Custom keyboard featuring a modified Southpaw 1800 layout with 2 nav clusters, LCD display and rotary encoders.

    309 parts
  • 4 layers368.2 × 159.8 mmChunky2040 rev3, the printed circuit board in 3D

    Chunky2040 rev3

    freznel10/Chunky2040_rev2

    draft

    736 parts39MIT
  • 2 layers228.6 × 79.4 mmTzarc keyboards ghoul, the printed circuit board in 3D

    Tzarc keyboards ghoul

    punkfab/pcb-corpus

    235 real KiCad boards from open-source hardware repositories, prepared as a placement and routing benchmark

    191 parts1
  • 2 layers154.5 × 105 mmInterface brain, the printed circuit board in 3D

    Interface brain

    ademuri/colordance-circle

    An art project that uses arrays of colored lights around a circle to create kaleidoscopic colored shadows.

    174 parts4Apache-2.0