sgp30

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Overview

SGP30 VOC sensor.

This sensor is marked obsolete by Sensirion, but is still commonly available.

Datasheet: https://sensirion.com/media/documents/984E0DD5/61644B8B/Sensirion_Gas_Sensors_Datasheet_SGP30.pdf

Index

Constants

View Source
const Address = 0x58

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

type Device

type Device struct {
	// contains filtered or unexported fields
}

func New

func New(bus drivers.I2C) *Device

New returns a new SGP30 driver instance. It does not touch the device yet, call Configure to configure this sensor.

func (*Device) CO2

func (d *Device) CO2() uint32

Returns the CO₂ equivalent value read in the previous measurement.

Warning: this is _not_ an actual CO₂ value. The SGP30 can't actually read CO₂. Instead, it's an approximation based on various other gases in the environment.

func (*Device) Configure

func (d *Device) Configure(config Config) error

Configure starts the measurement process for the SGP30 sensor.

func (*Device) Connected

func (d *Device) Connected() bool

Connected returns whether something (probably a SGP30) is present on the bus.

func (*Device) TVOC

func (d *Device) TVOC() uint32

Returns the total number of VOCs (volatile organic compounds) in parts per billion (ppb).

func (*Device) Update

func (d *Device) Update(which drivers.Measurement) error

Read the current CO₂eq and TVOC values from the sensor. This method must be called around once per second per the datasheet as this is how the sensor algorithm was calibrated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL