Datasheet

www.sensirion.com
Version 1.0 July 2020 D1
11/19
4 Digital Interface Description
4.1 General Considerations
For driver integration incl. utilization of Sensirion’s VOC Algorithm, please refer to the application note SGP40 Driver Integration
(for Dedicated I
2
C Hardware). All SGP40 commands consist of two bytes (16 bits). The commands must not be followed by a
CRC. Additionally, data sent to and returned from the sensor is transferred in packets of two bytes (16 bits) followed by a 1-byte
(8 bit) CRC.
4.2 I
2
C Address
The sensor’s I
2
C address is 89 (decimal; hex.: 0x59). The I
2
C header is formed by the I
2
C address followed by a read or write
bit.
4.3 I
2
C Voltage Levels
The sensor’s interface is compatible with 1.7–3.6 V I
2
C bus voltage levels depending on the supply voltage level.
4.4 I
2
C Protocol Speed
The sensor supports I
2
C “standard-mode” and “fast-mode”, with a maximum clock frequency of 100 or 400 kHz, respectively
(see footnote 9 on page 5).
4.5 I
2
C Sequences
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 and visualized in Figure 10:
1. The sensor is powered up
2. The I
2
C master periodically calls the measurement command 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 8).
c. I
2
C master reads out the measurement result.
With the acknowledgement of the measurement command, the SGP40 starts measuring. When the measurement is in progress,
no communication with the sensor is possible and the sensor aborts the communication with a NACK condition. After the sensor
has completed the measurement, the master can read the measurement results by sending 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 8 and is
structured in data words, where one word consists of two bytes of data (most significant bit first) followed by an one-byte CRC
checksum. Each byte must be acknowledged by the master 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, a NACK and STOP condition have to be sent (see Figure 10). The I
2
C
master can abort the read transfer with a NACK 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 high bits.
Figure 10 Possible I
2
C command sequences for communicating with the SGP40. Dark areas indicate that the sensor controls the SDA (data)
line. First, the I
2
C master sends the write header writing a 16-bit command, potentially followed by two words of data with CRC bytes. For
reading the measured data, the I
2
C master sends the read header and receives one word of data with CRC byte.