You are on page 1of 5

SMP3011 I2C Digital Pressure Sensor

-- Communication protocol command description


The Model SMP3011 I2C Digital Pressure Sensor communicates externally using the I 2C bus
protocol. All data communication starts from the MSB, and the default 7bit I 2C device address is
0x78. The SMP3011 acts as a slave to the I2C, and the master can communicate with it using
commands in the following formats.

First, send a write command


The 0xF0 in the write command indicates that the default 7 bits I 2C device address is 0x 78, and
the last 1 bit is 0, indicating a master write operation.

Figure 1 –
Two, wait Write Command

After the write command is sent, it is necessary to wait for some time before sending the read

command because it takes some time for the entire measurement to be completed internally.

The waiting time depends on the settings of [13:11] pressure oversampling rate of OTP (Address:

0x14) and [15:14] temperature oversampling rate of OTP (Address: 0x14). Duration of waiting =

tP + tT, compared to Tables 1 and 2 in the Appendix.

The waiting time does not need to be calculated, and whether the acquisition has been

completed can be judged by continuously reading the IIC status word.

III. I2C interface timing


Figure 2 – I2C
Interface Timing

● START Condition
SDA transitions from the idle high state to the low state while SCL remains high. If the Start
Condition is sent repeatedly during the transmission, the transmission will start again without an
intermediate stop bit.

●Address Bits
During the transfer of the first byte, the first 7-bits provide the specified address of the
device, which is 0x78 by default. The device at this address will answer the communication.

●Read/Write Direction Bit


During the transmission of the first byte, the last bit indicates the direction of
communication. 0 indicates a master write operation and 1 indicates a master read operation. If
the master device requests to read the slave device, the master device will control the Sda line to
output data in the following byte.

●Data Byte
All other bytes, except the address and read/write bits, are transmitted on the SDA as data
bytes for communication.

●Acknowledge or Not Acknowledge Bit


The acknowledge bit is used to tell the sender that a byte has been received. Each byte,
including the address byte, is acknowledged when the device receives the data. At this time, the
bus device sending the data stops driving the Sda line and the Sda line is pulled high. The
receiving device does not need to do anything to answer a byte. In response to a byte, the
receiving device needs to pull SDA low.
A receiving slave does not need to acknowledge if the slave is not the addressed device or if
the device cannot process the received byte. The master does not answer if the master is
receiving and wants to end the communication. If no answer is encountered. The device needs to
generate a stop bit to transmit data.

●Stop Condition
SDA transitions from a low state to a high state and SCL remains high. End I 2 C
communication.

4. Reading
The calibration data can be read only when the time interval between the write command and
the read command is greater than the measured time. The reading format is shown in Figure 2.
The 0xF1 in the read command indicates that the default 7 bits I2C device address is 0x 78, and
the last 1bit is 1, indicating the read operation of the master device. The read calibration data
consists of 6 bytes, including 1 byte of status word, 3 bytes of bridge calibration value and 2 bytes
of temperature calibration value.

BridgeDat BridgeDat BridgeDat TempDat TempDat


S 0XF1 A Status A A A A A N P
[23:16] [15:8] [7:0] [15:8] [7:0]

Figure 3 I2C Read out 5 bytes of calibrated bridge and temperature values

Any response from the I2C interface starts with a status byte, followed by data, which is
returned based on the previous instruction. If the I 2C read command is repeated, the same data
will be read multiple times. If the next command is not an I 2C read instruction, the previous data
is invalid.

V. Conversion

Figure 4 – 24 bitAD
Output Percentage

1. After reading the calibration data, it is necessary to make a simple conversion of the
unsigned number in percentage form.
For ease of understanding, we assume that the calibration data read is: 0x04 0x9B 0xB0 0xC5
0x56 0 xAA
0x04 is the status word, and Bit5 is 1, indicating that I2C is busy recently and needs to wait for a
period of time. If Bit5 is 0, the device is not busy and the data can be read. For a detailed
description of each bit of the status word, see the Appendix.
0x9B 0 xB0 0 xC5 Three bytes are bridge calibration values
0x56 and 0xAA are the temperature calibration values

2. Bridge calibration value conversion: Convert 0x9B 0xB0 0xC5 into decimal number and convert
it into 10203333. Since the read calibration data is expressed in the form of percentage, this
percentage is numerically equal to the ratio of the converted decimal number to the maximum
value (16777214) of the 24-bit unsigned number. Therefore, the following calculation can be
made when converting the percentage.
10203333/16777216*100%=60.8166%
Product output: 15% ~ 85%
This calculation assumes a range of 20 Kpa-120Kpa for calibration
So the output pressure value = [ (60.8166% -15%)/70%] * (120-20) + 20 = 85.45229 Kpa

3. Conversion of temperature calibration value: Convert 0x56 0xAA into decimal number and
convert it into 22186. Since the read calibration data is expressed in the form of percentage,
which is numerically equal to the ratio of the converted decimal number to the maximum value
(65535) of 16bits unsigned number, the following calculation can be made when converting the
percentage:
22186/65536*100%=33.85%
The calibration range of temperature is -40 ℃ — 150 ℃, so the calibration value = (150 — (-40))
* 33.85% — 40 = 24.32 ℃

Appendix
Table 1 Comparison between pressure oversampling rate and measurement time
OSR _ Pressure [13:11] (binary) Corresponding Measurement time
oversampling ratio tP(ms)
000 32768 203
001 16384 105
010 8192 56
011 4096 31
100 2048 19
101 1024 13
110 512 10

Table 2 Comparison between temperature oversampling rate and measurement time


OSR _ Temperature [15:14] (binary) Corresponding Measurement time
oversampling ratio tT(ms)
00 2048 19
01 4096 31
10 8192 56
11 16384 105

Table 3 Status Byte Bit Description


Bit Meaning Description

Bit7 Reserved Fixed to 0

Bit6 Power indication 1 Device power-on (VDDBon); 0 Device


power-down

Bit5 Busy indication 1 device is busy, indicating that the data


required to be read by the last I2C command
is not yet valid. If the device is busy, the new
command will not be processed. 0 indicates
that the data requested by the last I 2C
command is ready to be read

Bit4 Reserved Fixed to 0

Bit[3] Work Status (Mode Status) 0 NOR mode


1 CMD mode
Bit2 Memory data integrity 0 indicates that the OTP Memory Data
indication Integrity Test (CRC) passed,

(Memory integrity/error flag) 1 indicates that the integrity test failed.


The test for data integrity is only calculated
once during the power-on procedure (POR),
so the new CRC value that is written can
only be used after the next POR.

Bit1 Reserved Fixed to 0

Bit0 Reserved Fixed to 0

You might also like