Wednesday, September 28, 2016

Arduino Yun interfacing with TMP36 sensor using Temboo and ThingSpeak IoT platforms

Arduino Yun is wifi enabled board from Arduino. The binary can be flashed over wifi. The sensor data collected can be pushed to cloud through wifi connection.
The data is pushed into IoT cloud platforms like Temboo, ThingSpeak, Ubidots etc. Most of the platforms are free for basic usage.
Once the data is in the cloud platform, it can be passed on to the upper layer of stack such as Android App or an excel sheet where the data can be processed.
The IoT platform provider provides libraries and API's to send and receive data from their cloud platform.

Block diagram of the data flow 




Arduino YUN
https://www.arduino.cc/en/Main/ArduinoBoardYun
I have Arduino YUN purchased from Arduino org and not Arduino cc. There was a split in the original Arduino company and hence the clarification.
Though there are no major differences but keep in mind that the board detects as Linino* instead of Arduino* when detected over wifi.
Once you connect, the password to be entered in doghunter.
http://forum.arduino.cc/index.php?topic=364731.0

Sensor
TMP36
The sensor used here is TMP36 which is analog based. Change in temperature results in change in voltage which needs to be measured through Arduino board analog pin and then convert the analog data to digital (ADC) in the code. The sensor is not that accurate due to its analog nature but its cheap and readily available.

IoT cloud platforms
https://temboo.com/
https://thingspeak.com/
There are various cloud platforms which can be used to store the data from the IoT boards and then can be processed or passed to upper layer of stack such as webserver, Android App etc.
Include the corresponding platform header file in the Arduino code and link the library, use the platform API's to read/write data to the platforms.

Connection of Arduino YUN with the sensor


Arduino Code for pushing data into Temboo
https://github.com/jaglinux/arduino-yun-sensor-spreadsheet

https://github.com/jaglinux/arduino-yun-sensor-dropbox

Arduino Code for pushing data into ThingSpeak
https://github.com/jaglinux/Arduino-YUN-TMP36_sensor-ThingSpeak

ThingSpeak public channel
https://thingspeak.com/channels/164264

No comments: