Introduction: Dual Purpose Security Light Using 315Mhz Tx / Rx

Another cheap timer conversion !

I purchased a security light for my rear garden.

I wanted it to serve two purposes.

1) To turn the light on for one minute when the back gate was opened - our garage is at the rear of the house so this is our most common access!

2) To provide light so my wife could feed our guinea pigs without using a torch! I randomly chose a 'time on' period of 8 minutes.

As I have no mains power at my back gate, I had to use a battery powered solution. The transmitter only uses power when the gate is open (via a micro switch).

I used press / release switch for the manual switch.

** Respect Mains Electricity, it will kill you !! **

Step 1: The 315 Mhz Receiver

The picture above shows the modified timer switch. See my previous efforts re these timers and the power supply.

The switch is activated via a 315Mhz receiver.

The length of time the relay is closed depends on the received information.

{ relay(16); // 8 mins } <<< 16 x 30 seconds


{ relay(2); }

The function RELAY{} is just a delay of 30 seconds, which is looped by the number of times by the variable passed!

The relay is powered on immediately the function is called & turned off after the preset time.

The transmitters have the code stored in EEPROM.

Step 2: The Transmitters

The transmitters are identical apart from the code stored in EEPROM.

There is no power on the arduino or the transmitter until the switch or micro switch is operated.

The switch must be closed for about 3 or 4 seconds. This gives the Arduino time to reset, read the EEPROM and send the code. All the work is done in Setup{}, there is no Loop{} code.

The Arduino is powered by a 9v battery connected to the RAW input, the transmitter supply is direct from the 9v battery. These transmitters can work with 5v to 12v. The higher the voltage, the better the transmission distance.

I attached a 17cm piece of wire for the aerial and put a 10uF capacitor directly across the supply on the transmitter pcb as these help with transmission distance.

Step 3: The Software

Sketches for using these transmitter / receivers are plentiful on the Web !

The code used was actually for the 433Mhz set, but apart from the frequency, their operation is identical!

The code is very simple and should be self explanatory.

I considered putting a light sensor on the device which I may do at a later date :-)

Arduino Contest 2016

Participated in the
Arduino Contest 2016