Cloud storage can be a valuable way to save the data that an Arduino collects through the sensors it’s connected to. When I first started building sensor projects with Arduino, I found it tough to connect to the cloud and save that data. I also found it hard to do for free – I didn’t like the idea of subscribing to cloud services for a hobby project I was building in my spare time.
An Arduino can send data to the cloud for free using JSON over HTTP or by sending data via MQTT. Cloud providers that accept this data from an Arduino include Pantry Cloud, JSONSty, JSON Bin, npoint, and the official Arduino IoT service. An Arduino can also save data with paid cloud providers such as Google Cloud, Amazon AWS, and Microsoft Azure.
The cloud services in this guide require an Arduino with WiFi or Ethernet to work. If you’re unsure if your Arduino has WiFi, check out my guide here on which models have it (also includes how to add WiFi if your Arduino doesn’t have it): chipwired.com/arduino-board-wifi-guide.
Pantry Cloud is a completely free JSON store which is hosted in the cloud and interfaced with using HTTP.
An Arduino can connect to a Pantry hosted on Pantry Cloud, create Buckets for data, and then store data in those buckets.
To connect an Arduino to Pantry Cloud:
- Create a free Pantry on their website
- Retrieve the API key from the email they send you
- Create a new basket using the Dashboard or by using an HTTP POST request
- Add the WiFi or Ethernet library to your Arduino sketch
- Use HTTP PUT requests to store data in the basket
When connecting using an Arduino, remember to use SSL for all requests. This can be done by using the
connectSSL() function of the WiFi or Ethernet client included in your sketch. I had a lot of trouble getting SSL working on my UNO WiFi Rev 2, this was resolved by adding the
getpantry.cloud domain for SSL using the WiFi firmware updater.
I couldn’t find on their website exactly how much storage was available, but it seemed to only be in the kilobytes of space (calculated only by their statement that I’d used 1% of my storage after storing only a few items). Try not to have the Arduino sketch generate too many API requests as Pantry probably also has a limit on this.
Pros of Pantry Cloud:
- Completely free
- Simple interface which accepts JSON using HTTP
- Simple sign up – no need to create a password!
Cons of Pantry Cloud:
- No paid tier, which means if your project grows too big for their servers, it will need to be moved to another cloud
- No data analysis tools (this can be overcome by connecting the data from your buckets to a tool which does offer analysis)
- Limited time to live – it either lasts an hour or a month, I can’t tell from the “TTL” number
JSONsty is also a free cloud-hosted JSON store with a simple HTTP based interface.
An Arduino can connect to JSONsty and use any of the Stores under a given API key to save data in.
To connect an Arduino to JSONsty:
- Sign up to JSONsty on their website
- Retrieve API key and set up a store
- Add the WiFi or Ethernet library to your Aduino sketch
- Use HTTP PUT requests to save data in the store
I felt JSONsty was more complicated to use than Pantry Cloud. The documentation is a little more difficult to digest, and it’s a little more complicated to manipulate HTTP headers in an Arduino sketch (the API key for JSONsty is included via these headers).
Remember to use SSL for JSONsty. This means using the
connectSSL() function of the WiFi or Ethernet client you’ve included in your sketch.
I couldn’t find any details on the limitations of JSONsty, but I can imagine they don’t want you using too much storage or generating too many API requests per second. The source code for JSONsty is available on GitHub, so it is possible to set up your own cloud using the JSONsty model if you find you’re out-growing the free one.
Pros of JSONsty:
- Completely free
- Relatively simple interface (not quite as simple as Pantry Cloud)
- Open source, giving you the choice to replicate the service for yourself
Cons of JSONsty:
- Unclear what the limits of use are
- No paid tier to upgrade those limits
- No data analysis tools, however you can connect such tools to JSONsty
JSON Bin is a cloud storage service designed for hosting JSON using an HTTP API. It offers free and paid tiers.
An Arduino can connect to JSON Bin and store data in Bins. To help organise data, JSON Bin also offers Collections which are groups of bins. Scheme Docs are also available to enforce organisation of data in a collection, which can be useful for testing and when collaborating with other people.
Connection by an Arduino to JSON Bin is similar to other HTTP API methods:
- Setup a free account on their website, a Google, Facebook, Twitter, or GitHub account is required
- Retrieve the API key and setup a collection and a bin
- Add the WiFi or Ethernet library to your sketch
- Use HTTP PUT requests to add data to the bin
I felt a little annoyed that I couldn’t sign up with an email, though at least they offer GitHub as an alternative to the traditional social media.
The JSON Bin website can be found here, and documentation can be found here. I found the documentation a little more difficult to digest compared to the other JSON HTTP API stores on this list. Remember to use SSL when working with the JSON Bin API.
JSON Bin offers a free tier which includes 10,000 requests and up to 500kB of storage. This is plenty for a single Arduino project, though as the requests are only a single time offer, you’ll likely find them used up quickly if you have multiple Arduino boards (or projects) using the same account. The paid tier starts at $10 for 1 million requests, and more can be added form $3 for 3 million.
Pros of JSON Bin:
- Free tier and paid tier, allowing you to upgrade your data when your project out-grows its free storage (also allows you to send more requests); this also gives you the security of knowing the owner of the service is maintaining it and going to keep it active
- Relatively simple interface, which also allows you to group bins by collection
Cons of JSON Bin:
- Free tier limits you to 10,000 requests total (it doesn’t seem that these ever renew)
- No email sign up – sign up requires an account with Facebook, Twitter, Google, or GitHub
- No data analysis tools, though you can connect such tools to JSON Bin (they will use your requests though)
Arduino IoT Cloud
The Arduino IoT Cloud is a service run by Arduino designed to allow Arduino boards to participate in Internet of Things (IoT) networks. This can include sending data to the cloud from an Arduino, or having the Arduino receive commands from the cloud.
An Arduino device uploading data to the cloud is associated with a Thing. Multiple Arduino boards can be linked to a Thing. Variables can be measured from the Thing, and dashboards can display those variables graphically.
Connecting to the Arduino IoT Cloud involves the following steps:
- Create an Arduino account
- Install the Arduino Create Agent if you don’t have it already
- Log in to the Arduino IoT Cloud site and create a Thing
- Select the devices to be associated with the Thing
- Create variables, these will be loaded into a sketch which is sent to the device later
- Configure the details of your WiFi network
- Make any edits you feel necessary to the sketch
- Upload the sketch to an Arduino
- Setup a dashboard and view the variables in the dashboard
There are a lot of steps there! The Arduino website here has a lot more detail on each of these steps.
While this appears to be the most complete cloud solution on this list, I feel there are too many steps involved. It ties you to the Arduino ecosystem while not teaching you what is going on ‘under the hood’. If anything goes wrong, I can imagine it’ll be hard to fix.
The cost of the Arduino IoT Cloud is described below:
|No. of Things
Pros of Arduino IoT Cloud:
- Comprehensive solution to get data from your Arduino into the cloud
- Free and paid tiers, ensuring support for your project from when it’s very small through to when it’s very big
- Analytics and visualisations, dashboards can be easily built to help you analyse the collected data
Cons of Arduino IoT Cloud:
- Many ‘under the hood’ steps are hidden in Arduino’s pre-prepared sketches and libraries. This can make it difficult to troubleshoot when things go wrong, I also feel it hampers learning about cloud connected devices.
- Many steps involved between start and getting data into the cloud
- Free tier only has 1 day of data prevention
- Limited devices (not all WiFi enabled Arduino devices are supported)
n:point is a JSON storage service intended to help you quickly setup a project that interacts with JSON data saved in the cloud. I found it difficult to search for in Google due to the colon in the name… (link is here if you want quick access).
Currently n:point is still in development. It allows you to create a cloud store of JSON data, however it does not yet allow devices like Arduino to send their data to the cloud.
The easiest way to send data from an Arduino to the cloud is to use JSON and send it over HTTP.
Arduino offers an official Arduino IoT Cloud that works with some Arduino boards; this can be a good solution if you’re just getting started exploring cloud connectivity and IoT.
If you’re interested in understanding how cloud data storage works, and how devices actually upload data to the cloud, a JSON data store – such as Pantry Cloud – can offer a good alternative.
Chris’ first microcontroller project was a device that measured home power consumption and uploaded the data to a central store for analysis. At the time he was using Zigbee, but if he were to do the project again now, he’d use an IoT cloud.