Bed sensors do sort of sound like a gimmick — after all, who cares whether someone is occupying the bed? But if you think about it, that information is quite useful from a home automation standpoint. A person could do all sorts of things in this state, from ensuring the overhead lights in the room can’t come on, to turning off other smart devices that are likely not being used while both occupants are sleeping.
[The Home Automation Guy] presents a couple of ways of doing this, but both center around a fairly inexpensive pressure-sensing mat.
In the first method, he connects the pressure mat up to a Zigbee Aqara Leak Sensor, which conveniently has two terminals on the back to accept the wires from the pressure sensor. Then he simply connects it up to a Zigbee-compatible home assistant like the Aqara Hub.
In slightly harder mode, he forgoes the Aqara Leak Sensor and connects the pressure mat up to an ESP32 using a nifty screw terminal dev board. Then he sets up the sensor and all the desired actions in ESPHome. Of course, with an ESP32, it’s easy to add a second pressure mat for [Mrs. The Home Automation Guy]’s side of the bed.
Now, once they’ve both gone off to bed, the house goes into night mode — all the smart plugs, Sonos devices, and other things are powered down, and the alarm system is put into night mode. Be sure to check out the build video after the break.
If the bed’s a-rockin’, start data loggin’!
Many many moons ago someone decided that a recently married couple needed their “stats” send to Twitter. For the lulz, presumably.
I worked with a few other engineers on a “smart bed” project over 10m years ago, where we used plastic fiber inside a thin mat. The key waqs software, as we shined laser (led) in one end and the other on a webcam chip. It was sensitive enough to pick up someones heartbeat.
The target customer were nursing homes (mostly to detect people getting out of their bed at night)
That is hilarious. I did a workterm in 1989 with the company that originally came up with that sensor. It was originally developed to implement collision detection on the Canadarm. They called it Kinotex. I worked on prototypes for use as car seat occupancy sensors able to tell the difference between adults, children, and baby seats. Distance between buttocks is a good measure of whether to deploy an airbag safely. We also proposed it for crush zone sensing but that never became a thing.
Not only is the sensitivity very high, but the reading you get is surprisingly linear versus deflection distance. Also, while camera sensors are useful for higher resolution applications like beds and space robot arms where you bring a large bundle of fibers into it you can do lower resolutions with LEDs and photodiodes. You can even get ones specifically designed to accept plastic fiber.
The patent expired a number of years ago. I occasionally think about getting the parts to recreate some of the prototypes to play around with.
> The patent expired a number of years ago. I occasionally think about getting the parts to recreate some of the prototypes to play around with.
please do, and post about it
I wonder what machine learning could do with that setup and a much longer fiber
As soon as I read this article I thought of nursing homes. My grandmother died last year with dementia and we saw the problems nurses faced. The residents learn very quickly not to step on the pressure sensing mats as they set off the nurse alarm. So they try to step over them, falling and hitting their heads in the process. A pressure mat in the bed would be so much better.
My late father’s nursing home the pressure mats were under the mattress. If the bed was occupied and then became empty it would trigger the nursing station.
Downside, it also tended to go off if you sat on the bed for a while to visit and then got up to leave.
Came here wondering this. Surely breathing and pulse rate can be picked up and logged.
The “eight” kickstarter tried to do this, but it evolved more into a smart heater…
(I gave up and now I’m using a mmradar to detect occupancy for us and a low res heat camera for the kid.)
System needs to be fine-tuned for all the other reasons for being in a bed.
Imagine you are throwing a party, a couple of guests excuse themselves upstairs and the next thing you know all the lights and music switch off.
So true…ROFL!
For the statistics kinks.
I’ve tried a lot of different methods:
Using a strain gauge requires calibration every few months due to drift.
Pressure mats are not good. They eventually compress and give false positives.
Using an FSR (force sensitive resistor) is a much better idea. You can get 600mm long versions. Mine has been working perfectly for over a year.
You should be able to automatically recalibrate a sensor, since your data of interest will be bimodally distributed, and drifting slowly from week to week.
I’m not sure I’ll ever be excited enough about home automation to willingly dive into automated calibration through statistics, but I’d definitely use someone else’s implementation.
Why not just use load cells on the bed legs?
I use an Aqara FP2 above the bed. I has the possibility to divide the “room” even in zones, and can detect multiple persons. You can even trigger an event when somebody falls out of the bed !
Make sure to publish it on the internet too.
They’ve been using something similar on babies to prevent cot death for a good while now. I tried building my own version a long time ago but eh testing home built devices on your own infants wasn’t something my ex supported at the time!
These mats are pretty unreliable, even under the seat of chair, much less a mattress. Also the PVC lining makes noise when you sit, and had false positives (and negatives) to a degree that relying on them for automation is a no-go.
One main problem is that these act as a binary sensor across the entire mat. You’d really want analog sensing in order to make a good judgment about presence.
Additionally, depending on the mattress you use, it may or may not work at all. Under a Tempurpedic, the pressure does not reliably trigger if ever at all!
Presence detection is a great way to perform advanced automations, but this method is not the way. Perhaps under/built into a doormat.
Could be very helpful for alerting caregiver to epileptic seizures
I mean I guess I get it. But wouldn’t it basically be the same thing to wire it all up to listen for one single momentary button under the bedside table? You could even tell your wife it’s detection based.
I’ve got mine set up with the tamper sensor of a z-wave window / door contact, works extremely well, but cannot differentiate which human is occupying the bed. Which could be useful information in some cases. I haven’t really come up with any good automation ideas for it yet though. It was one of those things that seemed like it would be really handy, and I had the spear sensor lying around, but in practice I haven’t really used it for anything.