STHS34PF80 - Clarify what is presenceVal cm^-1

STHS34PF80 board - I’m experiment with mainly detecting a presence,
human or other, e.g. animals – not moving.

ARDUINO – One of the return value from Example1_BasicReadings.ino is presenceVal cm^-1 (Serial.print(presenceVal):wink:

My question:

What does values of presenceVal represent?

(I check the library and source code, but still I’m not sure or clear the what it is)

Thanks

I do not have one of these to check with but I would imagine this value quantifies how much of a presence is detected in front of the sensor?

Good guess, though from testing, I may sit, not moving and the values are changing from ~500 to 1500. I was thinking that presense will be represented by 0 or 1 (too simple..), but must be other reason(s) for presence range.

I hoped somebody from SparkFun will responed. Oh well.

I confess that everything I know about this sensor, its very existence included, was learned this morning after reading this thread. But it does need to be said that this is a sensor that can be used in detecting presence & movement but it is not a person counting machine. I’m reminded of the need for passenger occupancy determination for automotive airbag deployment, I think they’re usually weight/load sensing in the seats, and there must be some reasons they didn’t use these…

But it looks to me like cm^-1 is the primary sensor output and you use those values to calibrate to your expected presence types & environment. I believe the non-zero ones you see are what we call noise and, while I can’t say what an expected range for this sensor and your ambient presence should be, it’s normal for there to be some and maybe a lot. It’s pretty much the same as that sound when turning up the stereo real loud with the track paused or what you hear between AM radio stations. However, in checking the hookup guide, we find this clip which seems to suggest a swing of a few thousand is expected and idling at -500 to 1500 might be normal.

example-basic
From Basic Example - Hookup Guide - SparkFun Human Presence and Motion Sensor - STHS34PF80

Thanks. I have no problems with the hookup and usage. I was just trying to understand what does presenceVal represent. In the sample code the device returns 0 or 1 when a presence is detected, if 1, it check/print the value of presenceVal – and I was not clear what it means.

I understand that you were trying speculate, which is fine.

I’ll do more testing to get a better understanding.

Thanks

To add an example: The device detect presence, and the presenceVal is e.g. 800 or 1200, what does it mean from practical or usage prespective.

cm^-1 is wavenumber; SparkFun_STHS34PF80_Arduino_Library/examples/Example1_BasicReadings/Example1_BasicReadings.ino at main · sparkfun/SparkFun_STHS34PF80_Arduino_Library · GitHub has a blurb stating “Prints raw IR presence (cm^-1), if motion was detected, and temperature in degrees C.”

and the src file(s) have

“/// @brief This function returns the raw output value that represents
/// the amount of infrared radiation emitted from the objects inside
/// the field of view. It is composed of TOBJECT_H and TOBJECT_L (0x27
/// and 0x26). The value is expressed as 2’s complement
/// @param val Raw value from the TObject registers
/// @return Error code (0 no error)
int32_t STHS34PF80::getTObjectRawValue(int16_t *val)
{
return sths34pf80_tobject_raw_get(&sensor, val);
}”

at line 372.

Perusing the rest of that file with searching in-page for ‘presence’ will show you the other functions/pointers that together create the processing pipeline…it’s a bit convoluted but there are thresholds, hysteresis, ‘shock’ (quick change), etc that are combined into a scaled arbitrary variable that is then calculated/output

Thanks. I think “..he amount of infrared radiation emitted from the objects inside
/// the field of view..” is good info.

1 Like

If you didn’t know, these detect infrared light which corresponds to heat. You can perform a similar detection when sunlight instantly warms your skin. Snakes are known to use direct thermal sensing to strike prey at night. But, compared to visible light, it’s pretty low resolution and the range isn’t very long. That’s actually what makes it well suited for presence detection: there’s something warm and big and close that wasn’t there before.

Similar sensors are tuned for IR flame/combustion detection in fire alert systems in places like warehouses and libraries where usual detectors that need to wait for smoke and environmental heat isn’t fast enough and suitable sightlines exist. I’d imagine they also see use in places where fire risk exists but heat and smoke is expected under normal operation like commercial bakeries, fume hoods, and machine shops. Orbital rocket launches are impossible to hide because the plume of fire to get there is so unavoidably big and hot.

1 Like

Of course it is IR sensore; I used few in past . The original question was related to the returned value of presensceVal.

I think the answer by TS-Russel made sense in this context.