Language Switcher

Save the temperature you get with obniz to a spreadsheet!

Make things

Make the program that saves measured temperature on the spreadsheet by obniz Board. Using a spreadsheet is an example, but it’s easy to make a graph of how the temperature has changed.

Materials

How to make

Hardware Connection

Connect a temperature sensor(Grove SHT31) to an obniz Board like the table and the image below.

obniz Grove SHT31
0 SCL
1 SDA
+ VCC
GND GND

[reference] parts library obniz (SHT31)

Software

The program writes the measured data to Google spreadsheets through IFTTT.

IFTTT is a service that allows you to do “If XX (This) happens, then XX (That) will be executed. To illustrate with a concrete example, you can create things like “When it’s tweeted, summarize the content on a spreadsheet” or “When it’s close to my house, turn on the air conditioner”.

First, set the “if” part. Click on “This”.

Choose a service(Step 1 of 6 )
Type “webhooks” in the search field and click on the one that comes up.

Choose trigger (Step 2 of 6 )
Click on “Receive a web request“.

Complete trigger fields (Step 2 of 6 )
Enter “temp” in the EventName field and click on “Create trigger“.

Next, click on “That” to set the recording destination.

Choose action service (Step 3 of 6 )
Type in “googlesheets” in the search field and click on the one that comes up.

(You may need to select a Google account and allow access from IFTTT).

Choose action (Step 4 of 6)
Click “Add row to spreadsheet“.

Complete action fields (Step 5 of 6)
Set the information to be written on the spreadsheet.

  • Spreadsheet name: Spreadsheet name (in this case, obniz_temp)
  • Formatted row: What kind of data is written on the spreadsheet
  • Drive folder path: Set which folder in Google Drive you want to save to

Review and finish (Step 6 of 6)
Click [Finish] to complete your creation.

Also, there are some items to check for the settings.

Go to the [Webhooks] settings page and click on “Documentation” in the upper right-hand corner.

Copy the bold letters that follow the word “Your key is”. I’ll use it later in the program. Then, replace the Your Key (code.js line5) with the copied key.

Program

How to use

Measured temperature data is stored on a spreadsheet every 20 minutes.

(It might delay up to 15 minutes).

In the end

Using obniz Board and spreadsheets, we can now easily accumulate data.
Take advantage of the IoT by graphing and analyzing the data you’ve saved!