Construct a wireless switch or motion sensor

Project Description
This project assumes you already have a Model A or B Raspberry Pi, power supply, HD card, screen, keyboard, network etc. Raspbian Wheezy OS.
In this project I will show you how to construct a wireless switch. This project can be adapted to suit any application where you need a wireless switch communicating to the Raspberry Pi. When the switch is closed or opened a wireless signal is sent to the wireless base station receiver. The transmitter can support two separate switches off the same RF transmitter. You can connect as many transmitters as you like.
Construct a wireless switch or motion sensor

What you need

The RF parts can be purchased from the PrivateEyePi Store

  • 1 or many Wireless switches (RF05) or Motion Sensor Kit (RF07)
  • 1 x Wireless sensor kit (RF04). This is a really nice kit that contains the PCB, coin cell battery battery and casing and plug in slot for the wireless switch transmitter


  • If you choose not to use the wireless sensor kit then you may want to consider using 2 x 2mm 10 pin (RF08) headers to plug into the RF sensors in order to avoid having to solder wires directly to the RF sensors. You will also need a 3V power source (e.g.2 x AA batteries), a 10k resistor and a 100uf capacitor.

How it works

The sensor will transmit a signal to the base station when the attached switch changes state (off/on). The transmitter is optimized for extremely low current consumption so that it is able to last over a year on a single set of batteries, or 1 coin cell if you are using the wireless sensor kit (RF04) . The RF units are very powerful and should easily handle communications distances around a residential home. The antennae of the transmitter can be adjusted for longer distances, or for greater strength to compensate for walls or other physical barriers. The transmitter comes pre-configured with a unique number identifier that will be used to uniquely identify the sensor.

This enables you to have as many wireless sensors as you want. Each switch that is attached to the sensor is identified as Switch A and Switch B in the serial message received by the Raspberry Pi. The Python code required to read the the serial communications stream is provided. We also provide the code to send the sensor status value to the PrivateEyePi server to be displayed on your WWW dashboard; however this is not a mandatory part of this project. If you want a wireless switch sensor for other projects then these steps will help you achieve that goal too.

Construct a wireless switch or motion sensor Schematic


1. Construct a wireless switch using the wireless sensor case kit

Build the wireless sensor kit (RF04) and plug the RF transmitter (RF05) into it.

The RF transmitter (RF05) looks exactly the same as the receiver units (RF01) so be careful not to mix them up. The packaging of the receivers and transmitters will be clearly marked so you know what is what. If you do mix them up them some trial and error testing should solve the problem. Plug the RF transmitter into the wireless sensor case kit (as shown above).

That’s it! Now you are ready to install the software.

About The Author

Scroll to Top
Read previous post:
Installing and running PICPgm on Raspberry Pi

Installation Steps The following commands download and install PICPgm on your Raspberry Pi: cd ~ mkdir picpgm_install cd picpgm_install wget...