A Pastebin API for Arduino

Over the past few weeks I’ve been developing a Pastebin application program interface (API) for Arduino. I’ve always admired telemetry systems, which beam data from a logger in the field to the web. But the high cost and proprietary nature of telemetry systems led me to largely admire them from a distance.

The Arduino API I describe below is an extremely small step in the direction of low-cost communication networks. There are lots of exciting developments in this area, including things like XBees, some of which can communicate up to 40 miles. But I’m not going to get into any of that exciting stuff right now. My exceedingly modest goal is to present a means of posting data to Pastebin.com using a thermistor, an Arduino, and a WiFi shield.

At the outset, I should say that I’ve been very disappointed with the Arduino WiFi shield. If I had done a bit more research before buying the shield I would have realized that there are lots of baked-in shortcomings, that the devices ship with obsolete firmware that is difficult to upgrade, and so on. Internet communication is a lot to expect from a small, open-source shield. I absolutely appreciate the skill and effort that went into developing the shield, but I also appreciate that the shield has major faults that aren’t properly noted by the folks selling it.

But if I were faced with the choice today, I would absolutely not buy the Arduino WiFi shield. Not nearly worth the money, in my humble opinion. But since I made the mistake of buying the shield, I can’t help but play around with it. Below, I’m going to describe how I use an Arduino to gather data and post it to Pastebin.com.

Ingredients

 

First off, you’ll need to go to Pastebin.com to get a free account, and then go to their API page to get your API development key, which will allow you to post remotely. Pastebin.com is apparently loaded with obnoxious ads, although I don’t see them because I use AdBlock Plus and NoScript to block advertisements and JavaScript in my browser. Whether or not you block the ads, when you’re done you should have your username, password, and API development key. In addition to those credentials, I use the following setup:

I connected the hardware according to Figure 1, with the wireless shield stacked on the Arduino Uno.

Figure 1. My hardware setup. An ethernet shield is shown in the image, although I did indeed use the obtuse WiFi shield.

Figure 1. My hardware setup. An ethernet shield is shown in the image, although I did indeed use the obtuse WiFi shield.

Read more of this post