Click here to Skip to main content
15,946,342 members
Articles / Internet of Things
Article

Getting Started With Node-RED And Arduino 101 With The Grove Shield

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
19 Jul 2016CPOL4 min read 8.3K   4  
Getting Started With Node-RED And Arduino 101 With The Grove Shield

This article is for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers

Get access to the new Intel® IoT Developer Kit, a complete hardware and software solution that allows developers to create exciting new solutions with the Intel® Galileo and Intel® Edison boards. Visit the Intel® Developer Zone for IoT.

Overview

Node-RED* is a tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based flow editor that makes it easy to wire together flows using the wide range nodes in the palette. Flows can be then deployed to the runtime in a single click. The lightweight runtime is built on Node.js*, taking full advantage of its event-driven, nonblocking model. This makes it ideal to run at the edge of the network.

Arduino 101* is the ideal successor of the UNO, updated with the latest technologies including the Intel® Curie™ processor. It recognizes gestures, and features a six-axis accelerometer and gyroscope.

Grove* is a modulated, ready-to-use tool set. Much like Legos, it takes a building block approach to assembling electronics. Compared with the traditional, more complicated learning method of using a breadboard and various electronic components to assemble a project, Grove simplifies and condenses the learning process significantly. The Grove system consists of a base shield and various modules with standardized connectors. The base shield allows for easy connection of any microprocessor input or output from the Grove modules, and every Grove module addresses a single function, such as a simple button or a more complex heart rate sensor. Each one comes with clear documentation and demo code to help you get started quickly.

Required Hardware

  • IoT Gateway that uses Intel® IoT Gateway Technology
  • Arduino 101
  • Grove Shield kit

Image 1

Image 2

Assumptions

  • Gateway is running Intel® IoT Gateway Technology version 3.1 or above.
  • Node.js is installed on the gateway (installed by default).
  • Node-RED is installed on the gateway and is running (installed by default).
  • MRAA, UPM, and node-red-contrib-upm node are installed on the IoT Gateway. (You can install these packages by clicking on Packages and then Add Packages from the Intel® IoT Gateway Developer Hub.

Preparing and connecting the Arduino 101* with Grove* Shield

  • Arduino 101 should be connected to the Intel® IoT Gateway via USB.
  • Grove Base Shield should be attached to Arduino 101, and switched to 3V3 VCC.
  • For this example, we'll be using 6 of the sensors from the Grove Shield kit. Please connect them as follows:
    • LED to D2
    • Push Button to D3
    • Touch Sensor to D6
    • Temp Sensor to A0
    • Light Sensor to A1
    • Rotary Sensor to A2

Connecting the Arduino 101

Plug in an Arduino 101 board and reboot your gateway. The Firmata* sketch should now be flashed onto the board, and you are now ready.

Using Node-RED*

The Node-RED* browser interface can be reached via http://ipaddressofthegateway:1880. When it first comes up it will look something like this:

Image 3

Along the left side of the Node-RED screen you'll see a series of nodes. These are the building blocks for creating a Node-RED application on the Intel® IoT Gateway. We'll use several nodes in this application:

Image 4

Drag and drop nodes onto the canvas and arrange them as shown below. For some of the nodes, we'll need multiple copies. Use your mouse to connect wires between the nodes as shown below:

Image 5

When nodes are first placed on the canvas, they are in a default state, and need to be configured before they'll work. Nodes are configured by double-clicking them and setting parameters in their configuration panels.

Double-click each node on the canvas and set its parameters as shown in the table below. In some cases, the Name field is left blank to use the default name of the node. Pin numbers correspond to the Grove Base Shield jack where the sensor or actuator is connected.

Image 6

Verify your settings and wiring connections, then click the Deploy button to deploy your changes, making them active on the gateway. After deploying the flow, you should see a data display towards the top of the Intel® IoT Gateway Developer Hub screen with live values for Rotary, Light and Button. Turning the rotary knob and covering the light sensor should make the numbers change up and down, and pressing the button should turn on the LED, sound the buzzer, and energize the relay.

Congratulations! You can now use Node-Red to read and control sensors attached to the Arduino 101 from your gateway!

References

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
You may know us for our processors. But we do so much more. Intel invents at the boundaries of technology to make amazing experiences possible for business and society, and for every person on Earth.

Harnessing the capability of the cloud, the ubiquity of the Internet of Things, the latest advances in memory and programmable solutions, and the promise of always-on 5G connectivity, Intel is disrupting industries and solving global challenges. Leading on policy, diversity, inclusion, education and sustainability, we create value for our stockholders, customers and society.
This is a Organisation

42 members

Comments and Discussions

 
-- There are no messages in this forum --