Each night I start the ESP32 recording the movement data from the 2 pads that are under the mattress. The ESP32 has ADCs to collect the analog measurements and sends the movement data to a debian based SQLite db wirelessly every minute.
When I wake up, I register my perceived sleep quality (from 0 to 5).
I've been gathering the data for several months and plan to run it through ML/scipy to see what insights I can glean.
The setup is very cheap - the mattress pads can be obtained for next to nothing at thrift stores.