IoT Weather Station Using Sense-Hat

iot-weather-station-using-sense-hat
Spread the love

IoT Weather Station Project

Build an IoT weather station using Sense-Hat and store the data in Google Sheets.

Objective:

The primary goals of this project are to build an IoT weather station using sense-hat to measure the temperature, humidity, and pressure and then store the data in Google sheets.

Components Used:

Sense Hat: It’s a device full of sensors (Temperature, Humidity, Pressure Sensor, Gyroscope, Accelerometer, Magnetometer)

Raspberry Pi: IoT Development board

Working Principle:

In this project, I choose a Sense Hat and Raspberry pi. Sense-Hat is a device full of sensors. It basically consists of a temperature sensor, humidity sensor, pressure sensor, gyroscope, accelerometer, magnetometer. The Sense HAT is an expansion board for Raspberry Pi.

The Raspberry Pi is a low-cost, IoT development board that plugs into a computer monitor or TV and uses a standard keyboard and mouse.

Project Plan for sending Sense HAT Weather Data to Google Spreadsheet:

iot-weather-station-using-sense-hat

Raspberry Pi: IoT Development board

Three steps for sending Sense HAT Weather Data to Spreadsheet:

  1. Configure Google Developers Console
  2. Install all the necessary Dependencies on Raspberry Pi
  3. Write and Run a program on Raspberry Pi

1. Configure Google Developers Console

Head over to the Google Developers Console and create a new project (or select the one you have.)

iot-weather-station-using-sense-hat

Enable Drive API:

Step 1

iot-weather-station-using-sense-hat

Step 2

Enable Sheets API:

iot-weather-station-using-sense-hat

Generate Service Account Key:

Step 1

Step 2

iot-weather-station-using-sense-hat

Step 3

iot-weather-station-using-sense-hat

JSON File:

Here’s how this file looks like:

Create Spreadsheet in Google Drive:

Go to Google Drive and Login into your Account.

Step 1

Step 2

Step 3

iot-weather-station-using-sense-hat

2. Install all the necessary Dependencies on Raspberry Pi

Now we are done with configuring our console lets install all necessary dependencies on Raspberry Pi.

Install gspread:

sudo pip install gspread

Install oauth2client:

sudo pip install oauth2client==1.5.2

Depending on your system configuration, you may need to install PyOpenSSL:

sudo pip install PyOpenSSL

3. Write and Run program on Raspberry Pi

Run program on Raspberry Pi:

SourceCode of weather station is given as an attachment App_weatherstation.py

NOTE: Place both “SourceCode” i.e “App_weatherstation.py” and “Service Account Key” Files in the same folder.

Changes to be made in App_weatherstation.py:

Replace this with “Service Account Key” name which you have downloaded in “JSON” format, within single quotes.

# Oauth JSON File

GDOCS_OAUTH_JSON = ‘My Project – 073ef0b09530.json’

Replace this with “Spreadsheet” name you have given.

NOTE: It is case sensitive, replace it within single quotes.

# Google Docs Spreadsheet Name

GDOCS_SPREADSHEET_NAME = ‘Sense Hat Weather Station’

NOTE: Don’t forget to save.

Run Code on Raspberry Pi:

Now you can run the code using terminal.

iot-weather-station-using-sense-hat

If you running using a terminal it looks like.

View Code on Spreadsheet:

Now, you can now send your data to a Google Spreadsheet and view it.

iot-weather-station-using-sense-hat

Data Analytics (DA) is defined as a process that is used to examine big and small data sets with varying data properties to extract meaningful conclusions from these data sets.

These conclusions are usually in the form of trends, patterns, and statistics that aid business organizations in effective decision-making processes.

Also Read: What Is TeamViewer and How to use TeamViewer?


Spread the love

Be the first to comment

Leave a Reply

Your email address will not be published.


*