Git Product home page Git Product logo

log-temperature's Introduction

Log Temperature

Log temperature / air pressure to a Google Sheet with a Raspberry Pi

Graph of example data

Setup

1. Python configuration

Install Python 3.6 (Note: This step can take several hours to run)

Install the required packages: pip3.6 install gspread oauth2client

2. Setup the temperature sensor

Install Adafruit_Python_BMP python module

Enable the I2C protocol feature in Raspberry Pi

3. Get access to Google Sheets API

Follow the tutorial here to get API access to Google Sheets

Put the resulting client_secret.json file in this directory

Open logger.py and set the SPREADSHEET_NAME variable to the title of your spreadsheet. (You can also specify the worksheet tab name, if you're using a specific tab)

4. Running the script

Run python3.6 logger.py to get a temperature and pressure reading and log it to the google sheet.

5. Scheduling the script

Run crontab -e to edit your crontab and add the following line (you may have to adjust the path based on where you cloned the repository). This will make the script run every 5 minutes.

*/5 * * * * /usr/local/bin/python3.6 /home/pi/log-temperature/logger.py /home/pi/log-temperature/client_secret.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.