Zigbee Bed Presence Detector

by EricV15 in Circuits > Sensors

2118 Views, 2 Favorites, 0 Comments

Zigbee Bed Presence Detector

xiaomi-door-window-sensor-review-hd-intro.jpg

For some time now i was looking for a way to detect when we are in bed. This for using this information into Homeassistant.

With this information i could make automations for turning off lights at night or for example activate a alarmsystem in my house.

I wanted it to be simple too make and without any powerwires or wifi modules.

So i got these Xiaomi aqara window/door sensors that i already used around the house for some detections.

They work with a reed contact and magnet. Since the reed contact is just like another switch, i could use other switches to activate the sensor.

And so get the info through zigbee into my homeassistant enviroment.

Supplies

  • Aquara window/door sensor
  • tactile switches
  • wires
  • connector(male and female)
  • strips of some flexible material, i used forex (0.5cm thick)
  • strips of thin styreen
  • some thin foam
  • sticky tack
  • tape
  • Double sided thin tape
  • soldering iron and solder
  • 8mm drill

Preparing the Aqara Sensor

20201226_152726.jpg
20201226_153251.jpg
20201226_153305.jpg
20201226_153359.jpg
20201226_133402.jpg
20201226_133421.jpg

First we will prepare the sensor so we can connect some switches to it.

Open up the sensor with a screwdriver (gently its plastic) and remove again with the screwdriver the inner plastic part. Watch out when you remove the sensor from his casing a little button will fall out.

Then solder 2 wires to where the red arrows point. Make the wires approx. 20cm long.

Drill 2 holes in the sensorcasing to passthrough the wires.

Now you can put the sensor back together.

Dont forget to put back the little button.

Adding Connector to Sensor

20201226_113035.jpg

Now you can solder the female part of your connector to the 2 wires.

I have used some XT60 connectors i had lying around, but you can use other types.

Make Strips With the Switches in It

20201226_113053.jpg
20201226_133813.jpg
20201226_113100.jpg
20201226_113107.jpg
1dc0f892575a3843f019300a93dbd8de97ca6b2a.png

Now make some forex strips 3cm x "half the width of your bed minus 20cm" . see first picture. So the strips do not stick out from under your matras.

For me the length of the strips were 60cm. Bed is 1m60 wide.

Then drill 8mm holes in the center(width) of the strip. I used tactile switches that fit in the 8mm holes.

I used 9 switches and distributed them over the length of the strip ( approx 7cm apart).

Then i made a little tool (black strip with white hole) to help me allign the switches with the strip when putting them in.

Then gently push the switches in the holes and on the other side of the strip bent the legs of the switches

Soldering Switches

20201226_120826.jpg
20201226_121701.jpg
schematic.png
20201226_141439.jpg

Now we will solder the switches together in paralel so when either one of the switches is pressed the sensor will be activated.

When this is done solder at the middle switch 2 wires ( 30cm long).

Now make 2 of those strips.

And solder from each strip the 2 wires to the male connector.

Before going futher first test your swithes if they work with a multimeter.

Finish Bottom of the Strips

20201226_133541.jpg
20201226_122201.jpg
20201226_122155.jpg
20201226_122234.jpg
20201226_122336.jpg

Now we can finish the bottom off the strips.

I have put some sticky tack onto the bottom of the switches so they can not be pushed trough when lying on the bed.

Then i taped the wires so they can not come lose.

Finish the Top Off the Strips

20201226_133517.jpg
20201226_133510.jpg
20201226_141747.jpg
20201226_141812.jpg
20201226_143646.jpg
20201226_143653.jpg

For the top off the strips i used 3mm foam and 2mm styreen to make a cover over the switches so they are just pushed when you lie on the bed.

Make some small pieces of foam and place them between the switches. Attach them to the forex with double sided tape.

Then place the styreen toplayer onto the foam with the same tape.

So now we are ready to install the sensors.

Installing the Sensors

20201226_143955.jpg
bedopstelling.png
beddetectie in home assistant.png

Put the sensors underneath your matras.

Put one strip where your upper body will be and the other where you lie your bottom down.

Sensor inbetween them.

Before installing dont forget to pair your sensor with your zigbee router and test it.

The reason for using the 2 strips per person is that with 1 strip i had false readings through the night because off moving in the bed. With the 2 strips placed at those locations i had the best results in my testing period.

Onto Automations.....

So now you have installed your sensors and imported the data in your home assistant environment, you can create all sorts of automations with it.

Enjoy...