Skip to content

Parallax P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the Sensirion SCD30 CO2 sensor

License

Notifications You must be signed in to change notification settings

avsa242/scd30-spin

Repository files navigation

scd30-spin


This is a P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the Sensirion SCD30 CO2 sensor.

IMPORTANT: This software is meant to be used with the spin-standard-library (P8X32A) or p2-spin-standard-library (P2X8C4M64P). Please install the applicable library first before attempting to use this code, otherwise you will be missing several files required to build the project.

Salient Features

  • I2C connection at up to 100kHz (P2, or P1 with PASM engine), or ~30kHz (P1, SPIN engine) (max recommended according to Sensirion is 50kHz)
  • Read CO2, Temperature, RH data (IEEE-754 float, or hundredths of unit integer)
  • Set measurement interval in seconds
  • Sensor data-ready status
  • Read sensor firmware version
  • Soft-reset
  • Set altitude or ambient pressure used to compensate CO2 readings
  • Automatic or manual calibration

Requirements

P1/SPIN1:

  • spin-standard-library
  • 1 extra core/cog for the PASM I2C engine (none if the SPIN I2C engine is used)
  • sensor.temp.common.spinh (source: spin-standard-library)
  • sensor.rh.common.spinh (source: spin-standard-library)
  • sensor.co2.common.spinh (source: spin-standard-library)

P2/SPIN2:

  • p2-spin-standard-library
  • sensor.temp.common.spin2h (source: p2-spin-standard-library)
  • sensor.rh.common.spin2h (source: p2-spin-standard-library)
  • sensor.co2.common.spin2h (source: p2-spin-standard-library)

Compiler Compatibility

Processor Language Compiler Backend Status
P1 SPIN1 FlexSpin (6.9.4) Bytecode OK
P1 SPIN1 FlexSpin (6.9.4) Native/PASM OK
P2 SPIN2 FlexSpin (6.9.4) NuCode Untested
P2 SPIN2 FlexSpin (6.9.4) Native/PASM2 OK

(other versions or toolchains not listed are not supported, and may or may not work)

Limitations

  • Requires a build-time change of behavior to the I2C engine (symbol QUIRK_SCD30 is automatically enabled by the driver at build-time)

About

Parallax P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the Sensirion SCD30 CO2 sensor

Topics

Resources

License

Stars

Watchers

Forks