EDIT: I no longer recommed this method. I use this instead, FSR - the best bed sensor
I’ve been trying a few things for a bed occupancy sensor.
An MS5611 pressure sensor ‘sealed’ in a waterproof flexible phone case or in a silicone tube did not work. The air leaked out of both rather quickly.
I’m now using a cheap eBay strain gauge glued to one of my bed slats. Connected to the A0 input of a Wemos D1 mini runing ESPhome. It does not give a huge voltage swing (0.6V to 1.3V) but I think it will be workable.
I tried a very thin smear of 5 minute epoxy but that did not stick well to the sensor. Cyanoacrylate (super glue) seems to be working.
Close up of sensor glued to the slat:
The housing was a re-purposed plastic box I had lying around that fit perfectly.
Just before turning the slat over and putting the mattress back:
That grey ‘non-structural’ text is certainly true. I snapped one of the slats though a knot just by leaning on it. Got some replacements from the hardware store easy enough.
There is a fairly clear delineation between being in bed and not. This will improve once I can get windowed averaging working on the ESPhome module again, to reduce noise and spikes from me moving about. This dip is me lying on the bed:
It will be interesting to see what my usual tossing and turning looks like tomorrow morning.
If this doesn’t end up working I have some Velostat on order as a backup.