Over the year's I've tried almost every possible home automation sensor to determine which ones
work well and provde to be reliable.
Uses for sensors can be divided roughly into people motion sensing, people presence sensing, environment sensing (temperature, pressure, solar input, gas and particulates) and indirect sensing.
Indirect sensing is a useful technique for monitoring equipment without making any electrical connection to it. For example you can check that a fridge is working reliably and that the door has not been left open by monitoring the temperature on the motor or cooling coil. If it cycles regularly the fridge is working. If it's above average for a long period then the door is open or there is some other problem with the fridge.
In choosing a sensor for home automation there are many factors you should consider:
Reliability - my top criteria because a sensor that fails even occasionally is useless.
Accuracy - for sensors that read analog values what is their precision and how stable are they?
Latency - how quickly does the sensor fire after motion has happened. Some PIR sensors wait until
they have seen three pulses before firing.
Repeat rate - how quickly the sensor recovers and is willing to fire again. Some battery-powered alarm sensors wait up to three minutes between firing in order to conserve battery power.
Noise or False trigger susceptibility - Microwave-doppler radar sensors provide great coverage and are cheap but they fire for no apparent reason. Some humidity sensors are quite random in their output and require severe filtering.
Person-discrimination capability - can the sensor tell the difference between a human and a dog or cat?
Wiring complexity - the one-wire bus makes it easy to link many sensors with a single very long CAT5 cable.
Aesthetics: most PIR sensors are ugly whereas under-floor strain-gauges are invisible.
Power consumption - not a factor except for some remote battery operated sensors.
In terms of people-detecting sensors I would rank them as follows:
Under-floor strain gauges: invisible, very reliable, good cat and dog discrimination powers.
Physical contacts on doors and windows - the typical alarm system sensor.
Optical-beam with two or more beams: can cover a large gap like a garage entrance or barn aisleway.
PIR - cheap and readily available.
Bluetooth - the only sensor that can count people (phones) in a room without a camera.
Microwave-doppler - cheap but needs logic to clean up false triggers and to reason about which rooms are occupied.
Indirect sensing - CO2, temperature, pressure can all aid in detecting the presence of people
In addition to people sensing you need several other key inputs for a complete home automation system, here's my top list for those:
Outdoor light sensor. A simple LDR suffices but you can also get multi-spectral sensors.
Temperature sensors for living spaces. Essential for any control of HVAC systems. The DHT22 or BME680 are good choices here.
Humidity sensors like the DHT22. These are useful for controlling bathroom fans and preventing condensation.
Temperature sensors for equipement. DS18B20 sensors on a one-wire bus are my favorite here given their reliability, accuracy and ease of wiring.
Gas sensors. Detecting CO2 levels in a room can help trigger ventilation. VOC sensors may be useful too but harder to calibrate.
Pressure sensors. I have some, the graph is mostly a flat line. Not very interesting. May be useful inside the HVAC system to detect airflow or blocked filters.
I've been working on home automation for over 15 years and I'm close to achieving my goal which is a house that understands where everyone is at all times, can predict where you are going next and can control lighting, heating and other systems without you having to do or say anything. That's a true "smart home".
My year long Bluetooth project that won the $20,000 HCI and Microsoft competition during lockdown has continued to grow and now reliably tracks how many people are in the house and outside and can locate any device down to room level.
Digital Twin are an online representation of a real world object, a copy of its properties in the digital world and a way to send updated and commands to it. In effect I've been making them for years but now they have a trendy name.
ESP32 provides a great platform for sensors around the house but by the time you've added a USB power brick, cable and enclosure it's quite messy. I wanted a device that I could just plug in with no exposed wires and no mounting needed so I designed one in OpenSCAD.
Bluetooth sensing for home automation is a great proxy for people counting as it can detect and locate each cellphone in the house. iBeacons attached to tools, cars and pets can provide a 'find my anything' feature too.
Having at least one light sensor is critical for any home automation system that controls lightng. Lights need to be turned on when it's dark not at specific times of day, especially here in Seattle when it can be dark and cloudy at any time of day.
Microwave doppler sensors can be found in some alarm sensors but there are also available very cheaply as a separate component. They offer exceptional range but suffer from false triggers requiring a probailistic approach to people sensing.
Home automation systems need to respond to events in the real world. Sometimes it's an analog value, sometimes it's binary, rarely is it clean and not susceptible to problems. Let's discuss some of the ways to convert these inputs into actions.
An if-this-then-that style rules machine is insufficient for lighting control. This state machine accomplishes 90% of the correct behavior for a light that is controlled automatically and manually in a home automation system.