PIR Sensors

This isn't really a new project but, a write-up of something we have had working in our current smart home for a long time now. The use of a Passive Infra-Red (PIR) sensor in each room of our house provides both intrusion detection and occupancy detection to our Home Control System (HCS).

We have used two types of indoor PIR sensors in our home but they are electrically very similar:

Quest PIR
The majority of the PIR sensors used in our home are Quest (Elite Security Products) devices. These are designed to work indoors with a 12V dc supply and draw 15mA. They have an internal relay which is used to switch a 12V signal and the relay contacts are normally closed. These devices are directional and need to point in the right direction. If bought in bulk, these work out at less than £6 each, which is much cheaper than any wireless PIR sensors you can buy.

Note that you can get these with 3 different lens types; a wide 'curtain' beam to cover a room, a narrow beam for corridors and a lens for rooms with pets in.

RF360 PIR
The other type of the PIRs used in our home are Texecom RF360 devices. These are designed to work indoors with a 12V dc supply and draw 16mA. They have an internal relay which is used to switch a 12V signal and the relay contacts are normally closed. This sensor is used in places where we want a full 360° coverage. Typically, this might be in the centre of an entrance hall or a similar large room.

Outdoor PIR
We also use a number of outdoor PIR sensors. This one is a cheap, waterproof PIR sensor bought on eBay. It has a light level sensor which we deactivate (to ensure they pick up movement during the day) and also has a built in timer (which we set to minimum). It uses a 12V dc power source and provides a 12V output.

Power & Wiring

All of the PIR sensors in our home are wired back to one single point, for connection to our Home Control System (HCS). This doesn't necessarily have to be the case but, we managed to run the wiring to do this fairly easily. In a new build, this is definitely the best way forward. If you can't do this, then all is not lost. You can run sensors to a common input board or module and use Ethernet IO capability to achieve the same result.

We are using standard 4-core or 6-core alarm cable, which is ducted and always hidden out of sight. It is cheap, reliable and there are no issues with long cable runs because of the very low currents involved. Because we are using 12V signaling, noise and interference is not an issue either. The Home Control System (HCS) end of the alarm cable is terminated with a 4-pin 0.1" series socket connector (Maplin part no. HB58N). This means the sensors can be plugged into any one of our various input boards. This makes them independent of the I/O technology used and keeps our installation future proof.

PCB mounted 4-pin plug
We currently expose the connections for sensors using a PCB mounted 4-pin plug. NOTE: for this second version, we have made the decision to change the pin order. This is something we really wanted to avoid but, it means we can use 3-way screw terminals. The fourth pin is used when a common connection is required to pass a signal to sensors connected to a board. The main example we have in mind here is the output from our twilight sensor. This means that some of our sensors can use this signal locally.

Inside the Quest PIR sensor
This is the view inside the Quest PIR sensor. The supply to the PIR sensor is also fed in to one side of the relay and the other side is taken to the output line. Because it is a normally closed relay, this means that the signal is active low. We can easily handle this in the HCS software though.

Interface

Our very first attempt used our 1-Wire input board to detect changes in PIR sensor state but, this technology is not fast enough to allow many sensors to be used. We subsequently migrated the PIR sensors over to a USB I/O board and this has been working reliably for a long time. We are also now using Ethernet I/O boards.

Software

The above approach means that our Home Control System (HCS) can see changes in state from all the PIR sensors and can use this to take appropriate action. Occupancy is used to extend and control heating, lighting, etc. and the PIR sensors also serve as intrusion detection sensors for when we are away from home. All PIR sensor activity is logged, so the HCS could also make predictions on occupancy in the future.

Our PIP sensors can generate a huge number of on/off events each day (over 7000) and our data visualisation project aims to help us infer insight and gain learning from all this data.

Conclusions

  • PIR sensors are the second most important sensors in your home (after door contact sensors) and are valuable for both security and occupancy data.
  • You must choose PIR sensors that are optimised for their location and application. This means wide 'curtain' lenses for room corners, 360º sensors for the centre of a large room and narrow beam lenses for corridors and walkways.
  • You must set up the PIR sensitivity depending on location and application. The Quest PIR sensors we use have a 'jumper' to configure activation on 1, 2 or 3 counted pulses.
  • Wired sensors are best! It can be a pain to run standard 6-core alarm cable to PIR sensors but it really is the most reliable method and enables a central power supply and 12V UPS to be used and ensure they continue to work during mains power failures. Wired sensors also give the best performance.
  • We have PIR sensors in every room except our bedrooms. A door contact sensor should be used in bedrooms to activate convenience lighting.
  • PIR sensors are the primary source of presence information in our home.

  • Wired PIR sensors are the only future-proof way of achieving this functionality. These PIR sensors and wiring will last tens of years. Replacement devices will be available for many years too. The modular nature of our installation means we can upgrade the processor part very easily but, even this will happily run for more than 10 years, without requiring any upgrade. Wireless home automation technologies and protocols to deliver the same functionality will be superceded in much shorter periods of time.

NOTE! PIR sensors often have a red LED in them to help you set them up and test their sensitivity. This is enabled/disabled by a little jumper in the device. The red LED is NOT meant to be left so that it flashes every time someone walks into the room!

Share ...
We are on ...
Facebook Twitter
YouTube Flickr Follow us on Pinterest