cancel
Showing results for 
Search instead for 
Did you mean: 

STHS34PF80 – How to achieve 4 m detection range on Linux

jeena
Associate

I am using the STHS34PF80 IR presence/motion sensor on a Linux platform . According to the datasheet, the sensor can detect human presence up to 4 m (for a 70×25 cm² object).Currently, my configuration is as follows:

echo 1 > /sys/bus/i2c/devices/3-005a/iio:device5/algo_reset
echo 4 > /sys/bus/i2c/devices/3-005a/iio:device5/sampling_frequency
echo 2 > /sys/bus/i2c/devices/3-005a/iio:device5/lpf
echo 3 > /sys/bus/i2c/devices/3-005a/iio:device5/sensitivity
echo 150 > /sys/bus/i2c/devices/3-005a/iio:device5/threshold
echo 50 > /sys/bus/i2c/devices/3-005a/iio:device5/hysteresis
echo 1 > /sys/bus/i2c/devices/3-005a/iio:device5/scan_elements/in_temp_y_en
echo 1 > /sys/bus/i2c/devices/3-005a/iio:device5/events/in_temp0_thresh_rising_en
echo 0 > /sys/bus/i2c/devices/3-005a/iio:device5/buffer0/enable
echo 256 > /sys/bus/i2c/devices/3-005a/iio:device5/buffer0/length
echo 1 > /sys/bus/i2c/devices/3-005a/iio:device5/buffer0/enable

However, in practice, I am only getting a detection range of about 2 ft (~0.6 m).

Could you please advise:

Which parameters should be adjusted to achieve detection up to 4 m?

Are there recommended values for threshold, hysteresis, LPF_P, LPF_P_M, or sensitivity to maximize range?

1 REPLY 1
Federica Bossi
ST Employee

Hi @jeena ,

You can try lowering the presence threshold.
For tpresence, the driver provides the following properties: lpf, threshold, hysteresis, sensitivity, and algo_reset.
By writing to these sysfs property files, you can modify the relevant parameters.

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.