Software apps and online services
Hand tools and fabrication machines
The compute module of Intel called Intel Edison is slightly larger than a SD card. After playing around Edison extensively I am completely in love with this tiny computer. The speciality of Edison is – It can be used for wearables also it is enough powerful to control robots. It is 35.5 × 25.0 × 3.9 mm module also equipped with Yocto, a Linux OS . It has an onboard Wi-Fi and Bluetooth, perfect for IoT projects. We can connect to Edison remotely and run commands or access the file system. This gives lots of flexibility to developers via SSH. Its specs will definitely impress you, they are:
Intel® Atom™ Processor clocked at 500MHz
100MHz Quark MCU
1GB of LPDDR3 RAM
4GB eMMC flash memory
Bluetooth (4.0 and 2.1 EDR),
40 multiplexed GPIO interfaces
Edison can be used with Arduino IDE but to get most out of it you can use other programming languages like Python, Node.js, C/C++. Intel has its own IDE called Intel XDK IoT edition which makes programming with Edison easy. While setting up the programming environment for Edison you can choose between Arduino IDE, Intel XDK or Eclipse.
To keep the Edison small all of the I/O pins are broken out to a 70-pin Hirose connector. This 70 pin connector is not prototyping-friendly. Interfacing with these connectors are really difficult so to interface with Edison we need a board with mating Hirose connector.
Currently available interfacing boards are:
- Arduino Expansion Board
- Mini Breakout Board
- SparkFun Edison Blocks
If you are new to Edison and wanted to play around it, Arduino Expansion Board is for you. It will give you Arduino like feel, also Arduino based shield are compatible with this board but slightly larger than Intel Galileo. The features are:
20 digital input/output pins including 4 pins as PWM outputs.
6 analog inputs
1 UART (RX/TX)
1 ICSP 6-pin header (SPI)
Micro USB device connector OR (via mechanical switch) dedicated standard size USB host Type-A connector.
Micro USB device (connected to UART)
Micro SD card connector
DC power jack (7V – 15V DC input)
If you want to embed Edison into a project than you can use Mini Breakout Board or SparkFun Edison Blocks. They are slightly larger than Intel Edison. Mini Breakout Board has minimal features as:
Exposes native 1.8V I/O of the Edison module.
0.1” grid I/O array of through-hole solder points.
USB OTG with USB Micro Type-AB connector.
USB OTG power switch.
USB to device UART bridge with USB Micro Type-B connector.
DC power supply jack (7V – 15V DC input).
SparkFun has a whole set of modules for Interfacing, Power, Sensors and Actuators. You can browse them here and can find one or many suitable for your project with EdisonWhy to choose Edison?
Edison is a low power IoT computing module hence for less power consumption processor also slightly larger than a SD card . It is the best choice for a wearable project.Let's make a SmartWatch
Edison is enough small to use in wearble projects, so why not we make a smart watch with this tiny computer. I am going to use Arduino breakout board for prototyping though this will not look exactly like a smartwatch in prototype stage but will have all the functionalities and later we can work on to make it modular and compact. For the prototyping I used 16*2 LCD module for display as currently I was not having an OLED display, if you have one you can use the OLED display as it has low power consumption and smaller too. I will soon update this project with an OLED. So let’s see functionalities of our Edison Smart Watch
Show time continuously.
Monitoring and showing nearby temperature and sending to cloud.
Sending notification via Email if temperatures reaches above certain limit.
Sending SMS with one touch.
Pedometer and sleep monitor.
Intel Edison Module
Arduino expansion board for Edison
LSM303 Accelerometer/Compass Sensor
16*2 LCD RGB backlight
Grove LED module
Super bright LED (White)
Grove base shield
Micro USB cable
I am using Grove's sensors as it makes prototyping easy. You will find most of the sensors used in this project in Grove's Starter Kit for Edison . If you are new to IoT, the Seed Studio Grove Starter Kit will help you to easily get started with development since you need not worry about circuits and other electronics stuff. With Grove shield and sensor modules you can easily create anything without worrying about electronic components much. There is no need to manage sensors using soldering or a breadboard. This article "Grove Starter Kit With Intel Galileo Gen 2: Getting Started" will guide you about how to set up and get running with the Grove Starter Kit plus, though it is with Galileo gen 2 but everything is similar for Intel Edison. I am using Adafruit's Flora accelerometer/compass as I am having this one currently with me, it works fine but as this is designed as sewable module you will have to do a little extra work while making connections with this. If you don't have any I suggest you Grove - 6-Axis Accelerometer & Compass or Adafruit's accelerometer/compass LSM303.Make Edison ready for programming
1)Download the installer depending on your PC’s configuration from https://software.intel.com/en-us/iot/software/installers
2) Run the installer, it will ask you about the programming environment and IDE you want to install. Choose one or many according to your preference. For this project I am using Intel XDK and programming using node.js
3) Set up Serial terminal: If you want to use your board run commands remotely, you have to set up a serial connection. First install putty from http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe , Run the installer. Expand Connection in the menu and select Serial. Now in serial line type the COM port to which your Edison is connected. In the Speed field, type 115200 and select Serial in the connection type. Click ok, it will open a serial connection. Press enter, now it will prompt for login. Enter your credentials. Default username is root with no password. Now you will see a terminal port.
4) Connect to Wi-Fi: enter this command in serial terminal-
Edison will scan for all Wi-Fi networks for approximately 10 seconds. When it is finished, a list of available networks will be displayed. Choose the network by corresponding number in the list, type Y and press enter. It will ask for network credentials, enter valid credentials and you will be connected to WiFi with your Edison.
5) In your web browser type the IP address of your Edison or "http://edison.local" this will show this page if your Edison is connected to network.
6) Now we are all done to start developing with our Edison project.
As we are using Grove's sensors we will make connections with the four pin cables that comes with grove sensors. Don't worry about polarity as you won't be able to make wrong connection with them, they will fit only when you connect them in the correct way.
1) Connect your Edison to power supply and to your PC via USB cable.
2) It will take 15-20 seconds to boot up, after that stack the Grove Base Shield.
3) Connect the Temperature Sensor to analog pin A0
4) Connect the temperature sensor to A1.
5) Connect the LCD Display to one of the I2C port
6) Connect the Accelerometer to another I2C port.
7) Connect the Grove button to D2.
8) Connect the LED module to D3.
9) Connect the touch sensor to D4.
Programming for SmartWatch
1) Open Intel XDK IoT edition, if it is not already installed in your PC get it from https://software.intel.com/en-us/iot/downloads
2) If you have flashed you Edison with the Flash Lite Tool Node.Js will be already installed on your board.
3) Connect IDE to your Edison board. It will ask you for username and password, default username is root with no password.
4) Select a blank Node.Js template and create a new project.
Here I am using AWS for IoT cloud, AWS environment consists of a number of different AWS services providing security, transport, and storage of the sender data produced by your device. All services in AWS are delivered via a rich set of REST APIs. You can use a service programmatically through the APIs or can invoke manually using the console which make AWS Cloud powerful. It also offers numbers of API to speed our development with the language of our choice. Hence I have chosen its Node.Js library to interact with my Edison.
Create an AWS account. You will need to provide Credit/Debit card details along with your personal information. Do provide correct telephone number as it will need to verify the account. It will ask for support plan, you can choose between Basic, Developer or Business according to your need. The Basic support plan is free and you have to pay in case of the other two.
Sign in to the AWS IoT Console
Sign in to the AWS Management Console and open the AWS IoT console at https://aws.amazon.com/iot. On the Welcome page, choose Get started with AWS IoT.
Now you will see a page similar to this. On the top there is a panel for creating Resources. If you don't see blue banner with Create a thing, Create a rule, Create a certificate, and Create a policy buttons, choose the Create a resource button.
Create and Attach a Thing (Device)
Here a Thing represents a device to which we are going to connect with AWS. The first step is to create a Thing. Create a Thing from the Resource panel. Name it and click Create.
Click on view Thing now its details will be visible in side panel.
Choose the Connect a device button to download a key pair and a certificate generated by AWS IoT.
On the Connect a device page, select the SDK to use, and then choose Generate certificate and policy.
Download Public Key, Private Key and certificate. This will be needed to connect your device to AWS Cloud. You can also rename the file as:
• your private key: private.pem.key
• your certificate: certificate.pem.crt
• the CA root certificate: root-CA.crt
Now it will provide you a sample code based on your credentials. Copy this code to clipboard, you will need this later while establishing connection between your Device and AWS cloud. Click Return to Thing Detail.
A certificate will be visible after your Thing in the below panel. Select the certificate and click Actions, a dropdown menu will appear. Select Activate.
If your certificate is not attached to Thing you can do the same from Actions-> Attach a Thing , after selecting the certificate.
Type the Thing name and click on Attach.
After selecting the Thing you can view its details and all the attached Certificates in the panel on right side. Note that for deleting certificates you need to first Detach it then Deactivate it and then finally you can Delete it.
Go to AWS Console, Under Mobile Services select SNS. SNS is a push notification service. We will create a channel to send messages and subscribe to notifications.
In SNS Home, select Create Topic.
Name the topic and give a Display name. This Display name will be visible in SMS and Emails. Now Click on Create Topic.
Topic details will be visible.
Create a Subscription.
Set the Protocol as Email and in EndPoint type the Email Address you want to receive the notifications. Click on Create Subscription.
You Will see a Pending Confirmation message. Now goto your emails there you will see a new mail from AWS Notifications to confirm subscription. Click on the link and you will get a confirmation message.
You can now create a test mail to check if everything is working fine. Click on Publish to topic. Type something in the message box and click on Publish Message.
If you have done the setup correctly then you will see a new mail in your Mail Box.
In AWS IoT page, Select Create a Rule from the Resource panel.
Fill the details.
In Choose an Action dropdown select “Send message as a push notification (SNS)”
In SNS target select the SNS topic name we have created earlier.
Click on Create a new role
In the Role Summary, Click Allow.
Click on Add Action, Click Create.
Now in Details you can see the recently created SNS Action.
Setting Up IAM Roles
In AWS Console, Select Services from the top navigation menu. From Services select IAM.
From the Dashboard select users and click on Create New Users
Enter a User Name as snsReceiver and click Create
Save the Credentials.
Select the recently created user, go to Permissions tab and click on Attach Policy.
From the list select AmazonSNSFullAccess & AmazonIoTFullAccess and click on Attach Policy.
Policy will be attached.
Now we have completed the AWS cloud setup. Let us setup our device.
Transferring Certificates and key files to Edison
We have to transfer the certificates and keys to Edison for this establish a FTP connection with your Edison. You can use a great utility FileZilla for this. Download it from here
In FileZilla select SiteManager and insert the following details
Host: Your Edison IP address Username: root Password: <blank> (unless you set a password) Port: 22
Note: You don’t need to connect your Edison via serial cable.
Now all the directories will be visible and accessible to you. Navigate to the root folder and create a new folder there. Name it “awscerts”
This will be the order
In the awscerts folder using the GUI copy all the certificate and key files or you can simply drag and drop.
*You can also use WinSCP tool instead of FileZilla.
Installing AWS IoT SDK on Edison
Establish a serial connection with Edison and run this command to install the AES IoT SDK.
npm install aws-iot-device-sdk
You will need to create a twilio account for sending the messeges. Copy the API key in the code that you get from twilio account. Build, Upload and Run your app on Edison. It will download the NPM modules and upload the current project to Edison. While working with Intel XDK IoT edition you need an active internet connection.
You will see the sensor values in debug console, if everything works fine you will notice data being send to AWS cloud and message send to mobile phone with touch. AWS will also send you alerts if temperature exceeds 35 degree Celsius . Press the button and this will turn on the flashlight that will be useful to see you in the dark and the display will show current time and temperature.
Navigate to AWS IoT dashboard, you will see the shadow state and shadow metadeta with our device IP. Here I have also created some alerts, if the temperature level exceeds up to a certain level (an alert will send through Email)
Now when we touch on the touch sensor a text message is sent to my mobile phone immediately. I have used Twilio trial account, so they have added some other text with the SMS. If you will get a paid account you won't see any Twilio advertisements.
While transferring the certificate I got stuck in an issue. My certificate file was converting into a .txt file again and again. Then I created a blank file in notepad with .cert extension and pasted the text of the original certificate and saved it with a different name.