We have them placed under the sheets and mattress pad. When it is under the mattress pad nothing is disturbed when changing the sheets. I don't think it would work under the mattress unless it was really thin. I didn't do any testing on the max depth that it can sense but I would guess it's no more than 1".

Have you ever considered adding a weight/pressure sensor underneath the legs of your bed?

Yes, I actually have all the components to build a weight sensor sitting on my desk. I had originally planned to use them instead of the mpr121. The reason I didn't pursue it very far is I have a really heavy bed, I would have had to develop some custom platform for it to sit on and it costs more. So, to sum it up the capacitive sensor is easier and cheaper so I went with that method instead.

Realy cool project. Its very usefull ,but in my opinion,all this wires in a bed will cause problems in home:P how far it detect capacitance? if it was mounted on bed plataform would be acceptable (for wifes). OR use a load cell(20 to 100kgs maybe) on one of the foots of bed plataform

@Tmaster Sorry, I must have missed your comment. I think it probably detects around .5 inches. Maybe a little more. We have it under a mattress pad so wires are hidden and undisturbed when changing the sheets. I'd be interested in hearing how the load cells go. I vaguely remember reading that they start to lose their ability to detect if they are under constant weight. I'm not sure if that was just for detecting minor changes though. It may still work to pick up a body.

@petewill
Did you try to use the "virtual 13th pin" of the MPR121? It can be used to have the MPR121 automatically combine the values of (for example) the first four pins and was specifically designed to handle proximity detection instead of touch.
I wonder if this could theoretically cut down on the necessary calculations.

@Nicolas-M. I never tried it. I looked into it but didn't use it because I wanted to use the same device to monitor both sides of the bed. I have wondered this on occasion as well. It would be worth looking into if you decide to build one.

@petewill Ah okay, understandable. I thought about the pros and cons of using two MPR121, since they are extremely cheap (1-2$?), but it would mean more cables, so it would only be worth it if it improves accuracy. I finished rebuilding your setup a few hours ago but didn't have time yet to test it much, maybe I'll build the "virtual 13th pin"-variant aswell if I find the time.

@Nicolas-M. Yeah, they are definitely cheap. I can't remember why I wanted to do one. I guess because it was working and there was less to do.
One thing I would change is I wouldn't use the copper tape any more. I have found that it gets damaged (cracked/separated) rather easily. I have actually switched to a stranded copper wire (18ga I think) that I have removed from the housing and spread out flat. I make sure it's overlapping itself in somewhat of crisscross pattern. That way if one of the wires breaks it still will make connection with other wires. Hopefully that makes sense.

@Inso Unless there is another use for a PIR that I'm not aware of, a PIR will detect motion and when I'm sleeping I'm not doing much moving. With this sensor it knows when I'm in bed so the lights don't turn on and the blinds don't go up. Hopefully that makes sense.