Connecting Anduino to IFTTT
Connect your anduinoWiFi to IFTTT. Control everything around you, or ‘let go’ and let random events in cyberspace control your surroundings!
The Arduino, and most popular DIY embedded solutions for that matter are usually great at one of two things; Communicating with sensors and discrete pieces of hardware, or running complex or interpreted code and connecting to third party services (APIs). Balancing power consumption, processing capabilities, and storage will always offer tradeoffs. This usually lands us choosing between Raspberry Pi or Arduino.
Raspberry Pi and embedded Linux grants you the opportunity to easily integrate third party libraries and implementations to utilize, say a Java SDK to connect to AWS. Although things can get tricky when it comes time to speak to the DHT22 temperature sensor that’s pushing readings to your S3 bucket.
With Arduino, instead of having to wrap Python, on top of C, and having no real great way to guarantee consistent timing for readings; You can easily communicate to the sensor on the Arduino using the “bit-banged” proprietary protocol and less than 200 lines of code. Not to mention you’ll be hard pressed to get your Arduino MKR1000 to draw 750ma of current to get the job done.
In an ideal world you’d have:
- Low power consumption
- Simple/close to the hardware, real time sensor integration
- 3rd party API connectivity and TLS security
Finding a single hardware device that fulfills all these requirements is inevitably going to initiate some compromises. I might argue that a true, complete solution, would actually include both an Arduino style embedded device and an embedded Linux machine working together. But when you’ve only got your Arduino Due and anduinoWiFi shield there’s still a great way to get connected to the wonderfully diverse world of open API’s out in the wild.
- Logging sensor data to a Google Docs spreadsheet
- Sending a push notification to your phone when your laundry is done
- Illuminating your umbrella handle with an led if there’s rain in the forecast
- Opening your garage door when you pull into the driveway
All of these ideas are totally possible with only a WiFi101 connected Arduino. In a recent project write up we saw how easy it is to connect Arduino to Adafruit IO using anduinoWiFi. Adafruit IO is going to be our gateway to IFTTT. So essentially, by publishing/subscribing to feeds using MQTT (just like we did here) we’ll be able to communicate with any applet on IFTTT.
We’re going to jump right into IFTTT and assume that you’ve already tried the ‘Anduino Speaks Adafruit‘ project and are completely fluent in Adafruit IO, Adafruit MQTT, feeds, etc. If not, take a quick detour and come back in 20 minutes. Assuming you’ve just confirmed your sensor readings in the Adafruit IO dashboard what’s next? Let’s hop on over to IFTTT and get these sensor readings streaming to Google Docs.
So you’ve signed up for IFTTT and your ready to create your first applet. Applets are what IFTTT calls the little logic widgets that control what happens ‘if this’ event occurs. Click ‘+ this’:
And you’re greeted with a long list possibilities! In this first applet we’re going to send data from our Arduino to Google Docs. So:
IF our Arduino has a ‘temperature reading’ log that reading in a google spreadsheet’.
Using MQTT we’ve already published our latest reading in a feed on Adafruit IO, so next we need to get that feed speaking to Google. Search for Adafruit and select:
Read more: Connecting Anduino to IFTTT