2023-11-22 01:32 AM
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:
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.
2023-11-24 03:24 AM
Hi @KD2 ,
Welcome to ST Community!
Can you send to us a complete acquisition with Tmotion, Tpresence and the two flags?
Thanks
2023-11-24 03:56 AM
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!
2023-11-24 07:28 AM
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)
2023-11-27 12:59 AM
@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.
2023-11-30 11:23 PM
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?
2023-12-01 12:55 AM
Hi @Federica Bossi,
Below is datalog with fixed data interpretation. Also in code_snippet.txt there is snippet of code that You asked for.
2023-12-05 06:14 AM
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).