Lib-electronic-components sensirion

Sensirion environmental sensor MPN encoding patterns, suffix decoding, and handler guidance. Use when working with Sensirion humidity, temperature, gas, CO2, particulate, flow, or pressure sensors.

install
source · Clone the upstream repo
git clone https://github.com/Cantara/lib-electronic-components
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Cantara/lib-electronic-components "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/manufacturers/sensirion" ~/.claude/skills/cantara-lib-electronic-components-sensirion && rm -rf "$T"
manifest: .claude/skills/manufacturers/sensirion/SKILL.md
source content

Sensirion Manufacturer Skill

Manufacturer Overview

Sensirion AG is a Swiss sensor manufacturer specializing in environmental sensors. Their product families include:

FamilyProductsApplication
SHTxxSHT30, SHT31, SHT35, SHT40, SHT41, SHT45, SHT85Humidity & Temperature
STSxxSTS30, STS31, STS40Temperature only
SGPxxSGP30, SGP40, SGP41VOC/Gas (Air Quality)
SCDxxSCD30, SCD40, SCD41CO2 concentration
SFAxxSFA30Formaldehyde detection
SPSxxSPS30Particulate matter (PM1.0/2.5/10)
SLFxxxxSLF3S-1300FLiquid flow measurement
SDPxxxSDP31, SDP810Differential pressure

All Sensirion sensors use I2C digital interface (some variants support alternate addresses).


MPN Structure

Sensirion MPNs follow this general structure:

[PREFIX][SERIES]-[VARIANT][GRADE]-[REEL]
   │       │        │        │       │
   │       │        │        │       └── Reel option: R2, R4 (tape & reel qty)
   │       │        │        └── Accuracy grade: A, B, F
   │       │        └── Variant code: DIS, AD1B, D, P, etc.
   │       └── Series number (30, 31, 40, 41, 45, etc.)
   └── Family prefix (SHT, STS, SGP, SCD, SFA, SPS, SLF, SDP)

Example Decoding

SHT31-DIS-B
│  │  │   │
│  │  │   └── B = Accuracy grade B
│  │  └── DIS = Digital sensor variant
│  └── 31 = Series 31 (mid-range accuracy)
└── SHT = Humidity & Temperature sensor

SHT40-AD1B-R2
│  │  │  │ │
│  │  │  │ └── R2 = Tape & reel (2000 pcs)
│  │  │  └── B = Accuracy grade B
│  │  └── AD1 = Alternate I2C address variant
│  └── 40 = Series 40 (4th generation)
└── SHT = Humidity & Temperature sensor

SGP40-D-R4
│  │  │ │
│  │  │ └── R4 = Tape & reel (4000 pcs)
│  │  └── D = Standard digital variant
│  └── 40 = Series 40
└── SGP = Gas sensor (VOC)

SLF3S-1300F
│  │  │   │
│  │  │   └── F = Variant identifier
│  │  └── 1300 = Flow range identifier
│  └── 3S = Series/size
└── SLF = Liquid Flow sensor

Variant Codes

Package/Variant Codes

CodeDescriptionPackage
DISDigital sensor (standard)DFN
DIS-BDigital sensor, B gradeDFN
ARPARP variantDFN
AD1BAlternate I2C address, B gradeDFN
AD1FAlternate I2C address, F gradeDFN
BD1BB variant, alternate addressDFN
DStandard digitalDFN
PPin header (development kit)PIN
BB accuracy gradeDFN
FF accuracy gradeDFN

Reel Options

CodeDescription
R2Tape & reel, 2000 pieces
R4Tape & reel, 4000 pieces

Accuracy Grades

Sensirion sensors come in different accuracy grades. Higher accuracy = tighter tolerance.

GradeAccuracy LevelTypical RH ToleranceUse Case
AHighest+/- 1.5% RHPrecision applications
BMid-range+/- 2.0% RHGeneral purpose
FStandard+/- 2.5% RHCost-sensitive

Grade Ordering (best to worst): A > B > F

Compatibility Rule: Higher accuracy grades can replace lower grades (A can replace B, B can replace F).


Series Families

SHT Humidity & Temperature Sensors

SeriesGenerationKey Features
SHT3x3rd genSHT30/31/35 - established, wide use
SHT4x4th genSHT40/41/45 - smaller, lower power
SHT8xPremiumSHT85 - high accuracy, PTFE filter

Compatibility: SHT4x can replace SHT3x (next generation, same function).

Within series: SHT35 > SHT31 > SHT30 (accuracy ordering)

STS Temperature-Only Sensors

SeriesGenerationNotes
STS3x3rd genSTS30/31 - temperature only
STS4x4th genSTS40 - smaller footprint

Compatibility: STS4x can replace STS3x.

SGP Gas Sensors (VOC)

SeriesGenerationKey Features
SGP3x3rd genSGP30 - multi-pixel gas sensor
SGP4x4th genSGP40/41 - improved, lower power

Compatibility: SGP4x can replace SGP3x (improved performance).

SCD CO2 Sensors

SeriesGenerationKey Features
SCD3xNDIR basedSCD30 - photoacoustic, larger size
SCD4xMiniaturizedSCD40/41 - smaller, breakout board compatible

Compatibility: SCD4x can replace SCD3x (miniaturized, same accuracy).

SDP Differential Pressure Sensors

SeriesPressure RangeNotes
SDP3x+/- 500 PaSDP31 - low range
SDP8x+/- 500/1000 PaSDP810 - extended range

Not interchangeable - different pressure ranges require design consideration.


Supported Component Types

From

SensirionHandler.getSupportedTypes()
:

Set.of(
    ComponentType.SENSOR,              // Generic sensor
    ComponentType.HUMIDITY_SENSOR,     // SHTxx, humidity measurement
    ComponentType.TEMPERATURE_SENSOR,  // SHTxx, STSxx temperature
    ComponentType.PRESSURE_SENSOR,     // SDPxx differential pressure
    ComponentType.SENSOR_FLOW,         // SLFxx liquid flow
    ComponentType.IC                   // SGPxx, SCDxx (complex sensors)
)

Pattern Registration

Component TypePatternProducts
HUMIDITY_SENSOR
^SHT[0-9]{2}.*
SHT30, SHT31, SHT40, etc.
TEMPERATURE_SENSOR
^SHT[0-9]{2}.*
,
^STS[0-9]{2}.*
SHTxx, STSxx
SENSOR
(gas)
^SGP[0-9]{2}.*
SGP30, SGP40, SGP41
SENSOR
(CO2)
^SCD[0-9]{2}.*
SCD30, SCD40, SCD41
SENSOR
(formaldehyde)
^SFA[0-9]{2}.*
SFA30
SENSOR
(particulate)
^SPS[0-9]{2}.*
SPS30
SENSOR_FLOW
^SLF[0-9A-Z]+.*
SLF3S-1300F
PRESSURE_SENSOR
^SDP[0-9]{2,3}.*
SDP31, SDP810

Package Code Extraction

The handler extracts package codes from the variant portion after the first hyphen:

// Input: SHT31-DIS-B
// After first dash: "DIS-B"
// Package part: "DIS" (before second dash)
// Returns: "DFN" (mapped)

// Input: SHT40-AD1B-R2
// After first dash: "AD1B-R2"
// Package part: "AD1B"
// Returns: "DFN"

Package Code Mappings

Variant CodeMapped Package
DISDFN
DIS-BDFN
ARPDFN
AD1BDFN
AD1FDFN
BD1BDFN
DDFN
PPIN (development)
BDFN
FDFN

Note: Most Sensirion sensors use DFN (Dual Flat No-lead) packaging.


Series Extraction

The handler extracts series by grouping based on prefix patterns:

// Input: SHT31-DIS-B
// Base part: "SHT31" (before first dash)
// Starts with "SHT3" → Returns: "SHT3x"

// Input: SCD40-D-R2
// Base part: "SCD40"
// Starts with "SCD4" → Returns: "SCD4x"

Series Groupings

PrefixSeries Group
SHT3xSHT30, SHT31, SHT35
SHT4xSHT40, SHT41, SHT45
SHT8xSHT85
STS3xSTS30, STS31
STS4xSTS40
SGP3xSGP30
SGP4xSGP40, SGP41
SCD3xSCD30
SCD4xSCD40, SCD41
SFA3xSFA30
SPS3xSPS30
SLFxxAll SLF flow sensors
SDP3xSDP31
SDP8xSDP810

Replacement Compatibility

Official Replacement Logic

The handler implements

isOfficialReplacement()
with these rules:

  1. Same series: Compatible if accuracy grade allows

    • A can replace B or F
    • B can replace F
    • F cannot replace A or B
  2. Cross-series replacements:

    • SHT4x can replace SHT3x (next generation)
    • STS4x can replace STS3x
    • SGP4x can replace SGP3x (improved gas sensor)
    • SCD4x can replace SCD3x (miniaturized CO2)
  3. Not interchangeable:

    • SDP3x and SDP8x (different pressure ranges)
    • Different sensor families (SHT cannot replace SGP)

Example MPNs

MPNTypeDescription
SHT30-DIS-B
Humidity/TempSeries 30, digital, grade B
SHT31-DIS-F
Humidity/TempSeries 31, digital, grade F
SHT35-DIS-B
Humidity/TempSeries 35, digital, grade B (highest accuracy in 3x)
SHT40-AD1B-R2
Humidity/TempSeries 40, alt address, grade B, 2k reel
SHT41-AD1B-R2
Humidity/TempSeries 41, alt address, grade B
SHT45-AD1B-R2
Humidity/TempSeries 45, highest accuracy in 4x
SHT85
Humidity/TempPremium, PTFE filter membrane
STS30-DIS-B
Temp onlyTemperature-only sensor
STS40-AD1B-R2
Temp only4th gen temp-only
SGP30
Gas/VOCMulti-pixel gas sensor
SGP40-D-R4
Gas/VOC4th gen VOC sensor
SGP41-D-R4
Gas/VOCNOx + VOC dual sensor
SCD30
CO2NDIR CO2 sensor module
SCD40-D-R2
CO2Miniaturized CO2 sensor
SCD41-D-R2
CO2Extended range CO2
SFA30
FormaldehydeFormaldehyde sensor
SPS30
ParticulatePM1.0/2.5/4/10 sensor
SLF3S-1300F
Liquid Flow0-40 ml/min flow sensor
SDP31
Pressure+/- 500 Pa differential
SDP810-500PA
PressureConfigurable range

Handler Implementation Notes

Interface Extraction

// Most Sensirion sensors use I2C
// AD variants indicate alternate I2C address

if (upperMpn.contains("-AD")) return "I2C-ALT"; // Alternate address
return "I2C"; // Default

Accuracy Grade Extraction

// Grade embedded in variant code or as suffix
// SHT31-DIS-B → grade "B"
// SHT40-AD1B → grade "B" (from "1B")

if (upperMpn.contains("-B") || upperMpn.contains("1B")) return "B";
if (upperMpn.contains("-F") || upperMpn.contains("1F")) return "F";
if (upperMpn.contains("-A") || upperMpn.contains("1A")) return "A";

Related Files

  • Handler:
    manufacturers/SensirionHandler.java
  • Component types:
    SENSOR
    ,
    HUMIDITY_SENSOR
    ,
    TEMPERATURE_SENSOR
    ,
    PRESSURE_SENSOR
    ,
    SENSOR_FLOW
    ,
    IC

Learnings & Quirks

  • All sensors use I2C: Sensirion standardizes on I2C digital interface across all product families
  • DFN is dominant: Most sensors use DFN (Dual Flat No-lead) packaging; "P" suffix indicates pin header for development
  • Generation upgrades: 4x series generally replaces 3x series with improved specs and smaller footprint
  • Accuracy grade hierarchy: A > B > F; higher grades can replace lower but not vice versa
  • Dual-function sensors: SHTxx measures both humidity AND temperature; use appropriate ComponentType based on application
  • Complex sensors as IC: Gas (SGP), CO2 (SCD), and particulate (SPS) sensors are registered as both SENSOR and IC due to their processing complexity
  • AD variants: "AD" in variant code indicates alternate I2C address for multi-sensor configurations
  • Reel quantities: R2 = 2000 pcs, R4 = 4000 pcs tape and reel
  • Pressure sensors not interchangeable: SDP3x and SDP8x have different pressure ranges; check specs before substitution
  • No manufacturer-specific ComponentTypes: Unlike TI/ST handlers, Sensirion uses generic types (HUMIDITY_SENSOR, not HUMIDITY_SENSOR_SENSIRION)
<!-- Add new learnings above this line -->