SENSIRION Reading sensor information Application Note

Page 1
Application Note for I2C Flow and Differential Pressure Sensors
Reading scale factor, measurement unit and tracking information
Summary
Sensirion provides I2C sensors measuring flow or differential pressure. These sensors are based on the same thermal flow sensor chip, called SF04. The chip contains an EEPROM memory cell, where amongst others
1. Introduction
certain sensor information as scale factor, measurement unit and tracking information is stored. The present application note explains how to read out this sensor information.
The output of sensors with a SF04 c hip inside is a 16bit integer number provided by an I physical value of the measurement, one ha s to divide the output by a scale factor and the measurement unit has to be known. Scale factor and measurement unit are defined during calibration and cann ot be changed later on. During calibration, the information about the used sc ale factor an d measurement unit is written to the EEPROM, which can
2
C interface. To get the
2. Read EEPROM
For basic sensor communication, please refer to the product datasheet or the user manual “Sensirion I2C Flow and Differential Pressure Sensors”.
To dump the content of the EEPROM starting at a giv en EEPROM address, two steps have to be performed.
1st Step
The internal address register ha s to be set by invoking a set EEPROM address command.
8 Bit Command Code Command
hFA set EEPROM address Important: The EEPROM address is a 12-bit value
followed by additional 4 bits which are not interpreted by
be read out by the user. Furthermore the serial numbers of the flow chip and the sensor as well as sensor name and item number are stored in the EEPROM. With this se nsor information, the production process is fully traceable.
The following chapters describe how to read out sensor information as scale factor, measurement unit and serial number.
the sensor (can be sent as 0). Example: To set the EEPROM address h2B6, the full command string is: 80 FA
2B 60. (hexadecimal, assuming the default I2C address)
2nd Step
Send an I2C header with R/_W=1. After the header with R/_W=1, the sensor system writes the EEPROM word at the actual address to the bus, followed by a CRC byte. The internal address register is automatically increased after each completed word write out. Therefore, if the master continues clocking the SCK line after the CRC byte, the next EEPROM word with corresponding CRC byte is written to the bus, and so on. The master can interrupt EEPROM dumping by not pulling down the DATA line during any acknowledge-related SCK p ulse (NACK).
www.sensirion.com Version 1.0 – June 2009 1/4
Page 2
Application Note: Reading sensor information
1
1
I2C Read EEPROM
123456789 19 2221 2720 23 24 25 26
I2C header (R/_W=0)
10 11 12 13 14 15 16 17
W
Cmd (hFA)
ACK
123456789
S RI2CAdr
I2C header (R/_W=1)
10 1312 19 2221 2711 14 15 16 17 20 23 24 25 2618 28 3130 3629 32 33 34 35
18
ACK
LSByte EEData
ACK
LSByte EEData
ACK
ACK
3. Scaling of Measurement Signal and Unit
To get the physical information from the sensor reading, the scale factor and the measurement unit have to be known. For some standard sensors, this information can be found in the datasheet. For all other sensor s it has to be read from the Sensor internal EEPROM memory.
A series of operations is needed for correct scaling and determination of the measurement signal.
The original calibrated signal read from the sensor is an integer number. The integer value can be converted to the original unit the sensor has been calibrated for. For this the number has to be divided by the sensors ‘scale factor’ which is stored in the EEPROM.
Again, the EEPROM address is composed of an EEPRO M base address and an address offset. To determine the base EEPROM address for actual sensor inform ation, bit <6:4> of User Register (called active configuration field) must be multiplied by h300. Then the Wordadr Offset of following table must be added to that address.
28 3130 3629 32 33 34 35
EEAdr XXX XEEAdrS I2CAdr
ACK
ACK
ACK
Check ByteMSByte EEData
Check ByteMSByte EEData
ACK
ACK
P
NACK
(Example: address of article code
- bit<6:4> of User Register = '010'
-> EEPROM base address = 2 * h300 = h600
-> EEPROM address = h600 + h2E8 = h8E8
-> article code can be found at addresses h8E8 to h8F7)
Wordadr
#Words Description/Format
Offset
h2B6 h2B7
scale factor measurement unit (for coding
see below)
Note: The scale factor and the measurement unit were written to the EEPROM during calibration as information about the used calibration parameters. Scale factor and measurement unit cannot be changed after calibration.
www.sensirion.com Version 1.0 – June 2009 2/4
Page 3
Application Note: Reading sensor information
4
10
6
2
4. Measurement Unit Coding
The 16bit flow unit code includes different types of information:
1. dimensions (e.g. milli, 0.001) (16 possibilities)
2. time base (e.g. per second) (16 possibilities)
3. unit (e.g. standard liter) (32 possibilities)
4. reserved (8 possibilities)
Bit <3:0> (x*1) Dimension Prefix
0 – 2 t.b.d.
3 1e-9 n 4 1e-6 u 5 0.001 m 6 0.01 c 7 0.1 d 8 1 1
9 10 ­10 100 h 11 1000 k 12 1e6 M 13 1e9 G
14 – 15 t.b.d.
Bit <7:4>
(x*16)
Time Base Comment
0 no time base e.g. pressure /
totalized flow 1 per microsecond us 2 per millisecond ms 3 per second s 4 per minute min
5 per hour h 6 per day day
7 – 15 t.b.d.
Bit <12:8>
(x*256)
10 – 15 t.b.d.
20 – 31 t.b.d.
Bit <15:13> (x*8192) are not defined
Examples:
Unit Code
nl/s 8*256 + 3*16 + 3 = 2099 m3/s 8*256 + 3*16 + 11 = 2107
mln/min 0*256 + 4*16 + 5 = 69
hPa 16*256 + 0*16 + 10 = 4106
Volume / Pressure Comment
0 norm liter
(0°C, 1013 hPa)
1 standard Liter
(20°C, 1013 hPa)
2 – 7 t.b.d.
8 liter (liquid) l, typ. liquid flow 9 gram g, typ. liquid flow
16 pascal Pa, pressure 17 bar bar, pressure 18 meter H2O m H2O, pressure 19 inch H2O in H2O, pressure
nl, typically for gas flow
sl, typ. gas flow
5. Tracking information
Some tracking information can be read out from the EEPROM, as the serial number, part name and item number of the sensor.
The EEPROM address is composed of an EEPROM base address and an address offset. To determine the base EEPROM address for general sensor information, bit <2:0> of Read-Only Register 2 (called active config uration field at boot time) must be multiplied by h300. Than the Wordadr Offset of the following table must be added to that address.
www.sensirion.com Version 1.0 – June 2009 3/4
(Example: address of article code
- bit<2:0> of Read-Only Register 2 = '010'
-> EEPROM base address = 2 * h300 = h600
-> EEPROM address = h600 + h2E8 = h8E8
-> article code can be found at addresses h8E8 to h8F7)
Wordadr
Offset
h2E4-h2E7 h2E8-h2F1
h2F2-h2F7 h2F8-h2F9
#Words (16 bit)
Description/Format
serial number chip (h2E4: MSB, h2E7: LSB) Part name Item number serial number product
Page 4
Application Note: Reading sensor information
6. Revision history
Date Version Changes
June 2009 V1.0 Initial Release
Headquarter and Sales Offices
SENSIRION AG Phone: + 41 (0)44 306 40 00 Laubisruetistr. 50 Fax: + 41 (0)44 306 40 30 CH-8712 Staefa ZH info@sensirion.com Switzerland www.sensirion.com
SENSIRION Inc Phone: +1 805-409 4900 Westlake Pl. Ctr. I, suite 204 Fax: +1 805-435 0467 2801 Townsgate Road michael.karst@sensirion.com Westlake Village, CA 91361 www.sensirion.com USA
SENSIRION Korea Co. Ltd. Phone: +82-31-440-9925~27 #1414, Anyang Construction Tower B/D, Fax: +82-31-440-9927 1112-1, Bisan-dong, Anyang-city, info@sensirion.co.kr Gyeonggi-Province, South Korea www.sensirion.co.kr
SENSIRION China Co. Ltd. Phone: +86 755 8252 1501 Room 2411, Main Tower Fax: +86 755 8252 1580 Jin Zhong Huan Business Building, info@sensirion.com.cn/ Postal Code 518048 www.sensirion.com.cn Futian District, Shenzhen, PR China
SENSIRION Japan phone: +81 3-3444-4940 Sensirion Japan Co. Ltd. fax: +81 3-3444-4939 Shinagawa Station Bldg. 7F info@sensirion.co.jp 4-23-5 Takanawa www.sensirion.co.jp Minato-ku, Tokyo, Japan
Find your local representative at: http://www.sensirion.com/reps
www.sensirion.com Version 1.0 – June 2009 4/4
Loading...