Skip to main content
Visitor II
November 22, 2023
Question

STHS34PF80 IR Sensor Performance in Continuous Mode

  • November 22, 2023
  • 3 replies
  • 4418 views

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.

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    November 24, 2023

    Hi @KD2 ,

    Welcome to ST Community!

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

    Thanks

    KD2Author
    Visitor II
    November 24, 2023

    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!

    Technical Moderator
    November 24, 2023

    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)

    Technical Moderator
    December 1, 2023

    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?

    KD2Author
    Visitor II
    December 1, 2023

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

    Technical Moderator
    December 5, 2023

    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).