Concept-
The project idea was to make a smart home automation, which allows the user
the convenience of controlling the devices over the Internet. The project uses a
raspberry pi, which controls all the devices over the Internet. The user using
his/her phone/desktop can control all the devices connected to the raspberry pi.
Tools/Process-
The microcontroller used in my project is raspberry pi 3. The programming
language I used for the project is Node js, which allows making a server quickly
and interact with the Raspberry Pi GPIO pins. Libraries I used for this project
were Npm express framework, Npm Rpi-Gpio, and Npm EJS. Npm Express
Framework for Node js allows making an HTTP server and allows the user to
access the raspberry pi through its IP Address. Npm Rpi-Gpio library allows
accessing raspberry pi GPIO pins. EJS Library is a templating language, which
allows generating simple HTML pages with plain JavaScript.
Connections-
First I used 1 strip board and connected 4 LED's to that strip board.
Strip Board 1 is Room 1 and Four LED's represent-
ROOM 1 LED 1 (White LED) - Room 1 Light
ROOM 1 LED 2 (Yellow LED) - Room 1 Fan
ROOM 1 LED 3 (Green LED)- Room 1 TV
ROOM 1 LED 4 (Red LED)- Room 1 Kettle
Room 1 Light is connected to GPIO Pin 7 on Raspberry pi.
Room 1 Fan is connected to GPIO Pin 8 on Raspberry pi.
Room 1 TV is connected to GPIO Pin 10 on Raspberry pi.
Room 1 Kettle is connected to GPIO Pin 11 on Raspberry pi.
Room 1 Ground is connected to GPIO Pin 6 on Raspberry pi.
Second Strip board Room 2 has the same configuration as Room 1.
Room 2 Light is connected to GPIO Pin 12 on Raspberry pi.
Room 2 Fan is connected to GPIO Pin 13 on Raspberry pi.
Room 2 TV is connected to GPIO Pin 15 on Raspberry pi.
Room 2 Kettle is connected to GPIO Pin 16 on Raspberry pi.
Room 2 Ground is connected to GPIO Pin 9 on Raspberry pi.
Problems / Feedback –
Earlier I planned to use raspberry pi as the main hub and have Audrino in each
room controlling the lights, fan and etc. But then later I realized Raspberry pi
could itself run the server and control all the devices connected to it. Feedback I got from friends was to use actual light bulb, I bought an 8 Channel Relay, which could be used to power up the actual bulb and connection through the mains. There was a loose connection, which blew up the relay that’s why I couldn’t use the relay to control the actual lights.
Code-
Index.js imports all the libraries and then controls the GPIO pins of the raspberry
pi. Index.ejs has forms so when the user submits the on/off button on the
website it sends the result to index.js which switch on /off the raspberry pi GPIO which switch on/off LED lights. To access the website the user needs to get the IP Address of the Raspberry pi and go to port 5000 because in index.js it goes to port 5000.
Video on the blog - https://mshar051.tumblr.com
More images on the Blog
Concept-
My idea is to create a home automation system, which allows controlling various
devices from the phone/website. For example, switching on a light or switching
on the heating according to the temperature in the room or motion detector in
the house. I got the inspiration from products like- Nest, hive.
Electronics-
I would use Audrino, Particle photon or maybe raspberry pie that will act as the
main hub for all the connected Audrino devices in the house. The server will be
installed on the raspberry pie which allows the user to control various devices
from their phone or the website.
I will be using motion sensor, humidity/temperature sensor, relays and LED
lights/Photo Resistors.
Design-
The design of the system will be pretty simple. Audrino will be connected to all
the sensors and particle photon/Raspberry pie will send all the data to the cloud.
Users will be able to control the devices with the help of the mobile app/website.
MVP-
MVP will be that the output is displayed through the LED lights.