cancel
Showing results for 
Search instead for 
Did you mean: 

Inquiry Regarding STHS34PF80 IR Sensor Performance in Continuous Mode

KD2
Associate II

Hello,
We are currently in the process of developing firmware for a device that contains the STHS34PF80 IR Sensor.
At present, we have decided to use the continuous mode of this sensor, and we would like to seek clarification on its behavior under certain conditions.
The current flow of our device firmware is as follows:
1. STHS init
2. STHS continous mode with given frequency
3. Check DRDY bit
4. If DRDY then read FUNC_STATUS register

Points 3 and 4 are enclosed within a while loop.
We have observed that when the frequency of the continuous mode is set to a higher range, such as 15-30Hz, the sensor functions correctly. It promptly detects the presence and motion of objects, and when an object is removed from the sensor's field of view, the presence and motion flags are cleared almost instantly.
However, when we set a lower frequency, such as 1-2Hz, we notice a significant delay in the detection of presence and motion. It takes approximately 3-5 seconds for the sensor to detect an object, and it requires 10-15 seconds to clear the flags when the object is no longer within the FOV of the sensor.

Our inquiry is whether this behavior is expected, or if there are additional settings or considerations that we may have overlooked.

For your reference, the values we have configured for these tests are as follows:

avg_t_sel = AVG_T_SEL_8
avg_tmos_sampls = AVG_TMOS_SAMPLS_32
presence_threshold = 0xC8
motion_threshold = 0xC8
tamb_threshold = 0x0A
hyst_motion_threshold = 0x32
hyst_presence_threshold = 0x32

If there are any specific configurations or adjustments we should consider to optimize the performance of the sensor at lower frequencies, your assistance would be invaluable.

7 REPLIES 7
Federica Bossi
ST Employee

Hi @KD2 ,

Welcome to ST Community!

Can you send to us a complete acquisition with Tmotion, Tpresence and the two flags?

Thanks

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Could you provide more details on what you're looking for in a complete acquisition with Tmotion, Tpresence, and the two flags? Are you requesting a code snippet for reading the results? Additionally, when you mention Tmotion, are you referring to the motion threshold?

Thanks!

Hi @KD2 ,

Can you collect a datalog (e.g., .csv, txt) during presence and absence detection and attached it here?

We want to see the acquisition at low frequency of Tobject (26-27h), Tpresence (3A-3Bh) and Tmotion(3C-3Dh) during the event that you described. Please insert in the datalog also the generated flags in the data log (PRES_FLAG and MOT_FLAG)

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

@Federica Bossi,
I have created a datalog, with my hand as an obstacle within the FOV of sensor. The motion flag is consistently set but never cleared. I added events when I put obstacle and take it away. Additionally, I have attached a thermal image, FLIR00030.bmp, capturing the sensor FOV taken by a thermal imaging camera.
I have reviewed my code to ensure there are no errors related to flag reading. I read `STHS_FUNC_STATUS` register and I assign values to various flags.

Federica Bossi
ST Employee

Hi @KD2 ,

We have analyzed the datalog and we have found a wrong interpretation of the data from your code: the data is expressed in int16 while you converted it as uint16. Please fix this to see reasonable numbers in Tobj, Tpresence and Tmotion.
Instead, about the wrong flags, can you send to us a snip of the code that you use to initialize and read the data?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Federica Bossi,
Below is datalog with fixed data interpretation. Also in code_snippet.txt there is snippet of code that You asked for.

Federica Bossi
ST Employee

Hi @KD2 ,

Looking at the data, we have seen that since the hand near the sensor produces a very high signal and the movement is fast, the Tmotion signal, after the passage, is below the default threshold value. Since the motion algorithm uses the absolute value of Tmotion, even the negative values are higher than the default threshold. Therefore, you have to tune the algorithm parameters for the application. In this case, for the passage of a hand near the sensor, you must increase the threshold value (e.g., 2000LSB).

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.