Let’s make it…

The big idea for this sensor is that we make a capacitive pressure mat that changes capacitance based on the pressure applied. We monitor the change in capacitance using the ESP32 and in turn, can tell how much pressure is applied.

Step 1

We will start by making the pressure mat… Cut a piece of tin/aluminum foil around the same size as the paper you are using.

Aluminum foil cut roughly to the same size as the paper

Step 2

Cut the left and right sides of the aluminum foil to be around 1 cm/0.3 inch narrower than the paper on each side. Tape the top side (no need to cut it) to also around 1 cm/ 0.3 inch shorter than the top of the paper. Then strip a wire and tape it to the bottom side of the aluminum foil.

The sides are cut, and a wire is stripped and taped to the bottom

Step 3

Fold the bottom side of the aluminum foil, with the wire taped inside, so it is 1 cm/0.3 inch shorter than the bottom side of the paper. Tape all the sides of the aluminum foil to the taper.

Flip the paper around and repeat steps 1–3.

All the sides are taped to the paper

Step 4

Now you should have aluminum foil taped to both sides of your paper.

Voila. You have made your first DIY capacitive pressure mat! Optionally you can put it in a sheet protector for additional durability.

Now… you just have to make some more depending on the size of your bed. I would recommend 4 for a queen-size bed and 6 for a king-size bed.

I made 4 for my queen size bed

Quick note

How does this sensor even work you ask? The two pieces of aluminum foil with the paper in between form a basic capacitor. By no means am I an expert on capacitors, but a capacitor works as two conductive plates (in this case, the two pieces of aluminum foil) are separated by a dielectric/insulant (in this case, the paper). Charges cannot pass through the dielectric, hence positive charges accumulate on one plate while negative charges accumulate on the other.

Capacitors are often used in motherboards

The distance between the two plates affects the capacitance, which is how this sensor works. When there is a large distance between the plates, even a single charge on a plate would repel further charges from entering the plate. As the distance between plates decreases, they can hold more charges due to attraction from the other oppositely charged plate. That is why sitting on the bed (decreasing the distance between the two aluminum foils/plates) changes the capacitance.

Okay, now back to making the bed sensor…

Step 5

We are will now connect the mats to the ESP32… Take 1 wire from each pressure mat and solder them each in a pair to a jumper wire. For example, if you have 4 pressure mats, you would solder 2 wires from 2 pressure mats to a jumper wire and the other 2 wires from the other 2 pressure mats to another jumper wire.

This is how you should connect them

Step 6

Now take the other wire from each mat and solder them individually to a jumper wire.

This is how you should connect them

Step 7

We are almost done… Place your pressure mats under your mattress, each in a different position to get the best coverage.