TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Making my own bed sensor

237 pointsby davikrover 1 year ago

24 comments

LCoderover 1 year ago
I spent years in a previous job developing acute care pressure pads like these utilizing pressure-sensitive conductive ink. The simple open&#x2F;closed circuit pads shown here work well above the mattress but (depending on your mattress weight and bed frame structure) can provide false positives when placed below. We had fun stories with our first home testers where many people (me included) planted our elbows and lifted when we turned during the night. This movement was enough of a weight lift over the pad to cause the first iteration of our sensors to trigger. The ability to adjust your bed&#x27;s unoccupied zero point using an analog measurement, deciding how much weight should be added (or removed) to determine a state change, and over how much time the movement occurred makes a big difference in reliability.<p>Near the end of my grandmother&#x27;s life, she was living with my parents and a fall risk. I did this same ESPHome implementation to HomeAssistant to provide us with alerts when she got up on her own in the middle of the night, and it helped my mother sleep much better.<p>Side note: those other two wires the author says they &quot;have NFI what they do&quot; are most likely wired into the pad as a permanently connected loop. Most monitoring equipment will look for a closed circuit on those wires to detect that a sensor pad is connected correctly and the sensor wire hasn&#x27;t been broken (ripped, torn, cut, etc).
mattmaroonover 1 year ago
Damn, why did I never think to use a leak sensor? I’ve been goofing around with building some unusual devices and messing with relays and io pins and arduino and completely missed this obvious solution.<p>It’s literally a device designed to do exactly what I sometimes need (start an action if a circuit closes) and I just never thought about it even though I know how leak sensors work and that there are ones available. Duh!<p>Stuff like that is why I love HN. Thanks to the author if you’re reading.
评论 #38701711 未加载
minimalistover 1 year ago
Andreas Spiess&#x27; recent video [0] covered some milimetre-wave radar chips whose application includes presence detection at a distance (including if the bed is occupied).<p>Does anyone know of any bed automatable bed heating&#x2F;cooling solution (DIY or otherwise) that can work offline of with Home Assistant? I had my eyes on E*ght Sleep but it looks like a lot of the functionality is behind a subscription wall [1] and the device is very chatty [2] and I haven&#x27;t been able to find any API reverse engineering &#x2F; firmware mods.<p>[0]: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=s-GzUTyIH9c" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=s-GzUTyIH9c</a><p>[1]: <a href="https:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;EightSleep&#x2F;comments&#x2F;1248wgz&#x2F;buyer_beware_eight_sleep_has_now_moved_basic&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;EightSleep&#x2F;comments&#x2F;1248wgz&#x2F;buyer_b...</a><p>[2]: <a href="https:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;EightSleep&#x2F;comments&#x2F;185cgm4&#x2F;pod_3_traffic&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;EightSleep&#x2F;comments&#x2F;185cgm4&#x2F;pod_3_t...</a>
评论 #38700582 未加载
评论 #38721573 未加载
评论 #38700346 未加载
评论 #38700601 未加载
robalfonsoover 1 year ago
I&#x27;ve done this as well, but I moved to 500kg load cells on the bed legs for reliability.<p>2 Load cells one on each back leg of the bed. Upside too is I&#x27;ve been able to discern things like, sitting on the edge of the bed to put on shoes etc based on the weights.<p>Esphome, load cell, and hx711 chip for the load cell comes out to about $40-$50 each leg.
评论 #38703935 未加载
paradox460over 1 year ago
Many years ago, I bought a bed&#x2F;sleep sensor made by Withings. It worked fantastically, for about a year. Decent sleep measures, circadian aware alarm, all that.<p>Then it just stopped working. Contacting support thought it might be the pad, and they sent me a replacement. That worked for a while longer, until it didn&#x27;t. At that point, Withings had been sold to Nokia, and wasn&#x27;t interested in maintaining their system anymore.<p>I miss it. I&#x27;m sure that this system won&#x27;t be able to do all the measurements the Withings one did, but thats OK. I&#x27;ve got a watch for that. Def. going to have to try this soon!
评论 #38704793 未加载
blorenzover 1 year ago
I never thought of using a water leak detector like that nor have ever actually used a water leak detector. I can now create my own pressure plate activated door or true AFK notifier. Thanks for the write up!
评论 #38700519 未加载
评论 #38699505 未加载
评论 #38705884 未加载
pants2over 1 year ago
I&#x27;ve always thought a Thermal Imaging camera mounted above the bed would be the best sleep tracking system. It could even be hooked up to a feedback loop where if it detects your body temperature rising it can increase your fan speed, things like that. It would be a fun computer vision project.
评论 #38701877 未加载
评论 #38703704 未加载
pricechildover 1 year ago
<a href="https:&#x2F;&#x2F;www.revk.uk&#x2F;2023&#x2F;03&#x2F;bed-sensor.html?m=1" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.revk.uk&#x2F;2023&#x2F;03&#x2F;bed-sensor.html?m=1</a> has another take on the idea after frustration with a &quot;smart&quot; &amp; expensive Withings solution drove him to something different.
MarkusWandelover 1 year ago
Kinky jokes aside, this sort of thing can give a pretty good overview of how much you slept and how well. I use a piezoelectric sensor plate from an &quot;Angel Care&quot; baby monitor. Takes only a handful of passives to safely interface to an Arduino analog pin (safety: The transient from the thing getting jolted not burning out the input pin).<p>The result, graphed (at 1 minute per sample bin - don&#x27;t get kinky ideas) gives a very good overview of awake&#x2F;tossing and turning&#x2F;really asleep. Which to a lousy sleeper like me can actually be reassuring - yes, I did get some sleep in all this.
stinosover 1 year ago
Bit off-topic, but having played with HA a bit I always wonder if there is a general strategy on how to deal with failures, i.e. is there a way to make everything go to the default&#x2F;safe mode in case things stop working? A watchdog-like backup system? And another backup for that :) I get that it&#x27;s unlikely to happen, but still.. Like:<p>- some sensor triggers lights on via impuls relay (that&#x27;s what I have to happen in my home), HA stops functioning, lights remain on. How to make sure instead they&#x27;re turned off? I get that not using impuls relays but relays which need to be driven high constantly might be one step in the right direction, but that would still assume whatever line the relay is driven with is pulled low when HA stops functioning.<p>- you setup HA to instruct your home battery to charge during off-peak hours, HA stops functioning during off-peak, battery is left in &#x27;charge as much as you want&#x27; state. Unless battery has functionality to tell it &#x27;charge max x hours&#x27; it will try to keep charging, whereas it would be nicer if it wouldn&#x27;t<p>- same for heating: leave for vacation, tell HA to put heating in low power mode but to start heating the house again in normal mode 3 days before I&#x27;m back (because that&#x27;s roughly the amount of time needed with low temp heating to get everything warm again). HA stops, I come home to a cold house.
评论 #38707338 未加载
gjpollyover 1 year ago
Sensor shows 2 people in bed, when you&#x27;re not home.
评论 #38699504 未加载
评论 #38706368 未加载
评论 #38700701 未加载
评论 #38700187 未加载
xp84over 1 year ago
The moisture sensor component. I can’t stop laughing picturing a readout like:<p>“Greg’s Bed …. Wet”
skaover 1 year ago
I often find reading these sort of descriptions amusing, for the strange mix of &quot;hey, cool seeing someones DIY project&quot; vs &quot;I just don&#x27;t understand why&quot;. I guess my personal value on hacking up your own stuff is just <i>way</i> higher than that on home automation...
评论 #38700448 未加载
评论 #38700489 未加载
评论 #38703044 未加载
PMunchover 1 year ago
The trick with the water sensor is really neat, might have to look more into that. I also wish that more companies would design some of these building block smart devices for us hobbyist. Don&#x27;t tie it specifically to water, maybe have a pot to trim the sensitivity, et voila you now have a pretty handy all-round ADC thing.<p>For my bed detection though I just have Tasker on our phones telling the system when they charge. If it&#x27;s after a certain point of day and our phones are charging that&#x27;s a good indicator that we&#x27;ve gone to bed. Doesn&#x27;t require any extra hardware, making it super cheap. Although accuracy obviously won&#x27;t be 100%.
nkozyraover 1 year ago
Force sensor resistors can be had for $3-$8 a piece, would they not also do the trick? ESP32 is such a great platform, can you not just make an HTTP request depending on force to a Home Assistant API endpoint and skip the leak detector as a conduit?
评论 #38700348 未加载
评论 #38699795 未加载
评论 #38699594 未加载
ulf-77723over 1 year ago
Great project! Until now I do not have anything connected to my bed, I can&#x27;t sleep with something attached to my wrist, so no sleep data. Tracking the sleep would be really great, but the current solutions seem not right to me.<p>I would welcome a system, which may be used as a pod sensor, like the mentioned EightSleep or Withings, both not visible. But I want to set when something is radioing around my bed. Just like on my smartphone, where the flight mode is activated, I would like to set the device so that the data is only synchronized via WLAN or Bluetooth when I am no longer lying in bed.
评论 #38702904 未加载
评论 #38701374 未加载
neilvover 1 year ago
I see the photo of the sensor atop some springy bed slats, but don&#x27;t see mention of how the sensor setup distinguishes the weight of of mattress above springy bed slats from when a person is atop.
评论 #38701998 未加载
wkjagtover 1 year ago
I love reading about implementations like these. I love the technology behind it. But I’ve never read about a project like this and wanted to automate my house in any way. Maybe I’m a weirdo, but I enjoy getting up and turning on the light, and making coffee. I’d be somewhat bored if it was all done for me. I would miss the routine.
a_t48over 1 year ago
I need one of these to stop my cat from turning on the bedroom lights when he’s hungry. Unfortunately with HomeKit doing automation like this the easy way involves converting the action into a shortcut, which comes with execution delay.
stavrosover 1 year ago
How does the water leak detector work? What&#x27;s supposed to go onto those contacts?
评论 #38700426 未加载
评论 #38700063 未加载
jackvalentineover 1 year ago
I used to use the withings bed sensor combined with IFTTT to boil my kettle downstairs when I woke up in the morning.
anotherevanover 1 year ago
I wonder if it could distinguish between a human and our 35kg dog who often lays on the bed during the day.
评论 #38703240 未加载
jaaklover 1 year ago
I thought the sensor can be used to check if my kids are making their own beds properly.
throwaway81523over 1 year ago
Obligatory:<p><a href="https:&#x2F;&#x2F;biggaybunny.tumblr.com&#x2F;post&#x2F;166787080920&#x2F;tech-enthusiasts-everything-in-my-house-is-wired" rel="nofollow noreferrer">https:&#x2F;&#x2F;biggaybunny.tumblr.com&#x2F;post&#x2F;166787080920&#x2F;tech-enthus...</a>
评论 #38707368 未加载
评论 #38702522 未加载