If a temperature sensor takes a measurement in the woods but there’s nobody around to read it, is it hot out?
If you’ve got a project that’s collecting data, you might have reasons to put it online. Being able to read your data from anywhere has its perks, after all, and it’s key to building smarter interconnected systems, too. Plus, you can tell strangers the humidity in your living room while you’re out at the pub, and they’ll be really impressed.
Taking the leap into the Internet of Things can be daunting however, with plenty of competing services and options from the basic to the industrial-strength available. Today, we’re taking a look at two options for logging data online that are accessible to the beginner.
Key Things To Look For
When trying to find an online logging platform, there’s a few things to consider. Ease of use is a primary consideration, as those just getting their feet wet with the Internet of Things don’t need to be scared away by complexity. Anything involving compiling obscure libraries or setting up complex databases is out. Additionally, cost is also a factor. Expensive subscriptions are a discouragement for those who wish primarily to dabble. For this article, we’ve selected two options that have a good feature set and a low bar of entry for beginners.
For many IoT projects, the aim is to get a bunch of sensors, monitor the output, and make some graphs. If that’s your use case, IOTPlotter, as the name suggests, may be just the tool for you. Free to use, it’s perfect for low-key logging of numerical data.
To use IOTPlotter, it’s necessary to create a feed, which generally would correspond to a single device. This feed can contain several graphs, pertaining to different sensors or data. Writing to a feed is easy, achieved most readily through Python code or any other platform capable of making a basic HTTP request. To prevent random interlopers from making unauthorised changes, a feed is secured by an API key which is required to submit data and make requests. While it’s by no means a high-end security measure, it’s more than enough for the average DIY project.
A smattering of other features make IOTPlotter just that little bit more useful. It’s possible to combine multiple data feeds onto a single graph, and also automatically export graphs in PNG format for external use. This is particularly applicable to situations where you may wish to display the data on an external website or in a mobile phone application. There’s also privacy options that allow you to close your feed so that it’s for your eyes only. Perhaps the only feature you may miss at this level is data export – there’s no easy way to spit out a CSV file of all your collected data to date.
The documentation for the service is succinct – barely two pages long! Those with basic Python experience can be up and logging within half an hour, including initial sign up. If your applications swerve towards the more powerful, there are rate limits to consider, and as a free service, it doesn’t come with the same guarantees as a full-fat commercial offering. But if you’re working at that level, it’s likely IOTPlotter is not the solution for you anyway.
If your logging needs are more serious, and you’ve got designs on doing some serious number crunching down the track, you’ll want to focus on storing your data in an accessible format. Throwing it into a spreadsheet is a great way to go, and Google Sheets is a great online platform for just such a purpose. When all you need is to handle creating, reading, updating, and deleting records, we call this a CRUD app. While it’s more common to use a full-fat database, for many applications, Google Sheets is powerful enough, and takes a lot less work to set up. As a bonus, it’s already set up to access from anywhere and can easily be shared with others, too.
As a spreadsheet, you have the full flexibility to write in data any way you like. However, this also means that there’s a little more complexity involved in writing to Google Sheets. There’s also authorization required via OAuth 2 and the Google API Console. It’s not as easy as working with IOTPlotter, but still achievable in a few hours for the average user. These requirements mean that it’s generally easier to work with Google Sheets using a computer, like a Raspberry Pi, rather than a microcontroller. [Greg Baugues] has a great guide to getting the job done for those working in Python. However, it is possible to use workarounds to get the job done on a more lightweight platform. As [Shishir Dey] demonstrates, it’s possible to submit to Google Sheets with an HTTP request with the help of a little scripting.
The benefit of such a method is that exporting data for further analysis is trivial. Simply clicking “File->Download” provides a variety of options, including CSV, for export. This allows the data to be used in software like MATLAB or other scripting languages, allowing you to run statistics and generate plots till the cows come home. It requires a little extra legwork, but for scientific projects, this flexibility is key to getting good results from data.
For those looking for fancier interfaces or more bulletproof offerings, other options do exist. We’ve run features before on IoT services, and also discussed the benefits of MQTT as a data transport method. If what we’ve discussed here today doesn’t quite fit the bill, do a little further reading on what’s out there and see what best suits your use case. When you’re project is done, take some photos and drop us a line, and as always, happy hacking!