{"id":4647,"date":"2017-05-04T09:21:32","date_gmt":"2017-05-04T13:21:32","guid":{"rendered":"https:\/\/24-7-home-security.com\/?p=4647"},"modified":"2022-02-20T20:15:00","modified_gmt":"2022-02-21T01:15:00","slug":"how-to-make-a-wifi-bed-occupancy-sensor-arduino","status":"publish","type":"post","link":"https:\/\/24-7-home-security.com\/how-to-make-a-wifi-bed-occupancy-sensor-arduino\/","title":{"rendered":"How To Make A WiFi Bed Occupancy Sensor with an Arduino"},"content":{"rendered":"
Want your home automation system to be smarter and know when you\u2019re sleeping?<\/p>\n
Like the idea of arming an alarm or using dimmed lights when you\u2019re in bed at night?<\/p>\n
This guide for how to make a bed occupancy will walk you through exactly what you need and give you some ideas about how to tie it into your system.<\/p>\n
In this guest post from a fellow tinkerer, we\u2019ll cover:<\/p>\n
My bedroom lights were driving me crazy – they worked great when the PIR sensor detected someone entering the room and turned them on, but, not so great when I triggered the sensor in my sleep, or if I got up in the middle of the night to use the restroom, or if someone came into the room while I’m sleeping.<\/p>\n
I needed a way for the controller to know when I was in bed and when I wasn\u2019t \u2013 and how long on both accounts. Using that information, I could set the house in or out of sleep mode \u2013 which controls temperatures, security cameras, door locks, and lighting events \u2013 most importantly, whether the bedroom lights turn on and at what brightness.<\/p>\n<\/div><\/div><\/div>
Of course, the ways that I use my bed sensor could be expanded and improved. Here are some other ideas:<\/p>\n
It’s possible I missed other brilliant ones. Be sure to drop a line in the comments below with your awesome idea to deflate my ego. My wife will thank you.<\/blockquote>\nHow I Hacked Together a WiFi bed occupancy Sensor<\/h2>\n
The solution I used was to place a Force Sensitive Resistor (FSR) between the mattress and the box springs. I\u2019ll go through the pros and cons of my setup, and you can also check out other options below.<\/p>\n
Here\u2019s an overview of the components I used:<\/p>\n
\n
- Arduino Uno<\/a> w\/ Ethernet Shield<\/li>\n
- 24″ Force Sensitive Resistor(FSR)<\/a><\/li>\n
- Voltage divider<\/li>\n
- Old WiFi router used as a bridge for the Ethernet shield<\/li>\n
- Homeseer3 (my existing controller)<\/li>\n
- Homeseer3 Arduino plugin<\/li>\n<\/ul>\n
The Uno + Ethernet shield + router could be replaced with an esp8266 + Wi-Fi for less money. You can get a barebones esp8266 off of aliexpress for about $1.20 per.<\/p>\n<\/div>\n
Hardware Components<\/h3>\n
The FSR is wired through a voltage converter to an Arduino. The FSR sits between the mattress and the box spring and connects to the voltage divider and onto the Arduino. The Arduino takes a measurement on an analogue pin and sends that value to the Homeseer Arduino plugin (over TCPIP). The plugin converts that value to 0-100%.<\/p>\n
<\/p>\n
24 Inch Force Sensing Resistor (FSR) Strip [Interlink] \u2013 $18<\/strong><\/p>\n
http:\/\/www.trossenrobotics.com\/p\/24-inch-force-sensing-resistor.aspx<\/a><\/p>\n
<\/p>\n