# Home Automation using Raspberry pi

**URL:** <https://forumautomation.com/t/home-automation-using-raspberry-pi/10427>\
**Category:** Electronics\
**Created:** [May 21, 2022, 5:48am UTC](https://forumautomation.com/t/home-automation-using-raspberry-pi/10427 "2022-05-21T05:48:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajmal\_ismail](https://forumautomation.com/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@Ajmal\_ismail](https://forumautomation.com/u/Ajmal_ismail)\
**Post date:** [May 21, 2022, 5:48am UTC](https://forumautomation.com/t/home-automation-using-raspberry-pi/10427/1 "2022-05-21T05:48:26Z")

</div>

In this article, we are introducing how to implement simple home automation by using a Raspberry Pi. By using the following method, you can control your devices in your home remotely by using your smartphone

[Home automation using Arduino uno](https://forumautomation.com/t/home-automation-using-arduino-uno/10410)

**Components Required to Perform Home Automation Using Raspberry Pi**

**Hardware Requirements:**

- Raspberry Pi 3 (Any other Version will be nice)
- Memory card 8 or 16GB running Raspbian Jessie
- 5v Relays
- 2n222 transistors
- Diodes
- Jumper Wires
- Connection Blocks
- LEDs to test.
- AC lamp to Test
- Breadboard and jumper cables
- 220 or 100 ohms resistor

**Software Requirements:**

In addition to the Raspbian Jessie operating system on the Raspberry Pi, we will use the WebIOPi framework, notepad++ on your PC, and filezila to copy files from the PC to the Raspberry Pi, particularly the web app files.

**Hardware Implementation**

 ![image](https://cdn.forumautomation.com/original/2X/f/f61bb1027112962f6ac27d1c9b9c3848d79b858c.png)

**Preparing the Raspberry Pi:**

This section will cover the Pi upgrading procedures as well as the installation of the WebIOPi framework, which will enable us to handle communication from the webpage to the Raspberry Pi. I should definitely mention that this can be done in an arguably easier method using the Python Flask framework, but one of the most intriguing aspects of DIY is looking beneath the hood and doing the arduous work. That’s where the fun of DIY comes in.

To update the Raspberry Pi, run the following commands and then reboot it.

_sudo apt-get update_

_sudo apt-get upgrade_

_sudo reboot_

After this, we need to install the WebIOPi framework

_cd ~_

use _wget_ to collect the file from their source

_wget_ [_http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz_](http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz)

after download is finished, go into the directory after the extraction

_tar xvzf WebIOPi-0.7.1.tar.gz_

_cd WebIOPi-0.7.1/_

Before executing the setup, we need to install a patch because this version of the WebIOPi does not function with the Raspberry Pi 3 that I am using, and I couldn’t find a version of the WebIOPi that does.

Run the following scripts to install the patch while still in the WebIOPi directory:

_wget [https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch](https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch)_

_patch -p1 -i webiopi-pi2bplus.patch_

Then we can run the WebIOPi installation setup

_sudo ./setup.sh_

If ask proceed while installing, do iy and after the setup installation need to reboot the Pi

_sudo reboot_

**Test WebIOPi Installation:**

Before we go into the schematics and programming, we’ll need to test our WebIOPi installation to make sure everything is working properly.

Execute the command;

_sudo webiopi -d -c /etc/webiopi/config_

Return to the webpage after connecting and click the pin 11 button to turn on or off the LED. We can now use WebIOPi to control the Raspberry Pi GPIO.

If everything worked as expected throughout the test, we can return to the terminal and terminate the programme with CTRL + C.
