FSR - the best bed occupancy sensor

Great, thanks for the info! Glad to know they work. I’ll probably give these a try then. I need to figure out exactly how I want this to look and work before pulling the trigger.

As an aside, I’ve found I have a much higher WAF when it’s not a bunch of wires and boards hanging around. I did give an ultrasonic sensor I had lying around a test to see if that would work, measuring the distance from the bottom of the slat to the floor. It… sort of worked. Just not as reliably as I wanted. But the proof-of-concept received a solid “Oh, that I like” when it turned on the lightstrips as a nightlight for walking around the bed, with the promise of further automating the nighttime routine.

Gah, all of you buttheads must have cleaned them out haha. They had a bunch when I had posted this originally. Oct 1 is the restock date. Not bad. Gives me time to pull together a few other projects and put in an order.

I use this solution for over 2-years and it works just AMAZING, probably one of the best automation-ideas and solution in this forum. As of now I use an ESP32 and hooked up the FSR-sensor to the 3.3V voltage output, A0 and GND, between 3.3V and A0 a resistor of course.

However I want to use my newly bought WESP32 https://wesp32.com/ which is powered by POE. As of the schematics it can provide 5V V-OUT but not 3.3V.

I use this sensor Force Sensitive Resistor - Long - SEN-09674 - SparkFun Electronics

I am not much an expert on electrical things though. Do I understand correctly that I can hook-up the sensor also to 5V and just the resistors value varies compared to 3.3V?

I dont want to fry anthing and would be glad to get some assistance from you :slight_smile:

A quick glance at the datasheet suggests that V+ is 12 volts by default, and 5 volts if you solder a jumper. However, there is also a 3.3v pin. “3.3 V output with up to 6 W output power available (power taken from V+)”

The FSR itself could handle the 5v fine, but you don’t want to apply 5v to the ADC input. Unless I’ve misunderstood the datasheet, use the 3.3v output.

1 Like

thanks a lot for your reply, you are right. actually I just noticed that Pin also delivers 3.3V so it should be fine. I wonder why I didnt see that before…


2

(this comment was moved from another topic about the Elevated Sensors pre-built bed sensors)

I was testing a FSR today, hoping to build a DIY version of one of these, and at one point, I lifted myself out of bed, my full bodyweight (about 70kg) pressing onto my hand for a moment. As luck would have it, my hand on the mattress was right above the resistor on its slat, and once that happened, my multimeter started giving wildly incongruous readings to what it was doing before.

That’s a problem for another thread, but I bring it up here because it causes me to wonder: what are the weight limits for the FSRs on your device, and would I need to worry that pushing down on the mattress just above the sensor might overload it?

Sound like to me you have a bad connection or solder joint…

My FSR goes up to 10MΩ. That gives one a huge range to work with.

What is the spec of your FSR and what is the value of your other resistor in the voltage divider/bridge?

The datasheet doesn’t explicitly mention a max pressure. It claims to saturate and not be able to measure anything above 150psi-200psi, but that is not when it would be physically damaged.

I went ahead and tossed a clamp on my test setup. That clamp claims to put around 600 lbs. of force when fully cranked down and it’s definitely not putting that force over an entire square inch. There was no damage to the sensor and it continued to report consistent values.

Add in a mattress on top spreading the load over the sensor, I don’t think anyone is going to be able to damage a sensor that is correctly mounted to a slat.

2 Likes

Thanks for the very thorough response! That’s more than sufficient for me to feel confident.

When I’ve got just a little more wiggle room in my budget, I’m excited to grab one of your sensors!

1 Like

Hi team, apologies but this is my first DIY ESP project (built entirely from the ground up).

I’m slightly confused by the resistor bit.
I’ve taken my average measurements per the instructions but my multimeter has lots of different Ω settings, 2M, 200k, 20k, 2k and 200. Is there a right/wrong one to use?

Using the 20k one I get an average value;

Rin_bed - 0.67
Rout_of_bed - 2.84

So I think R1 = 1.902 ?

If that is then right what resistor am I meant to use? A 1Ω, 2Ω or another?

Sorry, I appreciate this is probably a very simple/basic question for many but this is my first real attempt at basic electronics with 0 experience. I’ve done research but it’s all pretty overwhelming!

If you are on a k Ohm range on your meter then the reading is in kilo Ohms. So 1.9K Ohms, aka 1K9, or 1900 Ohms.

1.8K or 2.0K are the closest E24 series values, either will do.

1 Like

Thank you Tom, I really appreciate the help (and this awesome project).

Edit (19/10); I finished this project earlier today - all seems to be working as intended. Such a great project and I’m super grateful to this community and Tom for stuff like this. Though, I feel ESP could be a slippery slope!!

1 Like

Hi, just got a new mattress
I’m getting Rin= 0.9-1 MOhm when I’m on the bed but I’m not getting any values off the bed Rout
The multimeter only goes up to 200MOhm.
Anyway I could verify the Rout?

Btw, has anyone tried combining 2 units 600mm fsr strip into 1? I’d like for it to detect if I’m sitting on the edge. Not getting any reading with 1 600mm FSR positioned in the center of the bed

I’m using this resistor, and am having a great deal of trouble finding an English datasheet for it. It’s not yet installed, though; I’ve just been testing it under my bed with my multimeter and no other resistors in order to get a sense of the resistor values needed as described in this post.

What is the maximum value your multimeter can read in ohm?

And how is it connected? Crocodile clips may not be the best option.

What were your min and max readings, or is that what you’re saying is fluctuating wildly?

That other post is a great place to ask those questions. I’ve seen a variety of posts about that sensor over there, so you may find some good info. This thread is focussed on a particular product, so it’s less relevant here. Thanks!

That’s totally fair, Stephen, apologies.

I’ve moved these posts over here to keep Stephen’s topic about his (excellent) sensor.

For anyone daunted by the DIY required for this sensor please check out Stephen’s pre-built sensor, highly recommended: Bed Presence for ESPHome by Elevated Sensors

3 Likes

My multimeter is listed as having a range of “999.9Ω/9.999kΩ/99.99kΩ/999.9kΩ/9.999MΩ/99.99MΩ±(2%reading+10)”, and it’s in an auto-adjusting mode.

I’ve just now tested it with hooks clipped to the probes and the resistor leads—thanks for the tip! My resistance is still fluctuating, though; in the last 25 minutes, with no changes to the setup, I’ve watched it go from 97.5kΩ up to 108kΩ, and then steadily decline to around 45.5kΩ, all with an empty bed.

My mattress is memory foam, so I wonder if I’ve been seeing the foam decompress?

Perhaps, though I’m not sure how decompression would affect the weight, but perhaps it affects weight distribution. 25 min also seem long, but I don’t have a memory foam mattress.

I definitely see this with my memory foam mattress.

This graph is pressure experience by the FSR, but you can just think of it as the inverse of resistance. So for my setup, the resistance sky rockets right when I get out of bed, then decreases over time and levels out.

My theory is that the mattress rebounds up when you get out of bed (decreasing the weight on the FSR), then increases its weight on the sensor as the mattress fully relaxes.

1 Like