Skip to content

Activity

Kravitz Lab edited this page Dec 9, 2025 · 10 revisions

Activity monitoring with the STHS34PF80 human presence sensor on FED4

Overview

FED4 has an ST STHS34PF800 to monitor whole-cage activity. The STHS34PF800 is an infrared (IR) presence and motion sensor from ST Microelectronics. It detects motion in the 5–20 µm IR range, has an 80-degree field of view, and supports output data rates from 0.25 to 30 Hz. The sensor cannot see through plastic, so it will not be influenced by activity in neighboring cages, or humans moving around in the room with the cages. In validation tests of the sensor, it requires mouse locomotion >~2cm/s to trigger, so it is a measure of locomotion, and not fine in-place movements.

Example recording of in-cage motion with FED4 over 72 hours: image


Sampling strategy

While in theory, FED4 can record and log activity data at 30Hz, this will keep the ESP32 processor on at full strength, and the FED4 device will last ~2 days before running out of battery charge. To optimize run times on battery power, we explored a sub-sampling strategy that queries the sensor less frequently. We also plan to monitor activity as the animal completes behavioral tasks on FED4, so we don't want to dominate the ESP32 processor with activity monitoring. Instead, we want to prioritize behavioral tasks and have the STHS34PF800 sample activity at a low rate in the background.


Optimization problem

We have to optimize two parameters: sampling rate (how often we query the STHS34PF800), and the logging rate (how often we aggregate data for logging on the SD card). For the logging rate, we chose a fixed rate of 5-minutes per bin. We are interested in overall activity and circadian patterns of mice across multiple days, not in fine-grained movement data that would require video. Based on prior experience, we decided that 5 minute bins was reasonable.

We also wanted to optimize the sampling rate to sample as infrequently as possible (ie: query the STHS34PF800 as little as possible), while still maintaining a good representation of the average mouse activity in every 5 minute bin. To choose a sampling rate, we recorded a "ground truth" dataset of a mouse, recorded with FED4 with a 2s sampling and logging rate. We then artificially downsampled to simulate coarser sampling intervals (4 to 30 seconds). Each decimated dataset was rebinned into 5-minute averages and compared to the full-resolution baseline.


Results

The 5-minute averaged motion data were robust to reducing sampling frequency, especially up to 10s between samples. Even when sampling every 12–20 seconds, the major activity peaks and day–night structure remained evident, though with more variability. Below are the correlations between decimated datasets for 4, 10, 22, and 30s between samples.
image image image image

This plot shows is the drop off in correlation with the 2s sampling rate with longer sampling times.

image

Conclusions

We decided that a 10-second sampling interval with a 5-minute logging bin width preserves the important structure of the motion signal while reducing the number of times the motion sensor is queried. This reduces both data storage size and power drain, which is critical for multi-day activity monitoring with FED4.


Power consumption measurements

We used an Otti Arc to monitor power usage with a 10-second sampling interval and a 5-minute logging bin width, finding that FED4 consumes an average of ~13mA. The short spikes in the graph below reflect activity measurements every 10s, and the longer spike is an SD card write operation. At sleep (low baseline), FED4 averages ~11mA. Overall this should produce a battery life of ~2 weeks for activity monitoring.

image

Clone this wiki locally