Control your Home Appliances with GUI on Raspberry Pi

Control your Home Appliances with GUI on Raspberry Pi


We all use smart devices with screens and interfaces which makes devices easier to handle. Handling events with Graphical User Interface is easier. We know that there are hundreds of functions and events triggered on a single click, walkthroughs for controlling your appliances with GUI is here.

Developing your own GUI and triggering events based on a mouse click is easy and fun to do.

In this article, we will learn how to make our own GUI interface to control our home appliances. You can control your appliances by just using simple widgets of the GUI window. On a single click, you can turn ON/OFF your appliances.

Here, we are going to use a PiRelay GUI to turn ON/OFF our appliances. Let's begin with some brief introduction of PiRelay board and then we move on to the GUI part.

We are using python’s Tkinter module to create a GUI interface that interacts with our GPIOs directly or indirectly. There are endless possibilities when you start making your own GUI. 


PiRelay is a Raspberry Pi Shield with customizable GPIOs, LED indicators, and extended header for easy GPIO access. PiRelay can be used to operate almost all domestic appliances. It consists of 4 relays(5 Amp/240VAC or 10Amp/30VDC). Stack your PiRelay board on top of your Raspberry Pi. Connect your appliances using connectors.

Using the Graphical User Interface

Now, let’s start with the coding part.

Making your own GUI with python is easy. We will develop our GUI using Tkinter module of python. You can make your own interface or you can go directly to our GitHub link.

 At this page, you will find all the files related to PiRelay


To clone this directory you can directly go to the link mentioned in that page. To clone it, open terminal, and type

git clone

Go to PiRelay directory, and run file for a graphical interface.

You can develop your own GUI using our classes. In the PiRelay directory, you will find a, you can directly import that library into your program by

import PiRelay

Initialize with relay number

relay_1 = Relay(‘RELAY1’)

You will find a GUI file in it. Run this and you will see a small GUI window with control buttons. You can go through the program from that file.

gui 1

From the GUI can control your appliances by clicking on the buttons. According to your needs, you can now easily turn on/off your 4 appliances. If you want to turn on/off your all appliances at once, then you can do it by clicking on the “START ALL” / ”STOP ALL” button.

To go to our website you can directly click on the “sb component” logo.

Home automation makes our work easy. Sitting at one place you can control your appliances. Instead of going and turning on/off the appliances you directly do it by this GUI.

 Connecting Appliances with PiRelay

Relay has three output ports NO, NC, and COMM and two operating ports for triggering the relay. When there is no supply voltage to relay, COM is connected with Normally Connected NO pin. When the relay is triggered COM is shorted with Normally Open pin.

working on relay

All the relay outputs are marked as ‘Relay number’ on the PiRelay Board. Choose a Relay to operate, and connect one side of your device to ‘Com’ and another to ‘NO’ Normally Open side of the connectors.

relay connection

Now, you are ready to operate your devices with your Raspberry Pi.


Leave a comment

Your email address will not be published. Required fields are marked *

Please note, comments must be approved before they are published