Keep Track Of Your Weight While Sleeping

When the average person looks at a bed, they think about sleeping. Because that’s what beds are for. You cover them with soft, warm cloths and fluffy pillows and you sleep on them. [Peter] is not your average person. He’s a maker. And when he looks at a bed, he thinks about giving it the ability to track his weight.

The IKEA bed has four Chinese-made TS-606 load cells under each foot with custom aluminum enclosures. Each one goes to an HX711 analog-to-digital converter, which offers a 24 bit resolution. These feed an Arduino Nano which in turns connects to a Raspberry Pi via USB to UART bridge. Connecting to the Pi allows [Peter] to get the data onto his home network, where he plots the data to gnuplot.

This smart bed doesn’t just track [Peter’s] weight. It can also track the weight of other people in the house, including his pets. Be sure to check his GitHub for full source code.

36 thoughts on “Keep Track Of Your Weight While Sleeping

    1. Honey, I was reviewing the bed weight numbers from last week when I was away on vacation. It seems like at some point, you seemed to gain an extra 115.62 lbs that then fluctuated by a few pounds or so in both directions for a while……..

  1. I’ve read through the documentation and it’s an interesting concept.
    My complaint with that is 1) privacy. How do you track guests?
    When someone sits down on your bed that is a friend.

    Additionally, I would skip the continuous tracking and do it like every digital scale does it.
    As soon as it registers a weight difference, take a reading for approx. 10 – 15 seconds, wait for the weight to level out and then take the average of that weight.

    With that way you don’t have to poll in rapid succession AND you save on data entries and comparisons.
    You sit down, scale starts to weigh. Cat jumps on top of you, scale goes up and as soon as everything levels out, you take the reading. Take the sum and compare it against all possible combinations.
    GF + you
    GF + Cat
    GF alone
    GF + 2 Cats
    You + Cat
    You alone
    You + 2 Cats

    IF that weight does not match any combination, write an additional entry to show “invalid” data. I.E. a friend and you sitting down on the bed. This way you know when stuff is wrong and you can automatically discard that entry after a day or so.

    And Ooooobsiously you could add IOT stuff to it to message you on your phone when an invalid entry is found and you know your GF should be alone at home …. *rolleyes*, take a picture of your surveillance cameras and of course match it with the facial recognition of your door-bell that rang 20 minutes earlier …. ;-)

    1. How do you propose to detect the change if not for continuous tracking?-)

      Personally I think it’s a better idea to keep more data around (unless storage is an issue) and then post-process the desired values, than to throw away the data right in the data acquisition phase.

      1. Maybe add a switch or some sort of trigger to it? Of course the cells have to track continuous but the data doesn’t need to get looged all the time. Basically as soon as the switch is hit, take the readings, store them, wait to flatten out everything and then take that reading.

        From the website it reads like the Script has to check against all the entries when a value has changed. That could be a bit heavy when it does that i.e. once every minute.

        Another thought:
        How would you keep track of different weights of your bedsheets and stuff like that? Not everything weighs the same. Do you have to reset your level to zero as soon as you changed your sheets?

        1. I feel this is all done better programmatically, than complicating the design with a switch – how to have a switch that activates at a certain load, in particular when the threshold might vary? The script can easily perform this kind of analysis from the data in the way you suggest if given all the data, before running the heavy (well I doubt it’s that heavy..) algorithm.

          The weight can be autocalibrated in the manner you describe: assume there’s a lower bound to the weight of a person (or cat) and assume bedware weight variance isn’t bigger, and if there’s an increase that is larger that amount, you calculate the distance between before-increase and after-increase, and now you get the weight of the person (and his/her clothes or not..) – plus you can also determine the location of the person’s center of gravity on the bed.

          Btw, the continuous measuring functionality could also be used to track non-restful sleeping.

  2. Please note that loadcells based on deformation principle tend to settle under a changed load. In the datasheet of the sparkfun loadcell, this is called “creep”. Consequently, it would be very suitable for measuring the weight of the sleeper when (s)he enters the bed, and tracking weight over multiple days. Tracking weight during one night can run into this inaccuracy.

  3. Maybe can save you some money here…
    One place I worked captured weights in a way similar to this. There is no need to have 4 load cells, just a piston or bag at each corner all tubed together to a single common pressure sensor, and oil-filled work better than pneumatic. Pneumatic the gas compresses and you’ll notice some small amount of motion but oil-filled you’re unlikely to notice any movement at all.

    And another “bed” device worthy of note is for your alarm. Throw out that buzzer. Hook up a solid state relay to drive a motor with off-center weight mounted to shaft, a large vibrator. It’s peaceful, more effective than audible, and it’s fun to see your cat hanging from the ceiling! It’s great to wake up laughing!

    1. Independent sensors could be used to track rolling around in bed, and perhaps correlate change in total weight combined with change in distribution to tell when someone else is in bed.

      1. Track PLMS/PLMD as well? Yes, but only a scant percentage of the population has this condition and is much easier to monitor with a simple resistive band around one or both calves. The “someone else” condition would be better dealt with proactively through continued observation of the attentive and respectful techniques that initiated the original regenerative oscillations. Monitoring for other oscillations at multiples or fractions is not needed if the filters used at startup are kept in place.

        1. If filtering is withheld parasitic oscillations will develop and require selective removal at a later stage to maintain the primary harmonic undistorted. If later stage filtering of these parasitics is withheld then additional uncontrolled parasitic harmonics, chaotic in nature, are likely to developed resulting in drain on the original intended harmonic and potential collapse of all oscillations.

  4. What about the amount of perspiration that gets absorbed by the pillow[s] and mattress each night. Some will probably evaporate during the day, but not all.
    What about the mass of dust mites that live off the perspiration and body dander? That would also be an increasing number.

    1. Even if this were enough to skew the results, I’d imagine you’d constantly be weighing the bed, and thus have a pretty good idea of how its weight changes when nobody’s in it.

  5. Common complaint above is that it’s inaccurate due to bedding, clothing, and sleeping partners (human or otherwise).

    I guess one way to avoid some or all of that would be an algorithm that virtually tares based on large(ish) weight fluctuations–

    If the bed tracks weight constantly it could set a tare based on the most recent reading after a large weight is added, and then guess about which user just entered the bed based on their history (for example I weigh 86kg, my SO weighs 54kg, and our cat weighs about 3.5kg.

    Assuming our night clothes are similar weights, it seems like an algorithm could be developed to identify occupants entering/exiting the bed and then guessing which occupant it was. It would be tough to do the automatic identification if some of the people in the bed weigh very similar amounts.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.