This article is the first in a series on Cayenne, the first ever drag and drop Internet of Things (IoT) platform. It teaches you how to quickly develop IoT applications using Arduino Yún.

In this tutorial you are going to connect your Arduino device to Cayenne.

Learning Objectives

At the end of this tutorial you will be able to:

  • Setup your Arduino device for Cayenne

Hardware

Note: If the model of Arduino that you are using comes with built-in WiFi capabilities then you do not need a separate WiFi Shield.

  • Arduino Yún

Software

Cayenne Setup

Step 1: Register for a free account with Cayenne.

Step 2: Login to Cayenne. As a first time visitor you will be prompted to choose a device to start your project. Currently you can choose between a Raspberry Pi and an Arduino. For this tutorial, choose Arduino.

CodifyThings - Getting Started with Cayenne Internet of Things (IoT)

Step 3: On the next screen you will be presented with simple to follow instructions, follow all the instructions step-by-step. Once completed, click Next.

CodifyThings - Getting Started with Cayenne Internet of Things (IoT)

Step 4: On the final step, select your Arduino board from the list. In this tutorial we are using Arduino Yún. As soon as you select a board, AUTH TOKEN FOR THIS DEVICE field will be populated with a unique authentication token. You will need this later on in the code.

Note: Based on the board that you select, you can also specify the internet connectivity mode that you will be using. For example, Arduino Yún comes with a built-in WiFi so no additional Ethernet shield or Wireless shield is required. On the other hand if you are using an Arduino Uno, in that case you will need to attach an internet connectivity shield. Specifying the shield here will generate the corresponding code.

CodifyThings - Getting Started with Cayenne Internet of Things (IoT)

Step 5: Click on Sketch button corresponding to your board and shield, and copy the code.

CodifyThings - Getting Started with Cayenne Internet of Things (IoT)

Step 6: Start your Arduino IDE, paste the code in a new file and compile.

Note: During compilation the default code for Arduino Yún was throwing an error, so code was slightly modified to #include <YunClient.h>.

CodifyThings - Getting Started with Cayenne Internet of Things (IoT)

Step 7: Upload code to your Arduino device and open the serial monitor.

Note: Make sure you select 9600 baud on your serial monitor, it should be same as the Serial.begin(9600) in your code.

CodifyThings - Getting Started with Cayenne Internet of Things (IoT)

Step 8: The moment you see output similar to shown above in your serial monitor, switch back to the Cayenne dashboard. Your device should have been successfully added and show up in the dashboard.

CodifyThings - Getting Started with Cayenne Internet of Things (IoT)

Next Steps

In the next tutorial we are going to develop a simple Temperature Monitoring System using Arduino and Cayenne.