Add documentation for SGP30 eCO2 and TVOC sensors (#308)

* Add documentation for SGP30 eCO2 and TVOC sensors

* Fixed image path and identation error;

* Fixet bullet block

* Updated SGP30 documentation for configuring Temperature and Humidity compensation sources; Removed uptime sensor

* Compress sgp30.png

* Fix build errors

* Remove uptime mention


Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
Nad 2019-10-19 21:21:22 +02:00 committed by Otto Winter
parent d8d5e81a7d
commit 34f6817423
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
5 changed files with 106 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

105
components/sensor/sgp30.rst Normal file
View File

@ -0,0 +1,105 @@
SGP30 CO₂ and Volatile Organic Compound Sensor
==============================================
.. seo::
:description: Instructions for setting up SGP30 CO₂eq and Volatile Organic Compound sensor
:image: sgp30.png
The ``sgp30`` sensor platform allows you to use your Sensiron SGP30 multi-pixel gas
(`datasheet <https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/0_Datasheets/Gas/Sensirion_Gas_Sensors_SGP30_Datasheet.pdf>`__) sensors or the SVM30 breakout-boards (`product page <https://www.sensirion.com/en/environmental-sensors/gas-sensors/multi-gas-humidity-temperature-module-svm30/>`__) with ESPHome.
The :ref:`I²C Bus <i2c>` is required to be set up in your configuration for this sensor to work.
.. figure:: images/eco2-tvoc.png
:align: center
:width: 80.0%
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: sgp30
eco2:
name: "Workshop eCO2"
accuracy_decimals: 1
tvoc:
name: "Workshop TVOC"
accuracy_decimals: 1
address: 0x58
update_interval: 5s
Configuration variables:
------------------------
- **eco2** (**Required**): The information for the CO₂eq. sensor.
- **name** (**Required**, string): The name for the CO₂eq sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **tvoc** (**Required**): The information for the total Volatile Organic Compounds sensor.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **address** (*Optional*, int): Manually specify the i^2c address of the sensor.
Defaults to ``0x58``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
Advanced:
- **baseline** (*Optional*, int): The baseline value for the unit, for calibration
purposes. See :ref:`sgp30-calibrating` for more info.
- **compensation** (*Optional*): The block containing sensors used for compensation.
- **temperature_source** (*Optional*, :ref:`config-id`): Give an external temperature sensor ID
here. This can improve the sensor's internal calculations.
- **humidity_source** (*Optional*, :ref:`config-id`): Give an external humidity sensor ID
here. This can improve the sensor's internal calculations.
.. _sgp30-calibrating:
Calibrating Baseline
--------------------
The SGP30 sensor will re-calibrate its baseline each time it is powered on. During the first power-up this can take upto 12 hours.
For best performance and faster startup times, the current **baseline** needs to be persistently stored on the device before shutting it down and set again accordingly after boot up
that also means that if the sensor reboots at a time when the air is less clean than normal,
the values will have a constant offset and cannot be compared to the values before the last
boot.
To do this, let the sensor boot up with no baseline set and let the sensor calibrate itself. After around 12 hours you can then view the remote logs on the ESP. The next
time the sensor is read out, you will see a log message with something like ``Current eCO2 & TVOC baseline: 0x44D4``.
Now set the baseline property in your configuration file like so with the value you got
via the logs:
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: sgp30
# ...
baseline: 0x44D4
The next time you upload the code, the SGP30 will be continue its operation with this baseline and you will get consistent values.
Please note that Sensirion recommends that after around 7 days, the baseline will need to be
re-calibrated because the internal sensor has a slight value drift over time.
See Also
--------
- :ref:`sensor-filters`
- :doc:`dht`
- :doc:`dht12`
- :doc:`hdc1080`
- :doc:`htu21d`
- :apiref:`sgp30/sgp30.h`
- :ghedit:`Edit`

BIN
images/sgp30.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -133,6 +133,7 @@ Sensor Components
SDS011 Sensor, components/sensor/sds011, sds011.jpg
SCD30, components/sensor/scd30, scd30.jpg
SHT3X-D, components/sensor/sht3xd, sht3xd.jpg
SGP30, components/sensor/sgp30, sgp30.jpg
TCS34725, components/sensor/tcs34725, tcs34725.jpg
Template Sensor, components/sensor/template, description.svg
Total Daily Energy, components/sensor/total_daily_energy, sigma.svg