Low Cost Smart Home - Control From Anywhere in the WORLD
by Rithikthegr8 in Circuits > Raspberry Pi
634 Views, 2 Favorites, 0 Comments
Low Cost Smart Home - Control From Anywhere in the WORLD
About
Nowadays both parents are working to have a comfortable life for the family. So we have a lot of electronics appliances like Heater, AC, Washing Machine, Etc. in our home.
When they returning to the home they should feel very comfortable in terms of temperature and other work. But nowadays, after entering the home, they have to switch on all the electronics appliances and wait for some time to start electronics applications like AC, Heater, Etc to feel comfortable. They can’t Switch on the heater or AC full day which leads to more consumption of electricity and cost.
I am making a LOW-COST SMART HOME, which will connect to the internet and can control the existing home electric appliances from ALL OVER THE WORLD with their Android/iPhone mobile itself whenever they want.
They Can switch on anytime and any application with low cost (Less than 40 $)
Materials needed:
Raspberry pi 3 or 4
Bulb or Any Electronics item
Relay
Wires
Android/iPhone Mobile
Wifi
Set Up Your Raspberry Pi
Now we are going to set up your Raspberry Pi,
Step 1: Download the Raspbian image in this link, https://www.raspberrypi.org/downloads/raspbian/
Step 2: Formate your SD card.
Step 3: Flash the image using balena Etchen (Download and install in this link https://www.balena.io/etcher/)
Step 4: Insert the SD card in the Raspberry Pi.
And you are Done, with Setting up your Raspberry Pi
Set Up You Blynk
Now we are going to set up the blynk,
You can download the application called " blynk" at App Store in Apple and Play Store in Android
Now you need your phone to set up Blynk,
Step 1: go to Google Play and install Blynk
Step 2: Open Blynk and sign up with your e-mail id
Step 3: After that, you should get a window with small dots, click on the window and you should get a window on the right side click button on it and you should see a tile in the dots window. Click on that and name your button, select pin as GPIO2 and you will see a 0 and 1 right next to the PIN change it as 1 and 0
That's all you need need to set up your Blynk
You can also see the video below for well understanding.
Programming
First of all, you need to install Node.js. on your raspberry pi
Before updating Node.js, please be sure to remove old versions:
sudo apt-get purge node nodejs node.js -y
sudo apt-get autoremove
Automatic Node.js installation
Add repositories:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
Install Node.js:
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential nodejs -y
Manual Node.js installation
Automatic install might not work for you, in this case, you can perform a manual installation.
If uname -m gives you armv6l on Raspberry Pi, try this:
sudo su
cd /optwget https://nodejs.org/dist/v6.9.5/node-v6.9.5-linux-... -O - | tar -xz
mv node-v6.9.5-linux-armv6l nodejs
apt-get update && apt-get upgrade
apt-get install build-essential
ln -s /opt/nodejs/bin/node /usr/bin/node
ln -s /opt/nodejs/bin/node /usr/bin/nodejs
ln -s /opt/nodejs/bin/npm /usr/bin/npmexit
export PATH=$PATH:/opt/nodejs/bin/
Check your Node.js and npm installation
pi@raspberrypi:/ $ node --version
v6.9.5
pi@raspberrypi:/ $ npm -v
3.10.10
Install Blynk globally
sudo npm install blynk-library -g
sudo npm install onoff -g
Run default Blynk client (replace YourAuthToken):
export PATH=$PATH:/opt/nodejs/bin/
unset NODE_PATH
blynk-client YourAuthToken
Connections
Connections
Raspberry Pi to Relay
GND = -
5V = + (middle pin)
GPIO2 = S
Relay to Bulb
x(I draw in the picture) (NO) = Wire from the plug
Y(I draw in the picture) (C)= Wire goes to the bulb
I have attached the picture for your reference
Final Step
Now you have almost finished the project.
Now go to the Blynk app and You should see a Play button on the top right corner of the mobile phone and click on that.
Make sure you powered the raspberry pi and connected the led,
Now click on the button in the blynk app.
Now the bulb will ON.
Now you have finished the tutorial
IOT Home
Now you have finished the Project.
You can also control any electric appliances if you want, by adding more blynk tiles.
Thank you for Learning the project with me
If you have any doubts email to the below mail id,
E-mail: rithikthegr8@gmail.com