Datasheet

www.sensirion.com Version 0.9 August 2017 7/15
6 Operation and Communication
The SGP30 supports I
2
C fast mode. For detailed information on the I
2
C protocol, refer to NXP I
2
C-bus specification
8
. All
SGP30 commands and data are mapped to a 16-bit address space. Additionally, data and commands are protected with a
CRC checksum to increase the communication reliability. The 16-bit commands that are sent to the sensor already include a
3-bit CRC checksum. Data sent from and received by the sensor is always succeeded by an 8-bit CRC.
In write direction it is mandatory to transmit the checksum, since the SGP30 only accepts data if it is followed by the correct
checksum. In read direction it is up to the master to decide if it wants to read and process the checksum.
SGP30
Hex. Code
I
2
C address
0x58
Table 8 I
2
C device address.
The typical communication sequence between the I
2
C master (e.g., a microcontroller in a host device) and the sensor is
described as follows:
1. The sensor is powered up, communication is initialized
2. The I
2
C master periodically requests measurement and reads data, in the following sequence:
a. I
2
C master sends a measurement command
b. I
2
C master waits until the measurement is finished, either by waiting for the maximum execution time or by
waiting for the expected duration and then poll data until the read header is acknowledged by the sensor
(expected durations are listed in Table 10)
c. I
2
C master reads out the measurement result
6.1 Power-Up and Communication Start
The sensor starts powering-up after reaching the power-up threshold voltage V
POR
specified in Table 6. After reaching this
threshold voltage, the sensor needs the time t
PU
to enter the idle state. Once the idle state is entered it is ready to receive
commands from the master.
Each transmission sequence begins with a START condition (S) and ends with a STOP condition (P) as described in the I
2
C-
bus specification.
6.2 Measurement Communication Sequence
A measurement communication sequence consists of a START condition, the I
2
C write header (7-bit I
2
C device address plus 0
as the write bit) and a 16-bit measurement command. The proper reception of each byte is indicated by the sensor. It pulls the
SDA pin low (ACK bit) after the falling edge of the 8th SCL clock to indicate the reception. With the acknowledgement of the
measurement command, the SGP30 starts measuring.
When the measurement is in progress, no communication with the sensor is possible and the sensor aborts the
communication with a XCK condition.
After the sensor has completed the measurement, the master can read the measurement results by sending a START
condition followed by an I
2
C read header. The sensor will acknowledge the reception of the read header and responds with
data. The response data length is listed in Table 10 and is structured in data words, where one word consists of two bytes of
data followed by one byte CRC checksum. Each byte must be acknowledged by the microcontroller with an ACK condition for
the sensor to continue sending data. If the sensor does not receive an ACK from the master after any byte of data, it will not
continue sending data.
After receiving the checksum for the last word of data, an XCK and STOP condition have to be sent (see Figure 9).
The I
2
C master can abort the read transfer with a XCK followed by a STOP condition after any data byte if it is not interested in
subsequent data, e.g. the CRC byte or following data bytes, in order to save time. Note that the data cannot be read more
than once, and access to data beyond the specified amount will return a pattern of 1s.
6.3 Measurement Commands
The available measurement commands of the SGP30 are listed in Table 10.