In this tutorial we will show you how to build a motion sensor that can wirelessly switch a light in a different location. The light will stay on for 5 minutes and then go off automatically. You can configure the default 5 minute setting as detailed below in the software section. The transmitter is able to send signals from two motion sensors and the receiver has two relay switches that will switch depending on which motion sensor was triggered.
WARNING : Mains electricity can kill if you are careless or lacking in knowledge of how to connect high voltage.
What you will need:
Unlike many of our projects this project does not require a microprocessor like the Raspberry Pi or Arduino.
If you do not want to program the wireless receiver yourself and wish us to pre-program the device with the software required for this project, please include that note in your purchase. The wireless receiver is a programmable device based on the popular Arduino Uno (Atmega 328). If you want to learn how to program this device see this section of this website.
Step 1 - Build the wireless Motion Sensor. This tutorial does talk about linking the sensor to your PrivateEyePi alarm system, but this is not required for this project. You can however use this wireless motion sensor as dual purpose, if you like. It can be used to switch lights as well as send motion detection signals to the PrivateEyePi alarm.
Step 2 - Build the wireless Dual Relay Switching Kit. This build guide is not our tutorial but it is very comprehensive.
Step 3 - Wireless Receiver
Solder the two 10 pin headers into the row of holes either side the receiver. Then solder the antennae in the position shown in the following diagram:
Installing the software is optional as we can pre-load the software for you providing you include a note in the comments of the purchase. The following code is standard Arduino Uno code. This section shows you how to configure a development environment for the receiver (Rfu-328).
Take note the DEVICEID setting. The DeviceID of your wireless transmitter must be the value specified in the code (30 in this case).
If you want to change the timer interval for the lebgth of time the light stays on then change the setting in the following line which is set in milliseconds:
unsigned long interval = 300000; //300 Seconds or 5 Minutes
Paste the following code into the Arduino IDE and download it to the receiver: