FSR - the best bed occupancy sensor

You measure the FSR resistance without it connected to anything except your meter.

Now that I’ve built a couple of these, I’m thinking about putting them in the guest room which would massively help a handful of automations. But of course, I can’t statically measure for an individual, so I was thinking about the trim pot route, so that it’s easily adjustable.

Curious if anybody has done this and what your experience has been?

I use a pot. My reason is that it’s in our baby’s cot and I want to adjust it over time as she grows.

1 Like

I’ve used pots on mine, simply for adjustment should it be required. Here’s pic of my unit, it also has a RGB strip for under the bed.

I’ve not had to adjust them yet. but it did make setting up easier.


And this is what it looks like in HA.

1 Like

Never seen a trimpot look like that. Is that double pot?

Nope, I just got them from aliexpress.

Hmmm, if it’s not a double why are there two knobs on it? Never seen one like that.

EDIT: lol just dawned on me. That’s actually 2 trimpots inside a 3d printed box??

Gotcha thanks. Just for my own learning, wouldn’t the resistance change if the FSR were connected to, say, 4 foot leads to the ESP32? Why is okay to ignore that – because it’s immaterial?

Again, I’m not doubting you. Just trying to understand. TIA.

The loop resistance of your cables will be measured in hundredths of Omhs at most. Compared to the Kilo-Ohms of the FSR that is for all intents and purposes equivalent to zero Ohms.

1 Like

Sorry, I was out for a couple of days.

Yes, I’m using the filters:

sensor:
  ## FSR input voltage
  - platform: adc
    pin: ${gpio}
    attenuation: 11db
    unit_of_measurement: "V"
    device_class: "voltage"
    name: "${name} Sensor"
    state_class: "measurement"
    id: "${name_lower}_sensor"
    icon: mdi:sine-wave
    update_interval: 0.5s
    filters:
      - sliding_window_moving_average:
          window_size: 10
          send_every: 1
      - or:
          - throttle: 180s
          - delta: 0.02

I’m using these FSR and the cables are about 1m long.

I use a classic phone charger with a USB cable for both the ESP32 and D1 Mini

Your product link is broken. My cables are longer than that. :man_shrugging:

Really? Here’s a picture then. I guess it’s basically the same as everyone.

I’m doing some tests and so far, it seems that my connections between the cable and the FSR that might be the problem (maybe I’m just no good at crimping :laughing:). I’ll keep you posted!

EDIT: it turns out that the tape was incorrectly positioned to avoid contact between the 2 connectors whereas it was precisely to avoid that. Problem solved and thanks for your feedback!!

Final got mine all up and running - Thanks!
I have a single ESP32 configured to run x2 sensors (each side of bed).

Any ideas what could be causing the very slow response on my side?
Is there likely anything obvious that I’m missing or likely worth trying to re-do the resistor sizing?

Feel like I got the R value pretty good as there is a nice large range between min and max volt.
I used the same steps for setting up my partners side and that is fantastic, very responsive - fast enough to se when she got up for the toilet.

My side however takes a hours to get the voltage back up to max when out of the bed.
Definitely not fast enough to catch my toilet breaks.

While my side works in general, it reacting so slowly make it externally hard to create automation that react quickly to it.
I can lower the trigger point so it triggers me ‘out of bed’ sooner but, that will delay the ‘in bed trigger’ and vice versa.
I know it can and should be much better as I can have the desired result with my partners side.

How is it mounted? Can it be that whatever it is attached to remains deformed for a longer time compared to your partner’s?

It’s under a foam mattress on a rigid wood slate.
Everything in terms of bed/mounting is exactly the same for both sides.
(R value was set for her wight but, still works perfectly fine for me on her side too).

I’ll try re-taping the end down (on the very tip and looser). See what that does for my R value calculations and see how it goes over night.

The end of the FSR needs to be un-taped. It has to be able to “breathe” through it.

32cd3b2a9e04892dc00c9b4cf2f72b7be30fcd8f

I had heat-shrink around each terminal and a larger bit over the end as a ‘strain relief’ (same as the photos in your instructions at the top) but, removed the larger bit in order to ensure the end is not covered.
The other end has a bit of painters tape lightly sitting over the very end to hold it in place.
(same as the photos in your instructions at the top).

The side that’s working perfectly on my partners side looks exactly as yours did in your initial instruction photos too.

I’m already on the second strip for my side of the bed and while this one is better (slow to go min-max volt), it is still not as good as my partners side…

I have done the above changes on my side and after doing so, the new R value is 76k (30k previously) so, hopefully that’s a sign that the changes may have a positive effect.
Will see how it goes tonight!

Giving this a try, I understand there’s a formula, I just don’t understand the formula, lol.

If I have 16.5k ohms (in) and .75k ohms (out)
Do I then go 16500x750 = 12375000
Square root of the is 3517.811

So does that mean I need a 3.5k resistor.

Or have I botched the formula, lol.

That is correct. Nearest value will do. 3k3, 3k6 or 3k9.

There’s something wrong with your measurements though. The value should be higher resistance out of bed. Did you get them back to front?

Makes no difference to the calculation.