Internet-connected Light Switch

Introduction: Internet-connected Light Switch

In this tutorial we will show how to create internet connected switch with Raspberry Pi and relay module. You can use internet switch to remotely control up to 17 devices (light, heater,sprinkler..) over internet. You do not need programming skills.

See more tutorials at

Step 1: Materials

1. Raspberry Pi

2. Relay module

Step 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.

Step 3: Install and Configure EasyIoT Server

Download EasyIoT server image and store it to SD card. Put SD card to Raspberry Pi and switch on. Windows users can write EasyIoT server image to SD card with Win32 Disk Imager.

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. 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.

Step 4: Test It

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

Check also ESP8266 only internet connected switch:

See also other ESP8266 tutorials.



    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest
    • Tiny Home Contest

      Tiny Home Contest

    7 Discussions

    is it only useable if the computer and the pi is on the same network? if so, can it be done so it is possible to connect thru the web, for example, on the phone so i can start my pellet oven some hours before i come home?

    1 reply

    yes, you can use this over internet but you have to setup few things. like webhost as well as you must know where to send the command in which you need domain name or you can also use kind of service for this in free of cost. google it you get more detailed information on this.

    Yes, you can do this with EasyIoT server on Raspbery Pi and Arduino as node. On Arduino node you can implement switch or relay (see architecture on our website). Right now EasyIoT server supports MySensors protocol (NRF24L01 module) to communicate with EasyIoT server, but in next release we will add ESP8266 WiFi module and you will have more options to connect Arduino with EasyIoT server.