Inspiration
Buying a mattress is surprisingly difficult because firmness ratings are subjective. One company's "medium firm" might feel completely different from another's, and it's hard to compare mattresses without physically trying them.
We wanted to create a way for people to measure and compare mattress firmness using something they already own: their phone.
What it does
GoldiMattress is a web app that uses a smartphone's accelerometer to measure how a mattress responds to an impact.
We attach a phone to a weighted rig and drop it onto a mattress from a controlled height. The app records the acceleration during the drop, initial impact, and rebound.
Using this data, we can analyze relative firmness and springiness, with the goal of generating scores that make different mattresses easier to compare.
How we built it
We built GoldiMattress as a mobile-friendly web application using TypeScript and the browser's motion sensor APIs.
The app collects acceleration data directly from an iPhone, allowing users to record multiple drops without installing a separate app. We also developed a weighted testing setup to make the impacts more consistent than manually dropping a phone or sitting on a mattress.
We used physics-based calculations and signal processing to identify impacts, examine rebound behavior, and investigate how drop height affects the measurements. We also added raw data export so we could analyze recordings and improve our approach.
Challenges we ran into
Our biggest challenge was getting consistent measurements.
Initially, we experimented with measuring mattress response using body movements, but the results varied too much between attempts. We switched to a weighted drop rig to make the experiment more repeatable.
Even with the rig, small differences in release height and how the plate landed affected the results. We also discovered limitations in the iPhone's accelerometer sampling rate, which made it difficult to accurately capture short impact events.
Another challenge was distinguishing actual mattress behavior from noise, secondary impacts, and movement of the rig itself.
Accomplishments that we're proud of
We're proud that we were able to turn an idea into a working physical prototype that collects real measurements.
We built a web app that accesses iPhone motion sensors, designed a weighted testing method, and successfully recorded acceleration data from repeated mattress impacts.
We also learned how to identify problems in our own measurements instead of assuming the initial results were accurate. That helped us improve both the hardware setup and our approach to processing the data.
What we learned
We learned that collecting sensor data is only one part of building a useful measurement system. Making sure the measurements are consistent and meaningful is just as important.
We also learned more about accelerometers, free fall, impact detection, signal processing, and the limitations of collecting high-speed motion data through a web browser.
One important takeaway was that a stronger impact doesn't necessarily mean a firmer mattress. The drop height, mass, and release conditions also affect the result, so those factors need to be accounted for when comparing measurements.
What's next for goldimattress-hacktx2026
Our next step is improving the scoring algorithm so that GoldiMattress can generate firmness and springiness ratings from multiple drops.
We also want to automatically estimate drop height using free-fall duration, detect and reject inconsistent measurements, and calibrate the results against reference surfaces.
Longer term, we'd like to build a shared database of mattress measurements so users can compare different mattresses using consistent, objective data rather than relying only on manufacturer descriptions and subjective reviews.
Built With
- accelerometer
- css3
- device-motion-api
- github
- html5
- javascript
- physics
- sensor-data
- signal-processing
- typescript
Log in or sign up for Devpost to join the conversation.