WeatherOS is a MicroPython-based operating system for the Raspberry Pi Pico W designed to run a wireless outdoor weather station for collecting localized climate data.
- Collects temperature, humidity, pressure, and rainfall data
- Wireless data transmission to your own server
- Customizable data collection intervals
- Easy configuration through JSON files
- Flexible sensor configuration (all sensors are optional)
- Adafruit SHT41: Temperature and humidity (uses I2C)
- Adafruit BMP280: Barometric pressure (uses SPI)
- Rain sensors: Basic contact-based detection (water completes circuit, requires ADC pin)
- Coming soon: Solar/light intensity sensing
- Raspberry Pi Pico W
- Sensors (Optional):
- Adafruit SHT41
- Adafruit BMP280
- Rain sensor connected to an ADC pin
- Stable power source for the Pico W
- Server running MySQL (8.0+) and Apache2 with MySQLi
-
Connect your desired sensors to the Raspberry Pi Pico W:
- SHT41 via I2C
- BMP280 via SPI
- Rain sensor to an ADC pin
- Custom pin configurations can be defined in
config.json
-
Provide a stable power supply to your Raspberry Pi Pico W
- Install MicroPython on your Raspberry Pi Pico W
- Download the WeatherOS files from this repository
- Transfer all files to the root directory of your Pico W
- Create a
config.json
file based on the providedexample_config.json
- Create a
secrets.py
file based on the providedexample_secrets.py
- Install and configure Apache2 web server with MySQLi enabled
- Set up MySQL server (version 8.0+)
- Create the database schema by running the provided
create_schema.sql
file - Install the WeatherOS API software from the WeatherOS API repository
The repository includes example configuration files:
example_config.json
: Template for sensor configuration and data collection settingsexample_secrets.py
: Template for storing sensitive information like WiFi credentials
Create your own config.json
from the example to customize:
- Which sensors are enabled and their pin assignments
- Data collection intervals
- Server connection details
Create your own secrets.py
from the example to store:
- Network credentials
Example configuration:
{
"system":{
"wireless": true,
"log_level": "WARNING",
"log_file": "weatheros.log",
"web_server": "example.com",
"pull_rate": 30
},
"status_leds":{
"enabled": false,
"red_pin": 2,
"yellow_pin": 3,
"green_pin": 4
},
"SHT41":{
"enabled": true,
"precision": "high",
"mode": "i2c",
"sda": 0,
"scl": 1,
"freq": 100000
},
"BMP280":{
"enabled": true,
"mode": "spi",
"sck": 10,
"tx": 11,
"rx": 12,
"csn": 13
},
"DSK":{
"enabled": true,
"pin": 0
}
}
Once set up, your weather station will automatically collect and transmit data to your server. You can access this data through:
- The WeatherOS API
- Custom applications that connect to your MySQL database
- Direct database queries
- If sensors aren't being detected, verify your wiring connections and pin configurations
- For connectivity issues, ensure your Pico W is within range of your WiFi network
- Check server logs for API and database connection problems
- Verify your ADC pin configuration if the rain sensor isn't working properly
Enjoy your new weather station!