SCRATCH Weather Dashboard Gladys Gonzalez
Materials: Raspberry Pi 3 Peripherals: Downloads: Mouse & Keyboard HDMI Cable Power Supply Display Micro SD Card Downloads: Raspbian OS Python3 Scratch Python script Guide (with GitHub edits) at: https://www.raspberrypi.org/learning/weather-station-dashboard/
Project Expectations: See weather data around United Kingdom towns Run a Python script to connect to weather stations Access the external script using enabled remote sensors in the Scratch program Fetch weather data from specific Weather Stations Display using Scratch animations
Steps Set up Raspberry Pi for first time use Download software and the Python script Open Scratch and enable remote sensors Run the script (& keep it running, as it will feed data to scratch and will also constantly listen out for broadcasts) Work on Scratch Making variables Setting variables to specific Weather Station IDs to collect data Simultaneously Visualize data being fetched and produced Display the Animation
Step 1: Set up Download RASPBIAN OS image to SD card Use Win32 Disk Imager to write the image on the SD card Load the SD card in the slot on the Raspberry Pi Connect all peripherals (power supply being the last) Connecting the power supply will automatically power on the device, so make sure all other components are ready.
Step 2: Download Python script Open Terminal (Ctrl, Alt, T) Type the command: wget –O interface.py rpf.io/wsd
Step 3: Open the Scratch Program RUN the preloaded Scratch program (in Raspbian OS) In “sensing blocks” right click “slider sensor value” and enable remote sensor connections This is to be able to fetch the data from the Python script
Step 4: To run the downloaded script In the Terminal type the command: python3 interface.py
Step 5: Back to Scratch Program Create a new Variable Set the variable to a weather Station ID
Step 5 (Continued): Sensors In “Sensing” blocks use the “Slider Sensor” block and the pull down menu to select which sensors to collect data from
Step 5 (Cont.) : Use Different Blocks to Display the Data
Step 5 (Cont.) : Create & Customize Sprites by uploading images
Step 5 (Cont.) : Thermometer Settings Configure the settings so that the gauge in the thermometer image moves up and down as the weather value is displayed.
Step 5 (Cont.) : Arrow Settings Configure the settings for the arrow sprite that was created to show the speed and direction of the wind.
Step 5: Display the animation! When all blocks are in place Click the GREEN FLAG to begin the animation!
Final Remarks: Join multiple blocks using variables and the sensors to achieve data output. Using the Scratch website will cause an “undefined” error in the sensing blocks. Certain Sensing blocks may only be available in the Scratch Program and not on the web version of Scratch.
WEB/IOT The idea was to send this animation to my website so it can be displayed with my other animation. Next steps: Figure out how to have the animation work on a website without using the web version of Scratch Use a tracker on the website to see how many people watch the animation