Introduction: Small Home Automation With Intel Edison and Microsoft Azure
IoT stands for "Internet of Things" which is a development of the Internet where it is planned for every device to have network connectivity, thus allowing them to send and receive data. And, more importantly, to identify themselvesto other devices.
This could be almost any modern electronic device you use in you daily life device such as your fridge, your phone, your toaster, etc. Each one of them usually has some kind of information that could be usefull.
The term is closely identified with RFID as the method of communication, although it also may include other sensor technologies, wireless technologies or a lot of different comunication tools. The IoT is important because an object that can represent itself digitally becomes something greater than the object by itself.
Intel and the IoT
Intel has released a Intel IoT Developer kit that you can get to help developers and DIY'ers to get their hands on a simple piece of hardware with network and internet connectivity in order to simplify the process of integrating IOT to every project.
There are two main products available :
The Edison is a tiny little "computer" (it's too powerfull to be called a microcontroller), such as the CPU and RAM. It runs a simple Yocto linux distribution and can be programmed using Arduino, node.js, Python, C or C++.
The idea behind this is that the computing power that is provided (2 cores, 1GB ram) is useful for a lot of applications and can easily run most projects in a realistic time and environment. The chip is about the size of a SD card and uses just a little bit of energy.
The Edison can be used with an Arduino breakout board that allows you to plug in modules and sensors, and expand the devices capabilities. But it can
We used the Edison and the Arduino Breakout Board, which came along with a Seeedstudio Grove Starter Kit Plus (Gen 2), wich has a Base Shield and a bunch of sensors to get started.
Microsoft Azure and the IoT
Microsoft Azure is a cloud computing platform and infrastructure, created by Microsoft, for building, deploying and managing applications and services through a global network of Microsoft hosted datacenters. It provides both PaaS and IaaS services and supports many different programming languages, tools and frameworks, including both Microsoft-specific and third-party software and systems.
This is perfect for us since it can easily be used to log information and databases from our simple sensors to the cloud, for later use or manipulation.
Step 1: Getting Started - the Setup
Intel Edison
If you haven't used your Intel Edison before, you need to configure ir, flash the latest firmware and test it in order to get it going, we recommend using this simple guide in order to get started. We'll be using the Arduino IDE in order to program the Edison; but we are planning in building this same Home Automation System in node.js or C++.
Microsoft Azure
You'll need a Microsoft Azure Webapp in order to log the data to the internet for later use. We recommend you use the step one in this tutorial to create one and get the needed credentials.
Step 2: Connecting the Sensors and the Board
We'll be using a bunch of sensors and actuators in order to simulate a simple house sensoring and control system. Since we'll be using the Arduino Breakout Board and the Grove Base Shield, we'll be connecting each sensor to a different digital or analog pin in the Base Shield.
Here are the sensors and actuators used and a simple explanation on their use and connection in order to make this system work almost out of the box whit the code provided:
- Grove Temperature Sensor v1.2 - Connected to the analog input A0
This is used to monitor temperature inside a room of the house. - Grove Gas Sensor v1.4 - Connected to the analog input A1
Used to detect gas leaks. - Grove Moisture Sensor v1.4 - Connected to the A2 analog input.
Is the garden or a pot with your precious plant dry? Want to know how much it is watered? This is the way. - Grove Light Sensor v1.1 - Connected to the A3 analog input.
Want to know how much you should open your blinds or curtains? Light sensor to the rescue. - Grove Button v1.1 - Connected to the digital input D2.
It will be used as a switch installed in a door, to know - Grove Flame sensor v1.1 - In the D3 input.
A flame detector; (maybe the most popular around late Christmas time) - Grove Led Socket Kit v1.3 - In the D4 digital input.
An alarm light. - Grove SPDT relay (30 A) v1.0b - Connected to a D5.
Used to turn on an irrigation bomb for the garden/pot. - Grove LCD RGB Backlight v4.0 - In the I2C socket.
See data locally.
We advice you to test each one of the sensors, so you can understand the code we'll be sharing in the next step; it's really simple and usefull and will almost work out of the box if you have the same sensors.
Step 3: The Code
It's important to know that you'll need to have some libraries installed, if you don't remember or don't know how to install libraries or don't know if a library is installed or not, check the Arduino documentation in order to get them.
The libraries used in this small sketch are the SPI library that allows communication with SPI devices, the Wire library, wich allows you to communicate with I2C / TWI devices and the WiFi library. If you want to use the Grove LCD RGB display, you'll need the proper library.
You can download the code here, it is easy to analize and you can understand it better if you test the sensors one by one. We suggest you open a serial monitor in order to get information.
Attachments
Step 4: The Final Product
This is how the system looks once finished.