Raspberry Pi Weather Station Project

Version 15

    raspberry pi weather station

    Using SenseHAT, InitialState Cloud Service and your Raspberry Pi, create a working Weather Station

     

    Overview:

    This kit helps to build your own local weather dashboard, capturing the weather inside and outside your house or office over time. This super-fun and easy project will leverage the Internet of Things (IoT), using the new Raspberry Pi 3 with built-in WiFi, a Sense HAT, and the Initial State cloud platform. Raspberry Pi will capture all the sensor data from SenseHAT and stream it directly to the cloud and this stream of data/information can be monitored or displayed in a professional graphical fashion which can be accessed from your smartphone or computer from anywhere in the world with just a few button clicks.

     

    • Project level: Beginner
    • Approximate time to complete: 20 minutes

     

    Get the kit:

    SenseHAT Weather StationSenseHAT Weather Station

    (you can remove individual item(s) at the cart )


    Project requires:

     

    1. Raspberry Pi3Raspberry Pi3

    2. Translucent EnclosureTranslucent Enclosure

    3. 16GB MicroSD card preloaded with NOOBS16GB MicroSD card preloaded with NOOBS

    4. Raspberry Pi Sense HATRaspberry Pi Sense HAT

    5. Pi3 Power Supply 5V, 2Pi3 Power Supply 5V, 2A

    6. 7" Pi Display7" Pi Display or HDMI monitor with HDMI cable

    7. Keyboard & Mouse (for HDMI monitor)

     

     

     

    Option 1: Follow the instruction if you have downloaded the full Raspberry Pi project images from element14 community.

     

    Instructions:

    1.  Download the full Raspberry Pi image with demo code from here

    2.  Insert the uSD card into your computer SD card reader and write the downloaded imaged into uSD card using image writing software like “Win32DiskImager”, wait for the write to complete. Exit the imager and eject the SD card.

    3.  Insert the uSD card into Raspberry Pi and boot the system. Now connect your Raspberry Pi to the internet using WiFi setup utility and make sure you are connected to the internet.

    4.  Go to the www.InitialState.com and signup for a free account.

    5.  Now login to your InitialState account, click on your username in the top right, then go to “my account”. At the bottom of the page click on “Create a New Key” to generate your unique key to stream the data. Make a note of this Access Key.

    6.  On the Pi Desktop you will find a Python project file named “pi_weather.py” which we need to edit and update with the Initial State unique Access Key.

    7.  Now before we move further we need to install Initialstate ISStreamer. Open the LX terminal and execute below command:

     

    $ cd /home/pi/

    $ \curl -sSL https://get.initialstate.com/python -o - | sudo bash

     

    While installing it ll ask your Initialstate account credential created under step 4.

     

    8.  Now we need to edit the demo file using editor of your choice, here given example using Nano editor:

     

    sudo nano pi_weather.py

     

        a. Replace the text “ENTER YOUR KEY” with your Access Key “XXXX”

        b. Save the file with the same name by pressing Ctrl + X (to exit), y (to save the changes in the file, ENTER (to save with the same name).

     

    9. Now run the modified Python file to start the weather station:

     

    sudo python pi_weather.py

     

    10. Go to the browser from your computer or mobile device and login to your initial state account and start monitoring the data.

     

     

    Option 2: Please follow below instruction if you want to build this project from scratch on you existing RPi Image.

     

    Preparations:

    1. Download the Python project filehere

    2. Copy the downloaded file into a USB drive

    3. Go to the www.InitialState.com and signup for a free account.

    4. Now login to your InitialState account, click on your username in the top right, then go to “my account”. At the bottom of the page click on “Create a New Key” to generate your unique key to stream the data. Make a note of this Access Key.

    5. Connect the hardware and USB drive

     

    Hardware & Software Setup:

    1. Connect all the provided hardware and boot the Raspberry Pi 3 as a standard setup. Now connect your Raspberry Pi to the internet using WiFi setup utility and make sure you are connected to the internet.

    2. Setting up SenseHAT and Initial State streamer on Raspberry Pi to stream sensor data to the cloud;

     

    a. Installing SenseHAT. Open the LX terminal and execute below commands:

     

    sudo apt-get update

    sudo apt-get install sense-hat

     

    b. Initial State: Open the LX terminal and execute below command:

     

    \curl -sSL https://get.initialstate.com/python -o - | sudo bash

     

    c. Above two steps will install SenseHAT drivers and Initialstate ISStreamer on to the Pi, it might ask for your Initialstate account credential password to proceed.

     

     

    3. Now insert the USB drive and copy the downloaded Python file from the USB drive into Raspberry Pi working directly or directory of your choice.

    4. Now we need to edit the Python file to enter you unique Access Key. You can use

    any editor of your choice, here given example using Nano editor:

     

    sudo nano pi_weather.py

     

    a. replace the text “ENTER YOUR KEY” with your Access Key “XXXX”

    b. Save the file with the same name by pressing Ctrl + X (to exit), y (to save the changes in the file, ENTER (to save with the same name).

     

    5. Now run the modified Python file to start the weather station:

     

    sudo python pi_weather.py

     

    6. Go to the browser from your computer or mobile device and login to your initial state account and start monitoring the data.