In this tutorial we will show how to use Raspberry Pi and relay module as internet controlled switch. You can control up to 17 devices over internet by your phone or remote computer.

 

1. Materials

  • Raspberry Pi
  • Relay module

See buying guide at the end of this tutorial.

  • Relay module

Raspberry Pi

2. Connect wires

Conenct relay and Raspberry Pi. In this case we will use only one relay, but you can use up to 17 relays. Connect GPIO 5V VCC and GND to relay. Then connect relay IN to GPIO pin 7 (GPIO04).

Next connect relay to light or other device.

3.Installation and configuration

Install EasyIoT server to SD card. You do not need NRF24l01 connected to Raspberry Pi if you are using only GPIO driver. After installation switch on Raspberry Pi. Go in WEB browser on computer and type Raspberry Pi IP address (computer must be on the same network as Raspberry Pi). Use username admin and password test when asked. Go to Configure->Drivers->Raspberry Pi driver and enable driver. Be sure to select right version of Raspbery Pi board. You can use all GPIO pins (17). In our case we wil use only Pin 07 (GPIO04). Next enable Pin_P1_07 as output.

 

 

 

Then go back to Configure->Groups and modules and add new module to group. And that's all. Now you can see switch on front page.

4. Test

Go on front page and select pin you just added. Try to switch relay on and off.

 

See more tutorials at ​http://iot-playground.com/build​

 

Buying guide

To support this site and EasyIoT framework development please buy in our store.

RASPBERRY PI 3 - Model B. 1GB RAM

New Raspberry Pi 3

Raspberry Pi 512MB Model B +

Raspberry Pi Model B+, ARM1176JZF-S Running at 700MHz, 512MB RAM.

MICRO SD 64GB 32GB 16GB MEMORY CARD

5V 2A Charger Micro USB

For Raspberry Pi or sensor modules, cheap and easy power solution.

Acrylic Case Shell Enclosure for Raspberry Pi B+

1 Channel Isolated 5V Relay Module

Be able to control various appliances, and other equipments with large current.

2 Channel 5V Relay Module With optocoupler

Be able to control various appliances, and other equipments with large current. 2 channel.

4 Channel 5V Relay Module With optocoupler

Be able to control various appliances, and other equipments with large current. 4 channel.

8 Channel 5V Relay Module With optocoupler

Be able to control various appliances, and other equipments with large current. 8 channel.

 


Comments   

+1 #3 Soprano 2016-03-19 00:47
Hi, I am struggling in installing the EasyIoT server in my raspberry pi. Can you please clarify me the steps. I have tried to download the software but it does not have the "img" extension but instead it has "avr" extension. please help me therre.
Thanks
+1 #2 Super User 2014-12-09 09:11
Quoting Dany:
Can I use with RPi B+, too?

Yes, just select Raspberry Pi version "B+" in driver config.
#1 Dany 2014-12-08 19:22
Can I use with RPi B+, too?

You have no rights to post comments