Temboo Spreadsheet
Temboo Spreadsheet
Temboo Spreadsheet
com/arduino/others/update-google-spreadsheet
Save Arduino data to spreadsheets
We'll show you how to make your Arduino add rows of data to a Google
spreadsheet. You can use this to log data from sensors connected to your Arduino,
like temperature readings over time, or other instances where your Arduino is
receiving information you'd like to record.
This sketch uses our Google > Spreadsheets > AppendRow Choreo.
GET SET UP
1Make sure you have a Temboo account. If you don't already have one, you can
register for a free account here.
2Next, make sure that you've got the latest version the Arduino IDE installed.
3Since this sketch uses a Google spreadsheet, you'll also need a Google
account.
4Login to Google's Developer Console, and create a new Project if you haven't
done so already.
5Under APIs & auth > APIs, make sure you've enabled API Access for the
Google Drive API.
6Under APIs & auth > Credentials, create a new Client ID and specify Web
application for the Application Type.
7When configuring the Consent Screen, make sure you fill out the Email
Address and Product Name fields.
8Save the Consent Screen details and specify this callback URL as
the Authorized Redirect URI:
https://ACCOUNT_NAME.temboolive.com/callback/google
COPY
9Run the Google > OAuth > InitializeOAuth Choreo, specifying the Client ID
from the app you registered at Google and the following Scope:
https://spreadsheets.google.com/feeds/
11Run the Google > OAuth > FinalizeOAuth Choreo, specifying the callback ID
returned earlier by the InitializeOAuth Choreo. This process will return a Refresh
Token which can be used along with the Client ID and Client Secret to authenticate
with Google.
18With both files in place you are ready to upload the sketch and start adding
data to your spreadsheet. Time to get logging!
EXTENDING THE SKETCH
You'll notice that your sketch always sends the same value to your spreadsheet. Of
course, it's far more interesting to send dynamic values i.e., sensor values. Here's
an example of what you need to do to make that happen.
19Add the follow line of code to your setup() method so that you're reading the
value on pin A0:
pinMode(A0, INPUT);
COPY
20Next, replace the line of code that currently adds data to your spreadsheet with
the following two lines so that your sketch reads the value on pin A0 and adds it to
the spreadsheet instead:
String sensorValue = (String)analogRead(A0);
AppendRowChoreo.addInput("RowData", sensorValue);
COPY
21That's it! Now your sketch should be generating dynamic values and adding
them to your Google Spreadsheet.
WHAT'S NEXT?
Now that you've mastered working with Google Spreadsheets, why not check out
the rest of the 2000+ Choreos in ourLibrary and get inspired for your next project.
Once you've got your code up and running, you're ready to move on and do more.
From monitoring your running applications, to moving your generated Temboo code
to your preferred development environment and sharing it with colleagues,
collaborators and friends - we've got you covered.
GET LIVE UPDATES ABOUT YOUR APPLICATION
Integrate Temboo with Slack to get up-to-the-second notifications and
alerts about your deployed Temboo code.
COMMIT CODE TO GITHUB
Commit Temboo-generated code directly to GitHub and share with the world. Learn
more.
NEED HELP?