Bed occupancy DIY sensor

I’ve noticed pretty drastic changes in the values that tend to shift seasonally. It doesn’t correspond exactly to temperature or humidity, but I have to recalibrate the threshold that I use to report “in bed” a few times a year. I ended up giving myself little sliders in home assistant so that I don’t have to rebuild or restart anything in order to change the thresholds and it’s been working pretty well now.

Screen Shot 2020-11-08 at 3.04.27 PM

I just found this thread and would be looking at making something similar. I have a question though.

My bed design means that I would need two of these sensors to detect occupancy (left side and right side) can I hook both of these up to a single ESP8266?

No. You would need an ESP32. The ESP8266 only has one ADC.

Would an analogue multiplexer work instead? Seemingly let’s you plug multiple analogue inputs into a single output. How it seems to work I am unsure.

I will look at an esp32 as well. I have a few 8266 D1 mini boards so worst case I could make two sensors and power both D1 minis off a single 5V.

Yeah the drift is mostly due to the dimensional instability you get with timer in a non constant temperature and humidity. I’ve implemented the same thing:

2 Likes

Hey, people of this thread who are struggling with the bed sensor drift problem. You should definitely look at this aluminum foil/paper arts-and-crafts solution. I tried it cause it’s cheap and I was looking for a solution. I didn’t have high hopes but it’s WAAYY better than a velostat, the ESP32 capacitive touch sensor works much better than I expected.

I’ve been using it for months and the trigger thresholds haven’t drifted at all. Even after remaking the bed a few times.

I’ve heard that sensor drifts too though.

After trying load cells and pressure mats in many different configurations I think I’ve finally found a fast sensor that does not drift and has a large detection difference between occupied and not. I will be testing for a few more days then probably closing this topic and starting a new one if it passes (it’s looking a lot like it will).

Speaking of sensors I recently upgraded to a couple of these and getting significantly more reliable results.

https://uk.rs-online.com/web/p/door-sensors-window-sensors/9184756

Yeah pressure mats are good - for a while.

I’ve found that the ones I’ve been using (S5184A 760 x 530mm Pressure Mat Normally Open - Altronics) eventually wear out.

They’re constructed using two printed electrode patterns on plastic sheets separated by a sheet of perforated open cell foam.

Assuming you don’t go bending the mat excessively, cracking the printed electrodes, then the main issue is eventual permanent compression of the foam leading to false triggering under the weight of the mattress.

I was disappointed by this as I really thought I’d found the best solution. No drift, fast and (for a while) reliable triggering.

As a sneak peek, these are what I am testing:

Could you please tag me if you open a topic about it? Really interested in this and was disappointed by the other systems so far.

Sure. I’ll also put a link to the new topic here when I close this topic, so you should see it now that you are tracking the topic.

1 Like

Interestingly I’ve gone from very similar FSR strips to the mats. The FSR’s so far have worked the longest but recently they’ve started to drift a lot.

So far the mats are working much better with no drift at all, that being said I’ve had to fold them in order for them to be sensitive enough. It will be interesting to see what effect that has on them over time.

Hope you have better look with the FSRs than I have

Arrrgh! Don’t say that! I thought I’d finally found the solution.

The signal is very clean with a big voltage swing (correct voltage divider resistor selection is important):

In fact I could nearly use it as a digital input.

Mind you it is only the first night.

@tom_l, are you talking about the cheap DIY aluminum foil/paper sensor? I used mine from before my Dec '20 post with all thresholds set to 6 and they were solid for over a year, up until about a week ago when one of them went to zero (stuck “in bed”) and wouldn’t come back.

Original design (with over a year of use):

I investigated it and it turns out the paper sensor isn’t as flexible as one would hope and on inspection: getting in and out of bed eventually punched a hole through the paper and the two plates of the capacitor shorted together causing a zero result. Looks like over time, little creases showed up and eventually they became the weak spot as the thing flexes. We put them under our mattress topper so they are several layers down but apparently that didn’t matter.

This is what the creases look like and you can see the holes where the light is shining through. There were three holes that I could see on this sensor:

When I originally created the set of them I taped the aluminum foil around the edges to the paper. After seeing how it failed my wife came up with a great idea. She suggested that cover the whole thing in packing tape (like a lamination) to strengthen it as a single unit. I thought more about it and I realized that I don’t actually want to use paper at all because it creases and eventually wears through – the film plastic of the freezer bag seems to have held up great and it’s an insulator… So, I recreated them all with freezer bag plastic as a dielectric and covered the whole thing with packing tape.

I just finished rebuilding them and they are working great again. I’m sold with this method for two reasons:

  1. I have not experienced any drift problems
  2. They are SUPER cheap and fairly easy to make so if something goes wrong just chuck it and rebuild

If you haven’t tried this method, you should. It works for me and I’ve built automations to arm the house in special ways when we’re both in bed and disarm when one of us gets out of bed. :smiley:

3 Likes

@Burningstone new project is up.

I’m sure its probably in this thread, but my brain is not functioning right now so could you do a write up of how to hook up those aluminum foil sensors and how you made them with just the plastic bags?

I’d like to get some bed occupancy sensors in my house and cheaper is better.

It’s already out there: Bed occupancy sensor, using parts you have

I just implemented someone else’s work.

How are your pressure mats working so far? Did you have any problems with them yet? Did you fold them (they advise against that usually). Very interested in your results with these.

To be honest they were perfect for a while but now they’re pretty much giving the same unreliable results.

I had to fold them as I got no results at all with them flat.

Wish I had better news to report.

1 Like

Although i like the simplicity of this, i see this being ripped/broken fairly easily. How has it held up for you? Also not to fond about so much wiring but i guess the biggest thing is durability here.