STEM Setup Guide

Logo Build Your Weather Hero Station! Logo

Step-by-step guide to becoming an environmental superhero

You're About to Become a Real Scientist! Logo

This guide will help you build a special weather station that helps protect families from wildfires. Don't worry if it seems hard - you're going to do AMAZING!

Step by Step

We'll guide you through everything!

Ask for Help

Friends and teachers love to help!

You're a Hero

Your work keeps people safe!

Remember: Every great scientist started as a curious kid just like you! This project might seem big, but you're going to learn so much and help so many people. We believe in you! Logo

1
What Cool Stuff Do You Need? Logo

Don't have these parts yet? That's totally okay! Ask a grown-up to help you find them, or maybe your school has some you can borrow. Every scientist needs tools to do amazing work!

Mini Computer Brain 🧠

Raspberry Pi 4 - like a tiny computer that fits in your hand!

$35-75

This is the "brain" that thinks!

Weather Detective πŸ•΅οΈ

DHT22 Sensor - tells you how hot and humid it is!

$10-15

Like a thermometer that never gets tired!

Super Sensors 🦸

Extra sensors for wind, air quality - totally optional!

$15-50

Add these when you're ready for more!

Amazing News! πŸŽ‰

You can build your very own weather hero station for less than $100!

That's less than some video games, but this will help protect real families! Plus, you'll learn skills that could lead to an awesome career as a scientist! πŸš€

2
Get Your Secret Code! πŸ”‘

What's an API Key? πŸ€”

An API key is like a special password that lets your weather device talk to our computer system! It's like having a secret handshake that proves your device is part of our hero team.

🎁 Free Demo Keys to Get Started!

You can use these to test your weather station:

student_demo_001
student_demo_002
stem_test_key

Want your own special key? Ask your teacher! They can give you a personal API key that's just for your device. It's like getting your own superhero name! πŸ¦Έβ€β™€οΈπŸ¦Έβ€β™‚οΈ

3
Write Your Magic Code! ✨

Don't Worry About the Code! 😊

We wrote all the hard parts for you! Just copy and paste, then change a few things to make it yours.

Copy & Paste

Just like copying homework (but this is allowed!)

Change a Few Things

Add your name and device ID - that's it!

First, Get Your Computer Ready πŸ’»

Ask a grown-up to help you type these commands to download the special tools your computer needs:

pip install requests pip install adafruit-circuitpython-dht # For DHT22 sensor

Your Complete Weather Hero Code! 🌟

Copy this entire code and save it as a file called weather_station.py on your Raspberry Pi:

import requests import time import board import adafruit_dht from datetime import datetime import json # Configuration API_ENDPOINT = "https://ilovekanab.org/api/weather-data" DEVICE_ID = "your_device_name_here" # Make this unique! API_KEY = "your_api_key_here" # Get from your teacher STUDENT_NAME = "Your Name" SCHOOL = "Your School Name" # Your location (get from Google Maps) LATITUDE = 37.0475 # Example: Kanab, UT LONGITUDE = -112.5260 # Initialize DHT22 sensor (connected to GPIO pin 18) dht = adafruit_dht.DHT22(board.D18) def read_sensors(): """Read data from all sensors""" try: temperature = dht.temperature # Celsius humidity = dht.humidity # Percentage # Add more sensors here if you have them # wind_speed = read_wind_sensor() # air_quality = read_air_quality_sensor() return { "temperature": temperature, "humidity": humidity, # "wind_speed": wind_speed, # "air_quality": air_quality } except RuntimeError as e: print(f"Sensor error: {e}") return None def send_data_to_server(sensor_data): """Send sensor data to the wildfire tracker""" data = { "device_id": DEVICE_ID, "timestamp": datetime.utcnow().isoformat(), "location": { "lat": LATITUDE, "lon": LONGITUDE }, "student_name": STUDENT_NAME, "school": SCHOOL, **sensor_data # Include all sensor readings } headers = { "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" } try: response = requests.post(API_ENDPOINT, json=data, headers=headers) if response.status_code == 200: print(f"βœ… Data sent successfully: {sensor_data['temperature']:.1f}Β°C, {sensor_data['humidity']:.0f}%") return True else: print(f"❌ Error {response.status_code}: {response.text}") return False except Exception as e: print(f"❌ Network error: {e}") return False def main(): """Main monitoring loop""" print(f"🌑️ Starting weather monitoring for {DEVICE_ID}") print(f"πŸ“ Location: {LATITUDE}, {LONGITUDE}") print(f"⏱️ Sending data every 5 minutes...") while True: try: # Read sensor data sensor_data = read_sensors() if sensor_data: # Send to server send_data_to_server(sensor_data) else: print("⚠️ Could not read sensor data, skipping...") # Wait 5 minutes before next reading time.sleep(300) except KeyboardInterrupt: print("\nπŸ›‘ Monitoring stopped by user") break except Exception as e: print(f"❌ Unexpected error: {e}") time.sleep(60) # Wait 1 minute before retrying if __name__ == "__main__": main()

4
Connect Your Parts Like LEGO! πŸ”Œ

Safety First! πŸ›‘οΈ

Always ask a grown-up to help you connect wires. It's just like building with LEGO - everything has a special place where it fits perfectly!

Connect Your Weather Detective! πŸ•΅οΈ

It's like connecting a puzzle - each wire has a perfect spot!

RED wire (Power) β†’ Pin 1 (3.3V) ⚑
BLACK wire (Ground) β†’ Pin 6 (GND) πŸ”Œ
WHITE wire (Data) β†’ Pin 12 (GPIO 18) πŸ“‘

Super Smart Tips! πŸ’‘

Keep wires short - like shorter than a ruler!

Keep sensor cool - away from hot things like computers or lights

Protect from rain - put it in a clear plastic box if it goes outside

Ask for help - grown-ups love helping young scientists!

5
Testing and Deployment

Test Your Setup

# Quick test script python weather_station.py # Expected output: # βœ… Data sent successfully: 23.5Β°C, 65%

Auto-Start on Boot

# Add to /etc/rc.local (before exit 0): cd /home/pi/weather-station python weather_station.py &

Success! Your device should now appear on the STEM Dashboard within 5 minutes of sending its first reading.

6
Learning Opportunities

Data Analysis

Analyze temperature trends and correlate with fire risk

Programming

Learn Python, APIs, and IoT programming concepts

Fire Science

Understand how weather affects wildfire behavior

Need Help?

Having trouble setting up your device? Check out these resources: