About VOC-LP Tag
The VOC-LP Tag measures total volatile organic compounds (TVOC) in the air with the SGPC3 sensor from Sensirion. It communicates over the I²C bus at address 0x58. Unlike the VOC Tag with the SGP30 sensor, it reports TVOC only.
caution
The sensor needs about 24 hours of continuous operation before its readings are reliable; until then, it can report 0. Do not switch it off between measurements: after every power-up, it needs the 24 hours again. The SDK keeps the sensor powered and lets it measure every 30 seconds.
Features
- Air quality sensor SGPC3 (Sensirion)
- Total volatile organic compounds (TVOC): 0 to 60 000 ppb
- Communication using the I²C bus, address 0x58
Firmware
The SDK reads the tag with twr_tag_voc_lp_init() and twr_tag_voc_lp_get_tvoc_ppb(). The Air Quality Monitor firmware publishes the value as node/{id}/voc-lp-sensor/0:0/tvoc.
VOC-LP Tag Code Example
#include <application.h>
static twr_tag_voc_lp_t voc_lp;
void voc_lp_event_handler(twr_tag_voc_lp_t *self, twr_tag_voc_lp_event_t event, void *event_param)
{
(void) event_param;
if (event == TWR_TAG_VOC_LP_EVENT_UPDATE)
{
uint16_t tvoc;
if (twr_tag_voc_lp_get_tvoc_ppb(self, &tvoc))
{
int value = tvoc;
twr_radio_pub_int("voc-lp-sensor/0:0/tvoc", &value);
}
}
}
void application_init(void)
{
twr_radio_init(TWR_RADIO_MODE_NODE_SLEEPING);
twr_tag_voc_lp_init(&voc_lp, TWR_I2C_I2C0);
twr_tag_voc_lp_set_event_handler(&voc_lp, voc_lp_event_handler, NULL);
twr_tag_voc_lp_set_update_interval(&voc_lp, 5 * 60 * 1000);
}