How to build a open source home automation system with a Raspberry pi

At the time we are talking now, the industry follows the wave and put IOT "Internet of things" objects everywhere. I'm talking about your connected fridges, televisions, radios, cat feeders, etc. But if you are maker like me, you want to make your own DIY project to control whatever you want in your house or somewhere else. This is what this tutorial is for.

A maker built an home automation system with a Raspberry pi and a HTML & CSS page ''interface to control the Raspberry pi over the internet. The raspberry is considered as the client and the HTML & CSS pages as the server.

The interface has a button allowing the control a relay connected on the GPIO pin on the raspberry pi. I want you to understand that you can put anything with this relay and control it from anywhere in the world once you know your raspberry pi IP adress and your Router/modem IP adress.

To start the project, you need the following hardware:

  • A raspberry pi 3 (So you don't need a USB wifi dongle)

  • A 5V SPDT relay

  • A 9V battery

  • a 8 Gb SD card or more

  • A prototyping board

  • A BC547 transistor

  • A 1N4001 diode

  • A USB keyboard

On the software side:

  • The Raspbian OS "Operating system"

  • Python ''to program the Raspberry pi''

  • A HTML & CSS file

The python program check if data the received is needed to turn ''ON or OFF'' the relay via the Raspberry pi GPIO.

On the server side, you can use a domain name if you have one or use for free a free private open source software such as WAMP for Microsoft windows or LAMP if you have Linux OS installed on your computer. This done, you can install the different files on it:

  • main.html

  • button.php

  • Buttonstatus.php

  • Buttonstatus.txt

An then, you can mount up the differents components (diode, relay, transistor, Raspberry pi)

A video can be found right after the article for all of you that want to have an real example.

More details on the project can be found with the following link: How to build a home automation system with a Raspberry pi

If you like the article, you can subscribe to our newsletter and even follow us with our social medias (Facebook, Twitter, Google+, Instagram and Youtube).

If you decide to make your own project, please let us know your feedback and why not share with us your project and your journey.

See you soon for the next article.

Featured Posts
Recent Posts