Getting Started with Arduino Due

This guide teaches you how to get started using the Arduino Due and Adafruit WINC1500 Wi-Fi Shield with Atmosphere. This includes creating your first project, programming the project’s firmware into the Arduino Due, registering the device to Atmosphere, and having its data displayed on a dashboard.

In the guide you’ll build a basic project reads an incrementing integer value (up to 10) every second, sends that value to the cloud, and displays the updated value on the dashboard.

Prerequisite: You should already have an Atmosphere account.

Hardware Requirements

The Arduino Due doesn’t have built-in connectivity, so connecting it to the Adafruit WINC1500 Wi-Fi Shield helps enable it for Wi-Fi and connect to Atmosphere.

Software Requirements

  • Atmosphere IoT Agent. The Atmosphere IoT Agent is a local application that runs in the system tray and acts as an intermediary between the computer’s connectivity protocol drivers and the browser running Atmosphere, and is used here to assist in programming the device and connecting it to Atmosphere. While the agent is running, a device with Atmosphere firmware installed on it can be registered to Atmosphere directly without the assistance from an additional connection like BLE or Wi-Fi if it’s connected to your computer. You can download the Atmosphere IoT Agent from its downloads page.

The project in this guide doesn’t use Studio’s Application tab to build an app interface and since the Arduino Due will be registered to Atmosphere directly via a UART connection with your computer, the Atmosphere IoT app is not required here.

Step 1 of 8: Create a New Project

Navigate to Atmosphere Studio from the side menu. When you visit Studio for the first time in a session, you are brought to the Studio Projects screen.

  1. Click the New Project button. This displays a New Project window.
  2. Select the Arduino Due project type and give the project a name, then click Create.

This opens a new project in Studio.

This guide walks through the step-by-step process to perform actions in Studio, but doesn't cover the in-depth aspects of Studio itself. To learn more about using Studio, its areas and features, and Studio elements, visit the Atmosphere Studio section.

Step 2 of 8: Create the Project’s Embedded Firmware

The first aspect of building this sample project is adding elements to the Embedded tab to create the project’s embedded firmware. This involves setting an interval to run every second, and when run initiates a counter to increment an integer value.

  1. Add the following elements to the canvas by clicking them in the Element Toolbox:
    • Interval Element Interval element: The interval element sets the project to run at the time set in the element’s properties, which by default is set to once per second (1000 ms).
    • Counter Element Counter element: The counter element allows you to implement a periodic software counter.

    Each of these elements will work as intended by default, so none of their properties need to be changed.

  2. Connect the interval element to the counter element. This creates an event between them, which can be seen in either the interval element’s properties, or by clicking the connector’s Configuration Button button. The event added is within the Interval trigger. In the Ability field within the event, set the ability to Increment Value. This means that when the interval element is triggered (which is every seconds), it will increment the integer value. The counter element’s default properties set the Initial Value field to 0, so the increment begins at that number.

That wraps up the first aspect of the project within the Embedded tab. To this point, an interval has been set that will run every second, and when run will increment a value starting at 0 from the counter element. When the counter reaches 10, the counter will rollover back to 0.

The Embedded tab canvas should resemble the following image:

Arduino Due Embedded Tab

Step 3 of 8: Enable the Arduino Due’s Wi-Fi Connectivity

The next aspect of building this sample project is enabling it for Wi-Fi connectivity. This involves adding a WINC1500 element from the Element Library into the project.

  1. From the Embedded tab, click the Add Element Add Element button located in the bottom of the Element Toolbox. This opens the Element Library, which includes numerous elements for sensors and other devices that can be incorporated into a project. Element Library
  2. In the Element Library, locate the WINC1500 element in the table and turn on its enable switch by clicking it to import it into the Element Toolbox. When done, click Save.
  3. Add the WINC1500 element to the canvas from the Element Toolbox. This element is configured to work as intended by default, so none of its properties need to be changed. Likewise, it doesn’t need to be connected to any other element; if it’s included in the project it will work properly so long as the Wi-Fi shield is connected to the Arduino Due.

When the WINC1500 element is added to the canvas, notice that cloud elements (cloud event and cloud command) are then populated into the toolbox. By adding a connectivity aspect to the project, these elements are now accessible for use.

Step 4 of 8: Enable the Project’s Cloud Connectivity

The last aspect of building this sample project is enabling it for cloud connectivity. This is done on both the Embedded and Cloud tabs.

  1. While still in the Embedded tab, add a Cloud Event Element cloud event element to the canvas. The cloud event element is a coupled element between the Embedded and Cloud tabs that enables a project’s data to be sent to Atmosphere.
  2. Connect the counter element to the cloud event element. In the connector’s properties between the two elements, select the Value Incremented trigger, then add an event with the ability Send Event. This sends the value to Atmosphere when the integer is incremented.
  3. Click the Cloud tab to move to the cloud area of the project. Notice how the Element Toolbox has changed, and that the coupled cloud event element is displayed on the canvas.
  4. Add a Cloud Storage Element cloud storage element to the canvas, and connect the existing cloud event element to it. By default, this creates an event using the Add Data ability within the cloud event’s Event Received trigger, which allows Atmosphere to add (and store) data sent to it from the cloud event element.
  5. Within the Add Data event, modify the event’s Value field to {"Integer Count": value}, which will label the incrementing value dataset as “Integer Count” when displayed in the cloud.

That’s all for creating the project! With the added cloud connectivity, the project will send the integer value from the Embedded tab to the Cloud tab through a cloud event element, where it’s connected to a cloud storage element to store the data on Atmosphere.

The final canvas for each tab should resemble the following images:

Embedded Cloud
Arduino Due Embedded Tab Arduino Due Cloud Tab

Step 5 of 8: Compile the Project

Once the project is finished, it needs to be compiled. Compiling readies the entire project’s source code for deployment.

  1. From any tab, click the Compile button in the project options menu on the top-right of the screen. You’ll see a loading message on the screen indicating compiling has started, and will be notified when the project is compiled.

Step 6 of 8: Program Firmware into the Device

With the project compiled, your Arduino Due can be programmed with the project’s embedded firmware.

Prior to programming a device, ensure you have the following configuration:

  • The device is connected to the computer via USB to an available communication port.
  • The Atmosphere IoT Agent is installed and running.
  • An Internet connection is maintained.

With setup complete, you can program your board:

  1. While the Embedded tab is active, click the Program Firmware button from the tab’s toolbar. This displays the Program Firmware window.
  2. Under Device Port, select the communication port the device is connected to.
  3. Click Program to start programming. When complete, you’ll be notified that the device is programmed with the project’s embedded firmware.

Step 7 of 8: Register the Device

With firmware installed, the device can now be recognized and connected to Atmosphere. Prior to connecting a device, ensure your Atmosphere IoT Agent is running in your system tray. This is needed to check your computer’s communication ports for a device it recognizes, which will find the Arduino Due.

To register the Arduino Due:

  1. Navigate to the Devices area, and click the Register Device Add Device button in the top-right to display the Add Device window. When the window opens it automatically starts scanning for available devices within range.
  2. The list of available devices appears. Select the Arduino Due you just programmed and click Register. This brings you to the Wi-Fi settings screen.
    • If the device doesn’t show up, try restarting the agent in your system tray. If you do so, refresh your browser and try adding a device again.
  3. Configure your Wi-Fi network settings to connect the device. When Wi-Fi settings are entered, the Arduino Due will connect to Atmosphere over Wi-Fi and remain connected as long as the Wi-Fi connection is maintained.

The device is now registered to Atmosphere and is displayed on the page.

Step 8 of 8: View Device Data

Now that the device’s data is sent to Atmosphere, let’s view it through one of the many device dashboard widgets available. In this guide we’ll use a data glance to display the numerical value and view it increment. We’ll do this directly on the device’s console page itself, so click on the newly-added Arduino Due to enter its console.

  1. To add a widget to the device’s dashboard, click the Configuration button on the side of the screen. This displays the menu of available widgets. Select the Data Glance data glance widget to add a data glance to the dashboard.
  2. Once on the dashboard, click the widget’s Menu menu icon to display its menu, then click Settings.
  3. In the data glance’s settings, modify the following properties:
    • Name: Give the widget a name, such as “Arduino Due Int Counter.”
    • Icon: Select an icon that you think best represents the value.
    • Color: Give the widget a color.
  4. In the Data Source field, click Select, then choose the following configuration options for the widget:
    • Select Cloud Storage: Click the cloud storage that is storing the counter element data.
    • Select Value: Select the Integer Count dataset.
  5. When finished click Save. The data glance is then populated with the integer value, which updates every second.

Arduino Due Demo Dashboard

Congratulations, you just finished a complete Arduino Due project with Atmosphere!