Bed occupancy DIY sensor

Update:

I’ve been running this config for a few days now, and it’s been working out really well!

  - platform: adc
    pin: A3
    name: "Bed Left"
    update_interval: 100ms
    attenuation: 11db
    filters:
      - sliding_window_moving_average:
          send_first_at: 30
          window_size: 30
          send_every: 30
      - or:
        - delta: 0.3
        - throttle: 120s

It responds within about 2-3 seconds of getting on or off the bed, and the graph is pretty clean in Home Assistant!

As you can see, I added another sensor for the other side of the bed. Something is wrong with it, probably how I glued the flex sensor to the slat, and I’m not getting good readings from it at all. Unfortunately it means I have to rip that one off and re-solder a new flex sensor onto the chip, so that’ll be an adventure.

It would be nice for the others attempting this sensor if you could address my request.

I’ll give that a shot in the next couple days once I get the replacement sensor for the other side. I’ll have two to compare that way too.

1 Like

I have no input at the moment, as I’m vacation, but I just wanted to say that I’m so happy people are posting about their attempts. This gives me hope for my setup in the future! Thanks!!

Really interesting project! I’ve been following this thread for a while now and finally got all the parts in the mail today. I’ll build a setup first thing tomorrow and report the results. Wish me luck regarding the noise :wink:

2 Likes

Hi everyone,

I am glad that I found this topic there are a lot of good ideas. Let me share my experience with this bed occupancy sensor. It’s not the cheapest solution for sure but it’s very easy and reliable if you have z-wave integration. Also no continuous power supply required.

I ordered an inexpensive pressure mat for a few bucks and I also ordered a cheaper (used) Fibaro door/window sensor but the old version (FGK-101) which has input possibility. Detach the cover and connect the pressure mat wires to the terminals in the Fibaro using only a small screwdriver. That’s it.

It has to be positioned properly under the bed mat but for me it works perfectly in the middle. I also put a wooden plate on top to help on pressure distribution. The battery lasts for more than a year and it takes half a minute to replace. In home assistant it is visible as binary_sensor, no further setting is required.

I have to admit I had some problems with the initial setup. The first mat was very bad quality and released some air with time and became unreliable but I have no problem with the next version. I installed several of them. The sensitivity is not exactly the same with every mat, I had to play a lot to find the correct position for each and sometimes I use wooden plates to cover them or make a bottom cover as well.

You need two mats to monitor both sides of the bed, but if you don’t need to monitor who is sleeping then you may connect both mats to one Fibaro sensor.

fibaroCapture bos

3 Likes

@A320Peter, can you give an url for your using pressure mat? Also how it handles with large bed sleeping pad which has its own weight?

I don’t want to recommend any of them as these are all cheap chineese products and I had an issue with one of them. I guess they are sensitive to weight (long term) and pressure distribution. I used this and this and I am going to experiment with this.

I’m using one very similar to this with an Insteon window sensor with input… The two little contacts fit right into the input of the sensor perfectly.

It’s been rock solid for about 3 months now

Someone maybe create video for this DIY sensor?

1 Like

hay I did it this way

How did you make your chart so long? Mine is 1/6 of the screen

I’ve seen people using 3 different techniques here and I’m trying to figure out what would be best for me.

  1. Strain gauge (start of this thread) on slats
  2. Load cell + sensors (essentially turning your bed into a large weight scale)
  3. Pressure mats

Numbers 2 and 3 seem like they won’t work particularly well with a heavy foam mattress. Is that true?

Click in the title area of the chat, and it should fill up the screen

1 Like

wow thanks
don’t know why it doesn’t have cursor: pointer

can you put this in a chair?

@tom_l Can you share what regulated power supply you’re using?

I just got mine set up with your examples and also using a cheap 5V adapter, but would love to reduce the noise more.

When you say between bed frame do you mean between box springs and mattress? Thanks

no, between “slatted frame” and the bed frame, hope you can imagine what kind of bed I had… I just bought a new one without slatted frame and a 35cm Boxspring matress and don’t have any load cells implemented yet. no idea how…

1 Like

Thanks for the reply, I’m looking at the same problem. This bed is so heavy I would need a car jack to raise a corner to put in a load cell. By process of elimination I think I’m moving to FSR’s under the sheets. Maybe these https://www.adafruit.com/product/1071