Wireless Relay Project

This project will show you how to switch wireless relay switches (shown in the Figure 1) from your Raspberry Pi using your smartphone or a web browser.

Option 1: Duel Wireless Relay with Enclosure:

Figure 1 - Duel wireless relay kit


Option 2 : Wireless switch with one or two external relay switches (one depicted below)

Figure 2: Wireless relay switch components


Hardware requirements:

Option 1:

  • Wireless dual relay module for switching kit (RL02)
  • Wireless Relay Switch Receiver (RF09)
  • External 6-12V supply (battery or power supply)

Option 2:
  • Wireless sensor case kit (RF04)
  • Wireless relay RF module (RF09)
  • Relay switch (RL01)
  • External 3V battery supply

Hardware construction

Option 1:

Option 2:
  • Construct the sensor case kit
  • Construct the relay switch
  • Connect the power and ground from the external battery to the 3V and GND pad on the wireless sensor case kit
  • Connect the power and ground from the relay to the 3V and GND pad on the wireless sensor case kit
  • Connect the wire labelled IN on the relay kit to pins 8 or 9 on the wireless sensor case kit breakout board. This RF unit can switch 2 relay switches independently. Refer the Wireless Relay Switch section of this tutorial.
WARNING : Mains electricity can kill if you are careless or lacking in knowledge of how to connect high voltage.

Software


Instead of sunning webgpio.js you will run webserial.js. Check that it works by typing the following command:

Code:
node webserial.js

The application should start and print the following message to the window:

Server running at http://youripaddress:8000/

That's it! Now you can move to a web browser on another PC or smart phone and navigate to the IP Address of your Raspberry Pi. We have set the server to run at port 8000 so you will type the following address into the browser:

http://youripaddress:8000/

Where youripaddress is replaced with the IP Address of your Raspberry Pi. 

The screen should display a web page with an on and off button. 

I hope you have enjoyed this project. If you are in need of help feel free to email us at support@privateeyepi.com. 

Please support us by donating or purchasing your project parts from our store.

Comments