Instructions for Ten in One Air Quality Sensor

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

Instructions for Ten in One Air Quality Sensor
Instructions for Ten in One Air Quality SensorFigure

I. Overview of Communication Protocol

1. Default Communication Parameters

  • Baud Rate: 9600
  • Data Bits: 8
  • Check Bits: None
  • Stop Bit: 1(i.e.9600/8/N/1)
  • Default Device Address: 0x01
  • Response Time:<100ms

2. CRC Check

  • Algorithm: CRC-16/Modbus (Polynomial0x8005)
  • checksum format: 2 bytes, with the high-order bits first (e.g.CRC_H CRC_L).
  • Calculation tool: Refer toCRCToolOr the code in Chapter IX of the specification sheet.

2, Detailed explanation of protocol functions

1. Read device address and firmware version

FunctionObtain the current device address and firmware version number.

Request format (host → sensor)
Byte positiondataExplanation
00xFEBroadcast address (all devices respond)
10x11Function code (read address)
2-50x00Fixed padding
6-7CRCCRC check code

Example command:

FE 11 00 00 00 01 28 06
Response format (sensor → host)
Byte positiondataExplanation
00x01Device address
10x11function code
20x02Data length (2 bytes)
30x12Firmware version (such as0x12=V1.2)
40x01Current address
5-6CRCCRC check code

Example response:

01 11 02 12 01 70 5C


Parse:

  • Firmware Version:V1.2
  • Device address:0x01

2. Modify device address

Function: Change the Modbus address of the device (range1~247).

Request format (host → sensor)
Byte positiondataExplanation
0Current addressOriginal address (such as0x01)
10x06Function code (modify address)
2-40x00Fixed padding
5New addressTarget address (e.g.0x02)
6-7CRCCRC checksum

Example command(modify address to0x02):

01 06 00 00 00 02 08 0B
Response format (sensor → host)

Consistent with the request format, return the modified address confirmation.

Example Response:

01 06 00 00 00 02 08 0B


Explanation: If the response data is the same as the request, it indicates that the modification was successful.

3. Read sensor data

functionRead sensor data from a specified register (supports reading multiple sensors at once).

Request format (host → sensor)
Byte positiondataExplanation
0Device addressLike 0x01
10x03Function code (reading data)
2-3starting addressRegister starting address (high-order)
4-5number of registersNumber of registers to be read
6-7CRCCRC check code

Example Command(Read All 11 Sensor Data):

01 03 00 00 00 0B C5 CD
Response Format (Sensor → Host)
Byte PositionDataDescription
0Device AddressAs 0x01
10x03Function Code
2Data LengthByte Count (Register Count × 2)
3~NSensor DataEach register is 2 bytes long (with the highest bit first)
N+1~N+2CRCCRC check code

Example response(Partial data):

01 03 16 00 96 00 64 00 32 00 30 00 28 00 1E 01 2C 00 0A 00 14 70 5C


Parse:

  • 00 96→ eCO₂ = 150 ppm
  • 00 64→ TVOC = 100 ppb
  • 00 32→ CH₂O = 50 μg/m³
  • Temperature and humidity data:
  • Humidity0x012C→ 300 → 300/100 = 30.0%RH
  • Temperature:0x000A→ 10 → 10/100=0.10 ℃

4. System Parameter Configuration (Advanced Function)

4.1 Read/Set Baud Rate

Register Address: 0x0103(Baud Rate Code See Appendix Table).

Read baud rate request:

01 03 01 03 00 01 CRC


Set baud rate request(set to 115200):

01 06 01 03 00 07 CRC
4.2 Calibration sensor data

Register address:

  • Temperature calibration:0x011D
  • Humidity Calibration:0x011C

Example Command(Temperature Calibration+2.5 ℃):

01 06 01 1D 00 FA 98 73


Explanation:

  • 00 FA→ 250 (i.e. 250/100=2.5 ℃)
  • Negative values need to be converted to complement codes (such as0xFF9C→ -100 → -1.00 ℃).

III. Data Analysis Method

1. Calculation Formula

Sensor TypeFormulaExample
eCO ₂CO₂ = (CO₂_H << 8) + CO₂_L0x0096→ 150 ppm
Temperature温度 = 有符号值 / 1000xFF9C→ -100 → -1.00 ℃
IlluminationLux = (Lux_H << 8) + Lux_L0x01F4→ 500 Lux

2. Symbolic number processing

  • Method 1: Directly convert to a signed integer (such as0xFF9C→ -100).
  • Method 2: If the value is greater than 32767, then真实值 = (原始值 - 65536) / 100.

IV. Precautions

  1. Preheating Time: The VOC module needs to be preheated for at least 3 minutes, and other sensors can be used immediately after power on.
  2. Installation Requirements:
  • Installation height should be ≥ 15cm to avoid ground dust pollution.
  • Avoid high dust (>300 μ g/m ³), oil fumes, or high humidity environments.
  1. Calibration Warning:
  • Advanced functions should be operated with caution, as incorrect modifications may result in abnormal data.
  • The calibration value needs to be adjusted according to the actual environment, and it is recommended to record the factory default value.
  1. CRC Check: All commands must contain the correct CRC, otherwise the device will not respond.

V. Appendix

1. Sensor Register Address Table

Register AddressSensor TypeData Format
0x0000eCO ₂2-byte unsigned integer (ppm)
0x0001TVOC2-byte unsigned integer (ppb)
0x0002CH ₂ O2-byte unsigned integer (μ g/m ³)
0x0003PM2.52-byte unsigned integer (μ g/m ³)
0x0004Humidity2-byte (true value x 100)
0x0005Temperature2-byte (true value x 100)
0x0006PM102-byte unsigned integer (μ g/m ³)
0x0007PM1.02-byte unsigned integer (μ g/m ³)
0x0008Illumination2-byte unsigned integer (Lux)
0x0009MCU Temperature2-byte (true value x 100)
0x000ANoise2-byte unsigned integer (dB)

2. Baud rate code table

codeBaud rate
01200
12400
24800
39600
419200
538400
657600
7115200

3. CRC calculation code (C language example)

uint16_t CRC16_Check(const uint8_t *pushMsg, uint8_t usDataLen) {
    uint8_t uchCRCHi = 0xFF, uchCRCLo = 0xFF;
    uint8_t uIndex;
    while (usDataLen--) {
        uIndex = uchCRCLo ^ *pushMsg++;
        uchCRCLo = uchCRCHi ^ auchCRCHi[uIndex];
        uchCRCHi = auchCRCLo[uIndex];
    }
    return (uint16_t)(uchCRCHi << 8 | uchCRCLo);
}

Product purchase:https://item.taobao.com/item.htm?ft=t&id=675637355531

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.