FSR - the best bed occupancy sensor

That is not an FSR.

That is a pressure mat. It probably won’t last long, as per my introduction:

Here is my solution for a long (60cm) Chinese FSR, bent and twisted.

download

As I posted before, my FSR came in a small package, so it came deformed, with folds and twisted.
I glued the sensor just by the edges to a piece of wood, applied a little heat, so the sensor was flatter and the bending and twisting marks were almost gone.
Now the readings were in the 25k range with no one in bed and 2k with me lying down.

Before (nobody in bed):

After:

Around 10:52 I lay in bed and when I got out, I put some pillows where the sensor is, so the reading was a little lower.

3 Likes

I received my sensors from Aliexpress and they look like this:

As this will be my very first attempt in doing something like this, can you please let me know if this is fine or I need to dispute it with the seller? I suppose I can do something similar to the poster above, but I am not very confident in my hot air gun skills. Is there any way I can check with multimeter that they are working fine?

Mine came like this.
Place it under the mattress on a hard surface, my bed has a small layer of foam on it and that doesn’t help with the readings and plug the multimeter into the resistance scale, if you have an infinite reading or a very large variation you will probably need to leave it smoother to use it.

1 Like

Mine came the same way and work just fine.

1 Like

Nobody can help me ?

If you add a device friendly_name to your ESPHome core configuration it will be appended to your entity_ids as a prefix. This is how ESPHome works now.

https://esphome.io/components/esphome.html#configuration-variables

Screenshot 2023-08-24 at 23-00-46 ESPHome Core Configuration

If you don’t want this you have two options:

  1. Don’t add a friendly_name to the core config. Or
  2. Manually rename the entity_ids in home assistant.

Another data point for those that have out of range measurement when the bed is empty. I posted above that my sensor was folded, but when I stretched it a bit and stick with painters tape to the bed slat it appeared to be working fine.

My multimeter measures up to 60M and was giving out of range when the bed is empty. I noticed that when my small dog (4.5kg / 10lbs) jumped on the bed the multimeter barely registered some resistance in the 50M range, so I assumed with dogless bed the value to be 60M. In-bed resistance was around 15k, which leads to R1 having a value of 930k.

In practice I tried with 1M, 300k and 100k resistor from which the last one provided widest range - 3.1V when empty and 0.8 when occupied and I am going to stick to it. I am still having a bit of an issue with the home assistant entities, but I will solve that in due time.

This is my first attempt with ESP32, ESPHome and microcontrollers, wires and resistors in general. Overall very beginner friendly, effective and fun project!

Bought the parts several months ago, but didn’t had the time to work on the project.
First try was directly good! thank you very much for the clear how to steps!

I want to thank you for an interesting project that I put on my bed and it works great.
If anyone is interested, I found it useful to place the sensor upside down with the pressure layer facing the wooden bed frame.

2 Likes

Variable flex/bending at the sensor connection caused by the wire can also lead to inconsistent measuring. After fixing the wiring to the frame, I got very stable results, when the bed is unoccupied. It’s not that easy to find the ideal placement of the sensor leading to coherent results without false triggers.

How does your wiring look?

Hey guys! I just found this project and I’m super interested but I am a complete novice (except in coding).
I see that I need the FSR, a D1 mini and some electrical tape since I would like to avoid soldering for now, but what about wiring for example, is it included?

Could someone send a list of all the products that I need to get this working? Thank you!

After this has been working great for a while, my wife decided she wanted to switch sides. Since we have different mattresses, I moved them around and lo and behold - the ranges of the readings are crap. I need to redo the resistor calculations and resolder the board -.-
I’ll be going for potentiometers instead of fixed resistors this time, so I can make adjustments on the fly.
Anyone implementing this, I can only thing recommend using potis right from the start.

2 Likes

You are an experienced husband… smart enough not to reveal if it is you or your wife who is the heavy one :stuck_out_tongue_winking_eye:

1 Like

Welcome to the forum! :slight_smile:

There’s nothing fancy to report. :wink: You need the FSR sensors, some electrical tape, some wires (fitted for 5V, so the standard jumper cable will do),any ESP device (8266 or 32), a resistor or potentiometer and a little time. That’s it. :slight_smile:

No pitfalls or anything else, just stick the things together and you should be good to go. Don’t put too much thought in it, it is simple and reliable solution for a bed sensor - that’s what makes this so good: simple but yet very effective and reliable! :slight_smile:

1 Like

Thank you so much, this helps a lot! :slightly_smiling_face:

1 Like

https://www.reichelt.com/at/en/sensor-enclosure-86x86x25-5mm-vented-grey-cb-rs01vgy-p317693.html?&trstct=pos_4&nbc=1

reichelt in Germany also has the same ones

1 Like

Hello,
I am currently planning to build such a sensor for my bed.

The only question for me that’s unclear is what “weight rating” of FSR I should get.

I’ve seen some 10kg ones, would those (link to german amazon) work when taped onto the slats, where the mattress is laying on?

Sorry for the german link, but you can use a translator, I just want to make sure it’s exactly the one I found (same length, same weight rating)

There is a link to an appropriate sensor in the first post.

The description says that it is rated for 10kg and it works well for me.

1 Like