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 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.
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.
“/// @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
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.