Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

CO₂ sensor Forum Discussions

weixiaohalou
Level 2
Level 2
5 questions asked 5 replies posted 10 sign-ins

1. I want to use the serial port to read the concentration data of the sensor. During debugging, I found that it does not seem to work when setting the measurement period. No matter how I set it, its data measurement period is always 60s.I write data to these two registers:

Measurement period configuration registers (MEAS_RATE_H and

MEAS_RATE_L)

Registers MEAS_RATE_H and MEAS_RATE_L define the measurement period used in continuous mode. The

concatenation of MEAS_RATE_H (MSB) and MEAS_RATE_L (LSB) define the period. The concatenated value is

coded as a two’s complement signed short integer (1 bit = 1 s).

Values above 0FFFH are treated as being equal to FFFH (4095 s). Values below 0005H are treated as being equal to

0005H (5 s).

Writing a non-valid value to this field generates a communication error (bit SENS_STS.ICCER set).

Note: When writing to MEAS_RATE_H and MEAS_RATE_L, the new value is not immediately considered by

the device. It is internally latched at the next transition from idle to continuous mode.

ser.write([0x57, 0x2C, 0x30, 0x33, 0x2C, 0x30, 0x36, 0x0A])
ser.write([0x57, 0x2C, 0x30, 0x32, 0x2C, 0x30, 0x39, 0x0A])

  What is the problem with my operation? please help me !

0 Likes
1 Solution
YashM
Moderator
Moderator
Moderator
First question asked 250 sign-ins 100 replies posted

Hi.

Could you please share the python script/code that you have created?

Thanks

View solution in original post

0 Likes
3 Replies
YashM
Moderator
Moderator
Moderator
First question asked 250 sign-ins 100 replies posted

Hi

May I know which host MCU are you using here?

Also, what does the below 2 command does/mean?

ser.write([0x57, 0x2C, 0x30, 0x33, 0x2C, 0x30, 0x36, 0x0A])
ser.write([0x57, 0x2C, 0x30, 0x32, 0x2C, 0x30, 0x39, 0x0A])

Thanks

0 Likes

Hello, I haven't used a host MCU yet, but I just connect the sensor to the computer through USB, and use the serial library in python to read and write. These two lines of code are to write the high and low bits of the measurement period register, so as to set His cycle, I uploaded the description of the register in the attachment.

0 Likes
YashM
Moderator
Moderator
Moderator
First question asked 250 sign-ins 100 replies posted

Hi.

Could you please share the python script/code that you have created?

Thanks

0 Likes