I have a Force Sensing Resistor under one foot of my bed for testing purposes. If I can get this to work properly I'll add a second FSR to the other side so occupancy can be sensed on L/R of the bed.
Without the mattress on the bed, the starting voltage is about 3V. Then, when I sit on the corner of the bed frame, the voltage drops down to only around 2.80v. I weigh more than 100kg so the reading doesn't drop any further than this. If/when I put the mattress down (I'm yet to do so), I presume the starting voltage will drop a bit from 3V, say down to 2.95V, and then if I were to lay on the bed, my lower body will be the only additional pressure, so I don't expect the FSR to receive a full 100kg; the voltage might drop down only to around 2.85 - 290V. This isn't enough of a voltage shift with which to create a reliable binary sensor for bed occupancy..
When I tested the ohms of the FSR with my multi-meter (initially, with the mattress still on the bed at the time) I had a starting reading of around 124k and a reading of around 110k when I laid down. Based on this, I understand the resistor I should use for R1 is SQRT(124k x 110k) = 117k but when I do so the starting voltage is much lower than 3V, so I've arrived at 10k via trial and error.
Does anyone have a good idea as to how I could maximize the drop in voltage when I lay down? The reading doesn't need to start at 3V; I'm really only concerned with maximizing the variance in voltage between bed occupied/unoccupied so I can set a reliable trigger level for a binary sensor.
You use 3.3volt pull up, so I assume you use a 3.3volt-logic processor.
You should have included which board you use.
The FSR is most sensitive (most different A/D values) when FSR resistance is about the same as pull up resistor value. It seems the sweet spot is a pull up resistor of about 100k, not 10k.
At those values you should double-read the A/D, and/or add a 100n ceramic cap from pin to ground.
Leo..
I am working on this project offsite, so I was able to return today. Here is an update:
I took new readings with the multi-meter and got a starting reading of 155k, then 105k when on the bed. I've found decent success with 100k resistors and I'm relatively happy with the outcome. It's nowhere near as reliable as 10kg FSR on the slats under the mattress, which is my main sensor for the bed. I just had these 150kg FSR lying around and thought I'd try them as well.
You are working with a mechanical device that varies it's resistance. The resistance range, whatever it is, is fixed and cannot be changed.
Your only way to make a mechanical device more sensitive is to use levers to multiply the force and use more of the devices resistance range.
Thank you for the replies. I've looked up operational amp and Wheatstone bridge. It's always interesting to learn a bit about these components that I've (usually) seen on PCBs but have known nothing about.
One thing I did, which I presume was helpful: use the 5V pin on the ESP32 instead of the 3V3 pin.
I made a bed occupancy monitor for checking on my elderly mother using an FSR and the voltage divider approach. Worked fine. You shouldn't have to use levers, op amps, etc.
But you should use a hard "puck" to concentrate the load on the sensing area. From the very helpful Tekscan Integration Guide:
And a smooth rigid surface should be below the FSR.