This example uses a FT232H with a MAX31855 thermocouple breakout accessed over SPI. Links to setup the FT232H were provided early in the guide. To install the library for the MAX31855, see here:

Here is the wiring diagram:


You will also need an appropriate thermocouple sensor attached to the MAX31855 Red - and Yellow + terminals. See the Adafruit thermocouple guide in selecting the appropriate sensor.

Create a new Sheet to hold this data and give it a name. Here we also add some column titles:

Add just like we did in the test example, share the sheet with the "client email" address from the .json file. Click the SHARE button:

And add the "client email" address from the .json file.

Also, grab the gibberish spreadsheetID from the URL so you can use it in the code below. See previous section of guide for more info on this.

And here's the code for logging MAX31855 sensor data to you Google Sheet. Be sure to replace YOUR_CREDENTIALS_FILE and YOUR_SHEET_ID with the actual values for your setup.

# SPDX-FileCopyrightText: 2020 Carter Nelson for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
from datetime import datetime
import board
import digitalio
import adafruit_max31855
from google.oauth2.service_account import Credentials
from googleapiclient.discovery import build

#--| User Config |-----------------------------------------------
#--| User Config |-----------------------------------------------

# Sensor setup
cs = digitalio.DigitalInOut(board.C0)
max31855 = adafruit_max31855.MAX31855(board.SPI(), cs)

# Google Sheets API setup
SCOPES = ['',
CREDS = Credentials.from_service_account_file(SERVICE_ACCOUNT_FILE, scopes=SCOPES)
SHEET = build('sheets', 'v4', credentials=CREDS).spreadsheets()

# Logging loop
while True:
    values = [[, max31855.temperature]]
                          body={'values' : values}).execute()
Don't forget to also set the BLINKA_FT232H environment variable.

Save that as something like and then run it with:


It should run without errors and start logging:

After a couple of minutes, go back and look at your sheet. It should be updated with new values:

This guide was first published on Jan 17, 2020. It was last updated on Jan 17, 2020.

This page (FT232H with MAX31855 on SPI) was last updated on Sep 18, 2023.

Text editor powered by tinymce.