FSR - the best bed occupancy sensor

Hi, thanks for this amazing idea! I have implemented this to replace my 4 point weight sensor, as that was unreliable at best. I have used 6 SF15-600 10kg resistors for my king size bed, as they where cheaper in Europe. I secured the sensor on 3 long thin pieces of wood, as this would make moving them to another bed easier. 4 of these pressure sensors are connected toone ESP32, and 2 on another, as the second ADC of the ESP32 was in use by the WIFI module, and could not be used by ESP home. One of the ESP32’s is connected with the micro-USB, and powers the second ESP32. the sensors are all combined with 1MOhm resistors, and in my testing that proved to be the most accurate (the calculation provided in the post was not of use for my sensors). after playing around i found that 2V1 was the best setpoint for my setup. the result is the following:

Hi @henri006 ,

What do you mean when you say that the provided calculation did not fit? I’m using the same FSRs (SF15-600). How did you calculated the 1MOhm resistors then therefore? More Info please :slight_smile:

Cheers Flo

Hello all,

I am not sure how to proceed. On my wife’s side it already works quite well, I took a 330kOhm resistor for her side and there is a clear difference between in and out of bed. Unfortunately, I have a “softer” mattress on my side and I’m not sure how to proceed. I calculated a value (using the given calculation from the first post) of 72kOhms for the resistor (I took 100kOhms for the circuit). Unfortunately, when I put the circuit together, I have a very small detection range - it varies between 3.1V and 3.3V. So to have a wider range - should I use a resistor with more or with less ohms? LG & thanks for your help

PS: I think the project is really cool. What do you think about taking it to the next level? Can someone design a PCB for it?

Thank you !

For people looking for the connections :

1 Like

Meanwhile I measure the resistance of the FSR with a multimeter when in and out of bed…

When out of bed my multi-meter indicates 1, whatever the position on the multi-meter.

When in bed, I have to position my multi-meter on 200k and get depending how I’m laying in bed these values : 28,8 - 27,5 - 29,0 - 32,5 - 35,2

As suggested in another post above, I used a 100k resistance and it works fine !

Joining the Party!
Got myself SF15-600 instead of the SEN because they are hard to get by here in the EU.
but I’m wondering,
Does this cind of sensor survives Folding?
So far I got 3 stripes and only 1 gives me a read out below the 60MΩ (max for my multimeter).

No.

1 Like

@tom_l thx a lot for this project.
I have used alarm mat’s under the mattres, which worked ok, but now one is half broken and trigger all the time. Before buying new alarm mat’s (which lasts’ 3 years), i will try your nice project.

Just an quick question regarding the ADC input’s of the ESP8266 and ESP32.
In the docs is an ~1V ADC vref and not 3V3.

So does your formula from the OP does takes this into account?
In other words → Will the ADC input never see >1V with this formula?

thx

Hi,
Sorry for the late reaction. To be honest I just bought a resistor kit from aliexpress, and proceeded to try different resistor values, writing down the results, and extrapolating it to see which value would fit best with my setup. Basically trail and error testing. Higher than 1Mohm seemed to have diminishing returns. What I found whas the higher the resistance, the better the detection range.

Greetings,
Henri

If you use an voltage divider calculator then you don’t need to do all that hard work

Also, dont put tape in the middle, and only on the edges. the tape in the middle seemed to divide the pressurepoints, and constantly triggered the resistor.

Nope. Use the equation in the original post.

Man this is SO cool. I wish I was advanced enough to build this myself. Is there maybe a step by step YouTube tutorial available? Or can you purchase these ready made? Lol

It’s really not advanced.
If you know how to solder then it’s just a few minutes of work.
If you don’t know how to solder then it’s perhaps an hour.

I’m sure it’s super easy if you’ve worked with esphome and Wemos minis and stuff before. If it’s your first time ever touching any of this it feel like the Mount Everest. Haha

I read every single post and I’m slowly starting to get the general idea but I’m still not 100% sure how to wire it all up. Do you all just permanently connect it via those little white developer plastic board things? Is it then put in a case after that? It just seems so fragile. Especially if it’s installed around a bed.

What would help a LOT would be a definite shopping list. All the recommended items needed to make this one tight, little package.

Also, is it possible to just wire three of these strips together and have them recognized as one large strip? I don’t really need to know if the left, middle, or right side of my bed are occupied. I just wanna know if any part of my King bed is occupied.

1 Like

Nobody is born with the skills so everyone had a first time.

  • You would need a soldering iron.
  • Sponge or other tip cleaner.
  • Solder
  • Soldering tip activator (not needed now but eventually you will need it)
  • A pack of resistors, there are usually packs of 500 or more in all or most values
  • ESP8266 or ESP32
  • Multimeter (not essential for this but it’s a good to have for debugging)
  • Pressure mats or FSR(s).
  • Some wires (you can use old broken USB cables, speaker wires or whatever you have, or buy something cheap)

I would suggest not wiring them together, there are plenty of GPIOs on the ESPs so just use three of them and group the binary sensors in HA later.
It will give you more flexibility later.
It’s going to cost you a few more resistors but they are dirt cheap.

As you can see from the list above I do not recommend the breadboard route, I suggest you solder the parts.

When you solder a wire to the ESP, strip the cable melt a very thin layer of solder on the wire and push it through the hole in the ESP, then solder it in place from the bottom.
It really is as easy (ok marginally harder) as it is to read the instructions.

1 Like

Hi again,

Although the moderator said that this is not the right way - I tried it and used 1MOhm resistors. This works wonderfully for my wife’s side of the bed. But unfortunately my side looks terrible. I’m not sure why this is - I think maybe the FSR slat sensor on my side is broken - so I ordered a new one since these measurements don’t make sense.


By the way, I soldered the sensor on a breadboard and I think it looks quite clean :slight_smile:
I made a kind of “socket” for the resistors, so I don’t have to re-solder when changing them.


That’s a perfboard, a breadboard is made of plastic and you can’t solder on it.
But yes that is a good option

Thx for your info! I didn‘t know the english word so I just entered „Lochrasterplatine“ into the translator of my choice and thats what it told :slight_smile:
Cheers