Within the US, the widespread NOAA weather stations are good enough for most needs. A home weather station doesn’t replace that but builds on it by providing a monitoring point more relevant to you — it’s your wind speed, your temperature, your humidity, and not those of some location miles away. This is how I augmented an off-the-shelf consumer weather station to make it more useful to me.
Weather Station Hardware
The market for personal weather stations is incredibly saturated, varying in price point from double-digit dollars up to hundreds or thousands. Some are temperature and humidity only where others have anemometers, rain gauges, UV meters, and so on. Choosing the right one for you means choosing which functionality you want:
- Do you want to measure wind speed and direction?
- Do you want to collect precipitation?
- Is a computer interface important to you for importing weather data?
- Is it getting installed in a location that needs a bigger solar shield?
- Do you care about measuring the UV index or other less common stats?
My first weather station was an Ambient Weather WS-2080 many years ago. While now discontinued, this style of weather station at around $100 is the least I’d even consider. It has indoor and outdoor temperature and humidity readings, a barometer, anemometer, wind vane, rain gauge, and a solar shield to improve accuracy of the outdoor thermometer. For the average owner, it’s good enough (though I’ve discovered first-hand that the plastic doesn’t hold up to 75 mph wind).
My newest purchase is a Davis Instruments Vantage Vue, which was purchased after believing the WS-2080 had finally died. It started working spontaneously two weeks after purchasing the Vue. I chose this model as a replacement due to its better build quality, built-in solar panel and super capacitor (no annual change of battery), and better computer interface.
My previous weather station was attached to a sewer vent pipe with hose clamps. This time around, I decided to use an actual antenna mast for better placement.
I screwed the antenna mast base plate to the roof downslope from the ridge cap. As a sealing backing for the base plate, I added a layer of butyl tape before mounting with roofing screws.
The weather sensor unit mounts to the top of the mast using its included bracket. I may eventually boost it up higher to meet the NOAA roof offset guidelines for more accurate wind readings.
It’s precalibrated for northern hemisphere installation, which means positioning only requires pointing the solar panel south.
While there are package deals available, the Vantage Vue provides a la carte components unlike weather stations at lower price points. Some part of that is almost certainly to maximize revenue, but it’s also for flexibility. The LCD console is the desk or wall-mount option, the WeatherLink Live is for the IoT enthusiast, and the Weather Envoy is for the data logger (the LCD console also supports data logging).
My initial plan was to duplicate the setup I had with the old WS-2080 weather station: sensor unit on the roof and console on my desk plugged into my computer. To that end, I ordered a package including the sensor unit and the desktop console.
Both the roof unit and console installed easily and synced up with no issues. Unfortunately, that’s when I discovered the flaw in the plan: their console requires an additional purchase to do data logging, and it is not cheap. For a function normally provided by a $10 component and that should be included (serial to USB adapter), the MSRP is $165. I’d like to say I used an SDR and Raspberry Pi to build my own radio receiver, but I don’t have those radio skills yet. Instead, I purchased the adapter as cheaply as I could find it, installed it in the console, and then decided I’d rather use it in the Weather Envoy. I ordered the Envoy and waited for it to come in.
If you use either the console or the Weather Envoy, they benefit from using DI’s accompanying software to adjust a few settings. Registration on their site is required to download it, but it does not force sending any kind of data back to them.
With the Envoy connected to a computer, open the configuration software.
- If not prompted to create a new station, do so via File → New Station.
- It should begin the configuration walkthrough automatically. If it doesn’t, Setup → Walkthrough… will start it.
- In the first step, Station Configuration, ensure the selected model and installed accessories are correct.
- Next, set your desired units.
- The defaults for the serial configuration are probably correct.
- Ensure the weather measurement hardware is set as the first station.
- Normally you’d calculate and enter the elevation-corrected barometer reading for the station, but the software used later will handle that part, so just enter the same number.
- Change the archive interval to every minute. The default will lead to fairly infrequent updates.
- You may be prompted to download existing records. It’s optional but can be useful as a spot-check to ensure data is coming in.
For the lifespan of the previous hardware, I used an application called Weather Snoop to capture the data. The version I had was too old for this new hardware, which meant updating if I wanted to use it. While messing around with the update’s trial, I found an open source offering: WeeWX.
Since I was changing software anyway, I decided to stop logging data to my Mac Pro and switch to something dedicated. I picked up a Raspberry Pi 4B and associated components (including an mSATA SSD). On this I installed Raspian Lite (terminal only), my typical Linux package set, and WeeWX.
WeeWX’s install process is very clean, fully supporting the Debian-style package installation via
apt. Add their repository to the source list, install the package, and it’s 90% ready.
For the weather data storage I wanted to use the mSATA drive connected via USB, which was surprisingly complicated to configure for the Raspberry Pi. The vast majority of online tutorials for the process are severely outdated — as of the beginning of 2020, this is the best practice:
- Connect the mSATA -> USB adapter to the drive and then to one of the Pi’s USB 3.0 ports.
- Find the mSATA drive’s device path via
sudo fdisk -l. In my case it was
- Create a new GPT table on it with
sudo fdisk /dev/sda. In the prompts that follow,
gis the option to manage a GPT table,
nto create a new one, defaults for the various numbers, and finally
wto write it to disk.
- Create an ext4 filesystem on the first partition with
sudo mkfs.ext4 /dev/sda1. Note the UUID, which will be needed for mounting the drive. It can be found later with
ls -al /dev/disk/by-uuidif needed.
- Create a permanent mount point (e.g.,
sudo mkdir /mnt/data).
- Add a
/etc/fstabentry for the drive using its UUID and mount point:
UUID=759ec805-9ecf-422e-80da-4ee770e92fd6 /mnt/data ext4 defaults 1
- Mount the new data drive with
mount -aor reboot the system.
Since I’ll be using WeeWX’s MySQL driver for data storage, the only step remaining is to move the MySQL (MariaDB in my case) database location to it.
- Confirm the data location by running the MySQL query
- Stop the server (
sudo systemctl stop mysql) and verify it stopped cleanly (
sudo systemctl status mysql).
- Copy the data from the old location to the new with
sudo rsync -av /var/lib/mysql /mnt/data.
- Move the old directory aside via
sudo mv /var/lib/mysql /var/lib/mysql.bak.
- Change the
datadirsetting in the server config (
/etc/mysql/mariadb.conf.d/50-server.cnf) to the new location.
- To accommodate the existing systemd script, which checks for a directory or symlink at
/var/lib/mysql, create a symlink from the old path to the new with
sudo ln -s -t /var/lib /mnt/data/mysql/.
- Start the MySQL server (
sudo systemctl start mysql) and verify it started successfully (
sudo systemctl status mysql).
- Connect to MySQL and run the query
SELECT @@datadir;again to verify the server is using the new location.
- You may optionally remove the old directory that was moved aside earlier.
With WeeWX installed and the storage ready, it’s finally time to configure WeeWX. For most values I kept the defaults, but several areas need to be customized for your location and storage preferences. Aside from those settings covered below, the only other changes I made were to disable the automatic reports enabled by default.
altitude should all be set to match the location of the weather station. These are used for certain calculations (e.g., to adjust the barometric pressure from sea level) and general display.
station_type is set to
Vantage, which instructs WeeWX to use that driver for data import.
This section contains the driver-specific settings for Vantage hardware. The default settings should generally work (
type = serial,
port = /dev/ttyUSB0,
baudrate = 19200,
iss_id = 1, and
model_type = 2), but customize any that need it.
The values in this section specify the bounds of different measurements that should be considered valid. For my location they work, but Alaskan winters or Las Vegas summers could justify a change to the temperature limits.
The first of the settings that control where the data is saved,
table_name must be set to the database configuration block and the actual table to use, respectively. In my case, I want to use MySQL, so I change the first to
database = archive_mysql and keep the default table name.
Under this section is a subsection corresponding to the
[DataBindings] configuration. To use the MySQL storage functionality, you must set the
database_name setting value to the name of the MySQL database to use.
The last settings needing configured to use MySQL as a storage backing are the
password values under the
With WeeWX collecting data once per minute, it was time to hook up the dashboard. I chose to use my existing Grafana installation to build out a dashboard for the weather data. Because the data is first saved on the Raspberry Pi and Grafana is on a dedicated VM, I decided to set up a periodic data pull on the Grafana server to save a long-term copy locally in the InfluxDB instance.
The dashboard server has a Laravel application already to pull data from my RV’s electrical system, so I opted to build the data pull into it since it’s already set up for that kind of operation.
My plans are to port over some sunrise/sunset and moonrise/moonset code from another project to incorporate in the dashboard and add a NOAA GOES satellite feed. At that point I’ll likely open up the code and do another post.