Don't see your favorite hardware here? Rest assured the Notecard works with virtually every MCU and SBC available. If you can't figure out how to complete this tutorial let us know in our forum and we can help you out.
This tutorial should take approximately 40-50 minutes to complete.
In this tutorial, you'll learn how to take sensor readings from a Device and send readings to your Notecard and the Blues Wireless Notehub. You'll use C/C++ (Arduino/Wiring) running on a Arduino Nano 33 BLE Sense wired up to Notecarrier-A hardware. If you would like to use a different language, board, or Notecarrier, modify the dropdowns at the top of this guide.
The tutorial uses mock sensor readings for simplicity, but feel free to hook up a physical sensor of your choice and use that instead.
If you get stuck at any point during this tutorial, the full source for each example is available on GitHub:
First, you’ll need to get all of your hardware connected. Follow the instructions below to connect your Arduino Nano 33 BLE Sense and Notecard mounted on a Notecarrier-A.
In order to complete this guide, you’ll need the following:
- Notecard mounted to Notecarrier-A.
- Any Arduino-capable Microcontroller (MCU). We will be using the Arduino Nano 33 BLE Sense, but any MCU that can be programmed with the Arduino IDE will do.
- Micro USB to USB-A cable.
NOTE: For this tutorial, you'll be powering the Notecard through the MicroUSB connection of your Arduino Nano 33 BLE Sense. Some Arduino-compatible devices cannot handle 2 Amp pulses from the Notecard when connected to GSM, so if you experience resets or other power-related issues, we suggest powering your Notecard separately through the USB or LiPo connector on the Notecarrier.
If you need additional help finding the correct I2C, Power, GND, and Serial pins on your Arduino, be sure to visit the Arduino Boards & Modules page to find your board, along with its corresponding pinout diagram under the "Documentation" tab.
For example, here are the pinout diagrams for the Arduino Nano 33 BLE Sense.
Now, let's connect your Notecard using a Serial connection.
- Connect
TX
from the Notecarrier-A to theRX
pin on your Arduino Nano 33 BLE Sense. - Connect
RX
from the Notecarrier-A to theTX
pin on your Arduino Nano 33 BLE Sense. - Connect
GND
from the Notecarrier-A to aGND
pin on your Arduino Nano 33 BLE Sense. - Connect
V+
from the Notecarrier-A to the+5V
pin on your Arduino Nano 33 BLE Sense.
NOTE: For the Arduino Nano series, the
+5V
pin is not wired as an output, by default. However, you will need to use a 5V supply to the Notecard to ensure it always has enough power for network communication. Following the guide here, create a solder bridge between the two pads markedVUSB
on the back of the board, then make sure to power your project with a USB cable.
Now that your hardware is all connected, let’s create a new Notehub project to receive sensor readings from your Notecard.
Navigate to notehub.io and log-in, or create a new account.
Using the New Project card, give your project a name and ProductUID.
NOTE: The ProductUID must be globally unique, so we recommend a namespaced name like
"com.your-company.your-name:your_product"
.
Take note of your ProductUID. This identifier is used by Notehub to associate your Notecard to your project.
For this portion of the guide, we'll be using the Arduino IDE, so be sure to install version 2.0+ if you haven't already.
Once installed, we'll need to add support for your Arduino Nano 33 BLE Sense Board.
Start the Arduino IDE, then select the Tools > Board: [board name] > Boards Manager... menu.
In the search box, type "nano 33 BLE" and press the Enter key. Select Arduino Mbed OS Nano Boards from the list, and press the Install button.
Once the installation completes, click Close.
Now select Arduino Nano 33 BLE from the Tools > Board: menu.
Finally, select your device from the Tools > Port > Serial Ports list.
Great job, now you're ready to write some firmware!
When communicating with the Notecard, you can manually send requests using the
Serial.println
function and passing-in JSON objects, or use the
note-arduino library. Code snippets
are provided for both methods, so feel free to use the approach that works best
for you.
Now that you've configured your Arduino to communicate with the Notecard, let's grab some pseudo sensor readings.
If you have your own sensor, feel free to hook it up and use your own values instead of this tutorial's mocked ones.
Now that we're getting sensor readings, let's send these to our Notecard.
Once you start capturing readings, your Notecard will initiate a connection to Notehub and will start transferring Notes. Depending on signal strength and coverage in your area, it may take a few minutes for your Notecard to connect to Notehub and transfer data.
Return to notehub.io and open your project. You should see your notecard in the Devices view.
Now, click on the Events left menu item. Once your sensor Notes start syncing, they’ll show up here.
You’ve successfully connected your Arduino Nano 33 BLE Sense and sensor to your Notecard!
Now you're ready to connect this Notecard project to a cloud application! Take a look at our routing tutorials, which cover a number of popular cloud applications and data visualization tools.
During this tutorial, you set your Notecard into continuous
mode, which
maintains an active network connection and enables faster syncs with Notehub.
It doesn't have much impact on data usage, but it will draw more power. If
you're connected to battery power, or want to transition your project to battery
power, then you can put your Notecard into periodic
mode with the following
request using the in-browser terminal or directly in your firmware.
{
"req": "hub.set",
"mode": "periodic",
"outbound": 60,
"inbound": 120
}