The XLR8 is a drop-in replacement for an Arduino Uno with an interesting twist – it uses Field-Programmable Gate Array (FPGA) as the main processing chip.
XLR8 is the perfect fusion of FPGA-based speed and performance with Arduino platform familiarity and convenience.
Easily programed with the Arduino IDE and compatible with the broad ecosystem of Arduino shields, sensors and accessories, this device makes IoT solutions powerful and easy to deploy.
Following this guide you will be able to connect the XLR8 using the ATWINC1500 WiFi breakout board to send and receive data from/to Ubidots.
Requirements
Ubidots account
Step-by-Step Guide
Setup the Arduino IDE with XLR8 board
Hardware Setup
Managing data with Ubidots Platform
- Posting data to Ubidots
- Getting data from Ubidots
1. Setup the Arduino IDE with XLR8 board
Download the Arduino IDE if you have not already done so. Open the Arduino IDE, select Files -> Preferences and enter the url below into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas
https://raw.githubusercontent.com/AloriumTechnology/Arduino_Boards/master/package_aloriumtech_index.json
IMPORTANT NOTE: To be able to connect and program the XLR8 you need to install the FTDI drivers required. For this, please reference to the FTDI Driver Installation step from the Alorium Official Getting Started guide.
2. Open Boards Manager from Tools -> Board -> Boards Manager and install XLR8 platform. To simply find the correct device, search XLR8 within the search bar:
3. Confirm that the XLR8 board package now exists in your list of available boards. Go to Tools > Board and choose the new selection titled “Alorium XLR8 Boards”. Select your new XLR8 board from the Board menu.
FYI, after selecting the XLR8 board, you will find a new menu item at Tools -> FPGA Image, where you will find a number of FPGA images that provide different operating speeds and different XB configurations.
4. Next, go to the library repository to download the Alorium XLR8 Ubidots Library. To download the library clicking the green button called "Clone or download" and select "Download ZIP".
5. Now back in the Arduino IDE, click on Sketch -> Include Library -> Add .ZIP Library.
6. Select the .ZIP file of and then “Accept” or “Choose”
7. Close the Arduino IDE and open it again.
For additional resources, see the Alorium Official Getting Started Guide.
2. Hardware Setup
Connect the Alorium XLR8 to the WINC1500 module by connecting the SPI interfaces together following the pin-out below:
3. Managing data with Ubidots Platform
Posting data to Ubidots
1. Copy and paste the below sample code in the Arduino IDE. Be sure to assign the parameters required to establish the connection and communication with Ubidots Platform.
SSID, name of your WiFi network
PASS, password of your WiFi network
//--------------------------------------------------------------------
// XLR8UbidotsSimple.ino
//--------------------------------------------------------------------
// Copyright (c) 2018 Alorium Technology. All rights reserved.
// by Jason Pecor Alorium Technology
//
// This file is a simple example for using the Alorium Technology
// XLR8 development board with Ubidots.
//
// The hardware setup for this example requires SPI connection to an
// Adafruit ATWINC1500 WiFi breakout module.
//--------------------------------------------------------------------
#include <UbidotsXLR8.h>
#include <SPI.h>
#include <WiFi101.h>
WiFiClient client;
// Ubidots Token
#define TOKEN ""
char ssid[] = ""; // WiFi SSID
char pass[] = ""; // WiFi Password
Ubidots ubidots(TOKEN);
int sensor0, sensor1, sensor2;
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
// Configure SPI for ATWINC Module
WiFi.setPins(8,7,4);
// Initialize and connect to Ubidots
ubidots.initialize();
ubidots.setDeviceName("XLR8");
ubidots.setDeviceLabel("XLR8");
ubidots.wifiConnection(ssid,pass);
}
void loop() {
// Send random values for sensor variables
sensor0 = random(100,199);
sensor1 = random(100,199);
sensor2 = random(100,199);
Serial.println("Send sensor data");
Serial.print("sensor0: "); Serial.println(sensor0);
Serial.print("sensor1: "); Serial.println(sensor1);
Serial.print("sensor2: "); Serial.println(sensor2);
ubidots.add("sensor0", sensor0);
ubidots.add("sensor1", sensor1);
ubidots.add("sensor2", sensor2);
ubidots.sendAll();
// Delay
delay(10000);
}
2. Once you've pasted the code, updated the WiFi parameters, and your Ubidots TOKEN, then Verify your code in the Arduino IDE. To do this, from the top left corner of the Arduino IDE choose the "Check Mark" icon to verify the code.
3. Next, Upload the code into your board. To do this, choose the "right-arrow" icon beside the check mark icon.
4. With the code uploaded to the board, the first data-point that is sent to Ubidots will automatically create a new device in your Ubidots account! Go to the Device section of your Ubidots account to find the new device created.
PRO TIP: If your device sensors are not connected, you can still visualize your device's connection and response through the Serial Monitor. To do this, in the top right corner of our Arduino IDE select the "magnifying glass" icon to display a serial monitor.
Getting data from Ubidots
Copy and paste the code below into your Arduino IDE. Then, assign the parameters required to establish the connection and communication with Ubidots Platform.
SSID, name of your WiFi network
PASS, password of your WiFi network
//--------------------------------------------------------------------
// XLR8UbidotsSimple.ino
//--------------------------------------------------------------------
// Copyright (c) 2018 Alorium Technology. All rights reserved.
// by Jason Pecor Alorium Technology
//
// This file is a simple example for using the Alorium Technology
// XLR8 development board with Ubidots.
//
// The hardware setup for this example requires SPI connection to an
// Adafruit ATWINC1500 WiFi breakout module.
//--------------------------------------------------------------------
#include <UbidotsXLR8.h>
#include <SPI.h>
#include <WiFi101.h>
WiFiClient client;
// Ubidots Token
#define TOKEN ""
char ssid[] = ""; // WiFi SSID
char pass[] = ""; // WiFi Password
Ubidots ubidots(TOKEN);
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
// Configure SPI for ATWINC Module
WiFi.setPins(8,7,4);
// Initialize and connect to Ubidots
ubidots.initialize();
ubidots.setDeviceName("XLR8");
ubidots.setDeviceLabel("XLR8");
ubidots.wifiConnection(ssid,pass);
// Create the variable to be controlled
ubidots.add("control", 0);
ubidots.sendAll();
}
void loop() {
// Get values from ubidots control widget
Serial.println("Get values");
float control = ubidots.getValueWithDeviceLabel("XLR8", "control");
Serial.print("control:");
Serial.println(control);
Serial.println("");
// Delay
delay(1000);
}
2. Once you've pasted the code, updated the WiFi parameters, and Ubidots TOKEN, you must then Verify this within the Arduino IDE. To do this, from the top left corner of our Arduino IDE choose the "Check Mark" icon to verify the code.
3. Next, Upload the code into your board. To do this, choose the "Right-Arrow" icon beside the check mark icon.
4. Now you're able to GET data from Ubidots! Go to the Device section of your Ubidots account to confirm the new device i automatically created with a variable called "control":
5. To start sending values from the Ubidots to your XLR8 device, simply create a control widget in any of your Ubidots dashboard. To add a new Control Widget, click on the "+" icon in the top right of the dashboard. For additional assistance creating a control widget, check out this Control Widget setup guide.
5.1. To create the widget for your XLR8 click Control > Switch > XLR8 > control > Finish.
Summary
In just a few minutes you have integrated the Alorium XLR8 board with Ubidots. You are now able to build your IoT Apps to monitor and control any system or environment. The value of data is in the decisions we make with it. Now with your Alorium XLR8 connected to and communicating with Ubidots, it's up to you to complete the solution.
Learn more about Alorium Technology at http://www.aloriumtech.com/
Other readers have found useful...