Bed occupancy sensor, using parts you have

Amazing how attached people can get emotionally to a lifeless dead thing :slight_smile:

Let me post something new we can get attached to

I tried to use a pressure mat in my beds as you may recall and ended up with a load cell solution posted ealier in this thread. And it still works. I never had to adjust anything. Maybe because it is self calibrating and we both put on a little weight :wink:

But I also tried the pressure under the cushions in my sofa in the living room. And that sucked as badly as it did in bed ending up detecting permanent presence even hours after I left the sofa.

I have been experimenting with some mm radars. I have tried different types that claims to do all sorts of things like detecting breathing and heart rate. I have found that they do not work in any reliable way for what they claim but they are excellent as basic presence sensors.

Some of the 24 GHz models are really good as room presence detectors being much more sensitive than the PIR selsors.

I then played with a 60 GHz module which is supposed to be able to detect heart rate. That does not work. And the software and sensors combo I tested cannot detect presence in a realiable way more than 1 meter or so.

So I got the idea to put the module under my sofa. In a 3D printed case and the distance from floor to my butt is less than 1 meter. The radar penetrates the bottom of the sofa and a leather cushion and detects that I am in the sofa (2 person sofa) no matter if I sit or lie down.
It also detects if I am standing right next to the sofa but one step away and it detects no presence.

That think that kind of thing would be an excellent bed sensor also. In a double bed it may not be able to detect if there are one or two. Maybe if it is placed at the extreme edges of a wide bed.

It may be worth playing with. You have to make your own software for it. If anyone want to try this module give me a shout and I will share my software. I use an ESP8266 D1 mini. And this particular module does not have any presence detect pin. You have to get the info from serial port. My software connects to HA with MQTT. It is similar to what I posted for my load cell sensor in the way it works. In HA you define a simple mqtt binary sensor

3 Likes

How did you get it to work “well” exactly?
I connected this to the AD0/GND of an esp32 and while it works ok when pressing on it (drops to 0.08V) otherwise it seems to flap randomly between 0.08 and 1.05v?
Using any resistors?

Sorry for the delayed response but I just saw this. I am actually using an esp01 with EspHome. I am using two binary sensors with INPUT_PULLUP so I don’t have to use resistors. I am not connecting them to analog pins (the esp01 doesn’t have one) but to regular pins.

This is my code:

binary_sensor:

  - platform: gpio
    pin: 
      number: GPIO0
      inverted: True
      mode: INPUT_PULLUP
      
    name: '${devicename}_bed_presence_left'
    device_class: presence
    
  - platform: gpio
    pin: 
      number: GPIO3 #RX
      inverted: True
      mode: INPUT_PULLUP
      
    name: '${devicename}_bed_presence_right'
    device_class: presence
1 Like

Thanks for that but no luck in working as expected, it only works if I sit exactly on the spot (makes sense it’s a sensor for a car seat)
The sensor is under the mattress on the slats and if I lie down it goes off, mattress is soft and quite thick, 30cm or more.

place a piece of packaging foam on top of the sensor, a square big enough to cover the sensor. You can even use the packaging bubble that have the big bubbles 3cm in diameter.

Hello, I wanted to mount a system like this on my bed, but I can’t get it to work on my mattress, I put it between a board and the mattress but I can’t get it to work, on the other hand it works fine outside.

Is there a concrete way to place it, I’m thinking that my mattress is too hard and it doesn’t detect the pressure, what could I do with some ideas?

It hasn’t worked for me either, in no way, out of its perfect working place, but put in its position to make it work impossible to make it work.

Where are you placing the sensor? Mine is at the hip/buttocks between the mattress and the base. If that doesn’t work, I would place a square of foam on top of the sensor to exert more pressure.

image

Right, that’s what I did and it works… YEAH!!!

Now I have it working. I only have to automate the use of this sensor to turn lights on and off at dawn, turn everything off, when I go to sleep, etc…

Thank you!!!

Hi Kenneth, how are you doing? It has been a long time since you created this post, but now I’m trying to create a bed sensor with the seed studio sensors and I found your interesting post here. So If you still have your software and the sensor still works well I really love to hear about you and your software for the ESP. We are using an ESP32 c3 de seed. Thanks a lot for your time.

Hi. The radar under the sofa sucked. It detected too much moving close to the sofa

In my bed the solution with the load cells is still working 100% reliable