Building a Bed Occupancy sensor for Home Assistant (yet more load cell guides!)

I have ordered the hardware from Aliexpress yesterday. Pretty excited to implement your setup once the stuff arrives in a few weeks.
Thanks.

Please let me know how you get on, I’m interested to know! Let me know how the guide is too and if anything needs updating!

This project is awesome. I am trying to do the same with minor modification. In my case I don’t need accurate measurement and all I want to check if there is any additional weight on the bed or not. I am having trouble mounting the load cell because of my special bed legs. However I would only need one cell. My bed has a middle leg in the centre. Do you know how to make the wiring to HX711 if I only need one or maximum two load cells?

Sorry for the late reply, I replied to your comment on the website. Let me know if you need any more help!

The tutorial helps me a lot, especially the troubleshooting section, thank you so much! The sensors are working fine now, but I have never worked with MQTT before. When it comes to setting this up, do I just need to use this integration? https://www.home-assistant.io/docs/mqtt/broker/ And do you know a way to run the ESP8266 on battery without having to re-charge it every couple of days?

Hey,

I wrote a guide for you here: https://everythingsmarthome.co.uk/howto/how-to-install-an-mqtt-broker-mosquitto-install-config-on-debian-ubuntu-mint-fedora-raspbian/

Hope that helps.

Running an ESP8266 can be a difficult task that depends on many factors, what sensors do you plan to use, how often do you need the ESP8266 to report, how big a battery, etc etc?

1 Like

This is great, thank you so much! The installation seems pretty straight forward, I will definitely try it out.

I’m using the same sensors as in your tutorial, with a different amplifier and a board from aliexpress that’s called something like “Micro ATmega32U4 Leonardo replacement”. It’s working fine with your calibration code, but I’ll have to switch to a wireless solution w/ battery, because there’s no outlet next to the bed.

I’m sorry I do not know the answer to that, you would need to measure the power draw of the setup and do some calculations to see what kind of runtime you would get. You can also implement deep sleep on Arduino boards which saves a lot of power. Choosing a board without USB headers can save a lot of power along with removing any onboard LEDS.

I’ve made a battery door sensor before on battery power, it lasted a long time after doing the above, but that is a totally different sensor, I don’t think you will get a long time out of a battery but you will know more after doing the calculations. I used this link here which had a lot of good information:

Sorry I do not have more information!

Question for you, how can 4x50KG sensors be enough?
Surely the bed, you and your partner weight over that.

We are often 4 in my bed, and the bed weight quite a lot, should I use more sensors?

If you need the exact weight measurement then yes.

I have made mine so that there is support under the load cell part that bends. So that it can’t bend too much to break. I use it only to detect on/off the bed. Not so interested of the actual weight.

1 Like

Just received my 40 ( forty ) sensors in order to build this.
Anyone knows how to wire them in order to sum their values?

Thanks!

Hi all

This is probably a stupid question, however I’ve seen Lewis’ YouTube guide on this, read the article and now ended up here when googling for inspiration!

I’ve printed the same sensor holders as shown in the 1st and 2nd images above. But if the bed leg is larger than the printed top (as is the case by seeing the larger “leg holder” printed cases), then how does the bed leg apply pressure to the flappy part of the case, when it will also be touching the 4 edges of the top case too?

Sorry if that’s not a very clear question… I’d be interested to see how people have attached the sensor cases to the bed legs is I guess what I’m asking…!

Thank you

Hi

I was about to go ahead with this project, but I noticed our bed has 12 (!) legs !
Is it possible to have 12 load cells connected to the HX711 ?
If so, how do I join the wiring … in groups of 3 ? Does it matter if you join the outer legs / corners etc ?

You should look into this instead…

Yes, I saw that too.
But there was a youtube video from a smart home builder, and he prefered the load cells.

The FSR … it would be less fuss to be honest

The load cells are more reliable (at least in my experience) but obviously a bit more work.

To answer the question, you don’t need to cover all legs necessarily, you could make “blanks” for the other 8 legs so the weight is distributed evenly - haven’t tried it but should work

I’ve found the complete opposite.

:sweat_smile:

Well, anyway, I found this guy who has diagrams for 4 / 2 and even 1 leg(s)/load cells.
If you don’t need an exact weight measurement and just a simple presence detection, this more then enough I think. I think I’m just going to take the 2 center legs of each side of the bed and see how this goes.

Btw, I also read that some HX711 amplifiers don’t have ground on pin E- , maybe that’s the cause of inaccurate readings:

https://community.home-assistant.io/t/bed-scale-occupancy-sensor/114205/21

Quick question for anyone who has done this. Due to our room being in a loft with super low ceilings our box springs sit directly on the floor. Its a king so the box springs are separate. If I’m using 4 of these on the corners (I have 3d printed holder to screw them into the box spring) it seems like it wont work as the box spring will just sink towards the middle. I was thinking about putting them in a diagonal fashion wondering if that will work but then will the bed rock on the angle? They aren’t very tall so idk, especially as they sink into the carpet.

I’m thinking about building a 2 inch bed frame if all else fails.

I found with FSR that they werent very reliable under a memory foam mattress in determining who was in the bed or not. My young kids (6 and 8) and a 35lb dog would trigger it often. I ended up having to wear a watch and my wife too and she hates watches lol. I’m hoping this method is better at determining who is in the bed.