Introduction: IoT Workshop: Prep Work

The labs in this series build on each other to enable you to prototype your own Internet of Things (IoT) devices. In this lab you will use Node.js and an open source framework for interacting with hardware called Johnny-Five, which works as a baseline control kit for Arduino-based projects. This enables you to write applications in JavaScript that can run either on your computer connected to an Arduino board or directly on the board itself (if the board has a Linux distribution, like the Arduino Yun and Linino ONE).

I chose the Arduino Yun for this workshop because it has both a Linux distribution and on-board Wi-Fi, although several of the labs can be completed using any Arduino board because the Node.js code will run on your laptop and use the Arduino over USB. If you want to deploy the applications you build to the Arduino, you will need a board that has a Linux distro (such as the Yun or the Linino ONE).

Step 1: Bill of Materials

To prepare your development environment for this lab series you don't need anything other than a computer. Each lab in the series will have a bill of materials indicating what is required for that lab.

If you want to prepare yourself further before the labs you can acquire the following:

  1. Arduino Yun (1)
  2. USB to micro-USB cable (1)
  3. An Arduino compatible starter kit w/o the board (1)
    1. An example would be the Adafruit ARDX - v1.3 Experimentation Kit for Arduino (Uno R3) - v1.3 (it comes with an Arduino Uno R3, which you can use only in some of the early lessons)

Here is a list of individual sensors and devices you may want to acquire (not all of these will be used in the workshop, but this is a good core kit to have):

  • Premium jumper wires (75)
  • 9V battery clip (1)
  • 5mm diffused RGB LED (1)
  • Piezo Sensor (1)
  • 5mm red LEDs (10)
  • 5mm green LEDs (10)
  • 10mm blue LED (1)
  • Toy DC motor (1)
  • 9g High Sensitive Mini sensor (1)
  • 74HC595 (1)
  • Buzzer (1)
  • 1M resistor (1)
  • Pushbuttons (2)
  • Potentiometer - 10K (1)
  • Light sensor (5528) (1)
  • TMP36 (1)
  • Relay (5v,3A/120VAC) (1)
  • P2N2222A (2)
  • 560 Ohm resistors (25)
  • 2.2k Ohm resistors (3)
  • 10k Ohm resistors (3)
  • 220uf capacitor (1)
  • 1N4001 (2)
  • Breadboard (1)

Step 2: Install the Arduino IDE

While you won't use the Arduino IDE very much in the set of labs, it is necessary for a couple of things. For one thing, installing the Arduino IDE also installs the USB drivers for the Arduino board.

Go to http://www.arduino.cc and follow the links to download the latest version of the Arduino IDE. Make sure that the checkbox for the USB driver is selected during install (it typically is by default).

Step 3: Install a Code Editor

If you don't already have one installed, pick a text/code editor. Feel free to use anything you like, provided it won't inject any extra text into your files.

Some Options

Step 4: Install Git

Some of the tools you will be using in this workshop require Git. The download link can be found here.

Windows Only

During the Git install, check the option to Use Git from the Windows command prompt (see image above).

If you don't choose this option, after you have installed Git, you need to add the path to get to your development environment. To do that, add the path to Git to the PATH environment variable.

Open Control Panel > System and Security > System then click on Advanced Settings.

Click on the Environment Variables button toward the bottom of the dialog.

Locate the User variable named PATH and double-click it.

Append the following to the Variable value textbox (if you installed Git to a different location you will need to modify this value accordingly):

;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd

Click OK to close the Edit User Variable dialog.

Click OK to close the System Properties dialog.

Close any remaining dialogs/windows (i.e. Control Panel).

Step 5: Install Node.js

In the labs you will write small programs that will run on your computer, connected to your Arduino (these can also be deployed to run solely on your Arduino Yun). These programs will be written in JavaScript and will be built on Node.js. If you are not familiar or experienced with Node.js, don't worry. You will learn everything you need to know for these labs in these labs.

Follow the instructions here to install Node.js on your computer.

Step 6: Install Bower

Bower is a package manager similar to the Node Package Manager (NPM). For these labs we will use both NPM and Bower. You install Bower using NPM.

On Windows, open the Node.js command prompt and type the following:

npm install -g bower

On Mac OS X open Terminal and type the following:

sudo npm install -g bower

Step 7: Install Apache Cordova and Cordova Icon

Apache Cordova

Apache Cordova is an open-source mobile development framework. It allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development, avoiding each mobile platforms' native development language. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device's sensors, data, and network status.

On Windows, open the Node.js command prompt and type the following:

npm install -g cordova

On Mac OS X open Terminal and type the following:

sudo npm install -g cordova

Cordova Icon

Cordova Icon is a tool that provides automatic icon resizing for Cordova apps.

On Windows, open the Node.js command prompt and type the following:

npm install -g cordova-icon

On Mac OS X open Terminal and type the following:

sudo npm install -g cordova-icon

Step 8: Install Johnny-Five

Johnny-Five is an open source JavaScript framework that provides a simple object model for interacting with an Arduino-based board and the sensors and devices you connect to it.

Once you have Node.js installed, install Johnny-Five by opening a terminal window (Mac OS X) or Node.js command prompt (Windows) and execute the following command:

npm install johnny-five

Step 9: Install Nitrogen

Nitrogen is a messaging service that will act as a gateway for your Thing connecting to Azure. Nitrogen supports connecting devices via Message Queue Telemetry Transport (MQTT) or using the Nitrogen Node.js client library (you can learn more about MQTT here). You install Nitrogen using NPM.

On Windows, open the Node.js command prompt and type the following:

npm install -g nitrogen-cli

On Mac OS X open Terminal and type the following:

sudo npm install -g nitrogen-cli

Step 10: Set Up a Development Directory

The last thing to do is prepare a place to save all of your work in the labs. I recommend an easy to navigate to directory with a relatively short path. Create a new folder/directory for the workshop - I recommend:

Windows

C:\Development\IoTLabs

Mac OS X

~\Devleopment\IoTLabs

That's it for now. You are ready to start the first set of labs.

Once you've completed this lab, be sure to click the "I Made This" button at the top of the page. That helps me know how many people are working on this lab - the more people using the lab, the more lab modules I will create.

Next, go to Lab 1: Digital Output.

Comments

author
josegalarceh made it! (author)2015-08-26

gracias por los pasos!! muy claros todos!

image-0008 400x400 px.jpg
author
lamiastella made it! (author)2015-06-08

Sure!

Screen Shot 2015-06-09 at 12.17.13 AM.png
author
lamiastella made it! (author)2015-06-08

Interesting to learn about new technologies to talk to the clouds

Screen Shot 2015-06-09 at 12.13.33 AM.png
author
lamiastella made it! (author)2015-06-08

I installed #JohnnyFive and did a quick research who else is using it and what for. Sounds very interesting and thanks for introducing it :)

Screen Shot 2015-06-08 at 11.56.25 PM.png
author
lamiastella made it! (author)2015-06-08

I installed cordova and cordova-icon on OSX.

Screen Shot 2015-06-08 at 11.37.27 PM.png

About This Instructable

2,397views

21favorites

License:

Bio: Director, Strategic Engagements, DX-TED, Microsoft
More by dougseven:IoT WorkshopIoT Workshop: Lab 4 - Sending Data to the CloudIoT Workshop: Lab 3 - Controlling Output with Input
Add instructable to: