I disagree. Yes, a capacitive touch sensor/screen works when a conductor (your finger) disrupts the electrostatic field. However, it is near impossible for a touch to register through a mattress. As I explained in my previous post, the capacitance of this sensor change because of the change in distance between the two plates. The paper is not compressing, it is the tin foils that are pushed together. Although the change might be slight, it is enough to tell the difference.
The original poster linked to this blog for making the pressure mats, more info can also be found there.
The weight of the mattress will compress the foil hard up against the paper. There would be no “gap” to change. Even if there was a gap initially, the sensor should become unresponsive over time.
If it does indeed work this way, bubble wrap (as suggested earlier) would make a much better dialectic.
So a more responsive sensor would require a flexible dielectric that won’t compress over time.
Open cell foam would be bad.
Closed cell foam would compress a bit initially but retain some 'springyness". Tiny bubble wrap would probably work too, though the flat surface of closed cell foam would make it easier to construct.
It made the sensing range go to about 40 unloaded and 10-30 loaded, based on how closely I lay on top of it. It’s definitely sensing the pressure, not the capacitance of my body, as I can’t really change the value if I just move my body around it without pressure on it. I settled on a threshold of 20, and added a delayed_on_off: 1s filter for it, to not spam HA with events during the transition, or when it’s close to the threshold.
I was thinking about making an alternative sensor design, based on how Espressif recommends it. Sort of a big circular tinfoil part going to the sensing pin, and then another part of ground around it for noise isolation. But I foresee it as something a lot more fiddly, susceptible to electrical noise and harder to make.
I think the original design with the addition to something springy between the sheets of foils is a really great solution for a pressure sensor.
Another idea for cabling is that probably the ground cable can be daisy-chained between the multiple pads, reducing the amount of cables needed to connect to the node to n+1, instead of 2n.
That appears to be open cell foam. It will compress over time. See if you can find some closed cell foam.
Using the adhesive copper sheet I linked to in an earlier post could help with construction of this. It would be a truly capacitive sensor between the body and touch plate. It might help to make the sensing electrode at least as wide as your mattress is thick. Doesn’t have to be round. Square with rounded corners should also work.
You’re right, I’ll see if I can find some closed cell one. I agree that making this the “proper” touch sensitive way sounds like a fun project, however using those fancy copper sheets would make this project’s cost a lot higher, especially if you want to have multiple sensing areas. I don’t see the taped on wire ends going anywhere, but it’s definitely not that elegant.
Spray adhesive and the foil then. Glue it to a backing sheet of thick card and cut out a 3-5mm strip round the inner electrode foil (not all the way through the card!).
The capacitive sensor between the body and touch plate seems like a very interesting idea. However, I just don’t think the body would ever trigger the sensor through the mattress. Different dielectrics seems to increase the accuracy of the sensor though. In the original blog, I saw someone mention using plastic chip bags, might be interesting to try.
In the comments under the linked blog post, there is an idea about trying the foil of a potatoe chips bag. Anybody tried that?
I ordered an ESP32 from Amazon and it arrived today, I need to test this. I have another problem, because in Germany we normally have a slatted frame under the mattress, not a flat surface… I’ll take a look how this will work, if I do this with small stripes on a few of the slats.
One of our beds is actually also slated, I just put the pressure pad on the slats. Probably wouldn’t recommend it though since the results are far less reliable than the flat-surfaced bed. However, it does still work…
Is it possible to reduce the polling of the sensor? I think my mosquitto mqtt broker is getting flooded and cant handle all the incoming messages.
Log Details (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.1760921232
Source: components/websocket_api/http.py:141
Integration: Home Asssitant WebSocket API (documentation, issues)
First occurred: 1:02:11 AM (1 occurrences)
Last logged: 1:02:11 AM
Client unable to keep up with pending messages. Stayed over 512 for 5 seconds