Friday, November 27, 2015

Introduction to Smart Home Idea

                                            HOME AUTOMATION (Part 0)

In my first post i will introduce the idea of 'Smart Home', how i started to work on it and where and how i got the components for it.


NOTE: I am not a student of Electronics, i did study physics in high school - but i do not know the 'fine tunings' behind the formulas.
What i do know is Programming.
As any programmer i have my flaws: Commenting allot, Variable naming, clean code issues.

My perks are that i try to write as good as code as i can make.


Now that we have skipped the boring introduction we can continue.

Smart Home is (surprise,surprise) the idea of home automation.
Meaning turning the lights, as well as controlling electronics  over the Internet as well as having the status of electronics in the house ON the Internet.

Meaning - if i like my shades to be closed tomorrow when the sun hits - i can tie the fine tunings with photo-receptor and a micro-controller  and a small motor and that will do the job for me.
If i want my alarm to not stop until i grab my toothbrush i can arrange for that too.

So the limit is your imagination.
Couple of issues on the fly: What, How , WTF, HOW ?
Answers are somewhat simple : Arduino , Raspberry Pi.
And no they are not the same thing.

THE LOGIC
You see Raspberry Pi (RPi) is a small sized COMPUTER that is actually well fit to connect with electronic components such as this one.

Thats a Radio Frequency (RF) module that can be connected to both - Raspberry Pi AND Arduino.
And they can communicate.
Since RPi is a credit-card sized computer it can be turned on like a server (I haven't turned mine off in like a year) and actually can be hosting a website
for your home automation.

But since your IP address is probably not static but dynamic we will have to use something like this. There is actually a script that can change the DNS settings whenever your IP changes. So - credit card sized computer , hosting a website and communicating with RF modules with other Arduinos in your home.

OK, so far so good. Now those Arduinos will be connected with other electronic components such as Relays , Other RF modules, Motion Sensors,Photo-receptors, Fire-sensors, Gas-sensors (if you use butane gas),... Those will notify and 'take orders' from the Arduino, who will communicate with RPi who will synchronize 'orders from Internet' and 'orders from Home'.


THE CATCH

All those cost money. Original Arduino  Mega costs 35$+VAT. And we need a whole bulk of it. RPi also costs around 40$.

THE SOLUTION
I'm not promoting this in any way. But on Ebay and Aliexpress you have 'fake'
Arduinos. (I would suggest if you have the money to buy 1 original Arduino to support the project - even i have one). Now we can buy a bulk of them as i did: I bought Arduino Mega's for 8$ (instead of 35$),
                      5x Arduino UNO For 15.9$ (~3$ a piece) .
                      5x High Current Relays (30A , 250V AC or 30V DC)for 14$
                      10x 2channel Relay (10A 250V DC or 30V DC) for 12$
                                                 (i actually did not receive these)
                      A whole bunch of Sensors for around 1$.

Just write "inserttypeofsensorhere module arduino" and search on ebay or aliexpress and look what pops up.

Just be vary of cameras they know to be tricky if you find them cheap.

Also get Raspberry Pi 2 - its faster, better and not a whole lot more expensive.


NEXT: SETTING UP A SERVER on RPi (Part 1)



No comments:

Post a Comment