Software Defined Radio (SDR) Weather Station Copyright(C) 2020, BrucesHobbies, All Rights Reserved
sdrWeatherStn.py records any 433 MHz data it recognizes from a low-cost Software Defined Radio (SDR) USB dongle such as the NooElec R820T which are about $25 USD. If your country uses a different frequency than 433.92 MHz, such as 868 MHz, 315 MHz, 345 MHz, and 915 MHz ISM bands, you can update the frequency in the Python script. The program logs each sensor to a separate Comma Separated Variable (csv) file with the option of throttling the data to every 15 minutes or custom time intervals. The program automatically generates a header row for each sensor log file with the appropriate labels for the data that will be logged. The program also logs some types of security sensors, smoke detectors, car tire pressure monitoring sensors including id, etc. Logs can be analyzed in a spreadsheet program or using MatPlotLib. The script, publishData.py, is for you to customize the alerts or to add interfaces like Blynk, Twilo, MQTT, etc. - This is a DIY project for the Raspberry Pi or similar system using an inexpensive RTL-SDR. The software is written in Python and runs under Linux.
I have a pump house and workshop where I don't run the heat normally. I wanted to track the temperature and humidity levels to prevent frozen pipes and black mold. Heating in the pump house is from a single heat lamp and I didn't want to think about the water damage if the bulb should burn out in the middle of a sub-freezing night. I purchased a weather station to monitor the out buildings and was very impressed with the 433 MHz wireless range, but clearing the minimum and maximum temps/humidity daily, and alarm programming were not so user friendly using a special sequence with only 3 buttons. It just seemed natural to see if I could use the RPI with a Software Defined Radio (SDR) to pick up the temperature and humidity readings and define my own custom alerts along with logging all the data. Using a SDR on the RPI, I was able to pick up Ambient Weather, Acurite, and LaCrosse weather stations. To get a complete list of devices supported see: https://github.com/merbanan/rtl_433
Figure 1: RPI with SDR
Figure 2: Ambient Weather Station and Outdooor Temperature / Humidity Sensor
Figure 3: Acurite Temperature / Humidity Sensor
Figure 4: LaCrosse Outdoor Temperature / Humidity Sensor
The program runs from a terminal window or at boot. If run from a terminal window the status screen is as shown below:
2020-12-21 15:30:00 Ambientweather-F007TH Id nnn Ch 1 Temperature 70.8F Humidity 37
2020-12-21 15:30:01 Ambientweather-F007TH Id nnn Ch 1 Temperature 70.8F Humidity 37
Figure 5: Temperature Plot
Figure 5: Humidity Plot
As an Amazon Associate I earn a small commission from qualifying purchases. It does not in any way change the prices on Amazon. I appreciate your support, if you purchase using the links below.
The base stations are not needed but nice to have as a second display.
- Raspberry Pi (any of the following)
- RPI-Zero
- RPI 3B+
- RPI 4B
- Power adapter for your Raspberry Pi
- Heatsinks (optional)
- SD-Card
For installing the Raspberry Pi operating system, you may want a USB keyboard and USB mouse along with an HDMI cable and monitor. If using the RPI4, a Micro-HDMI to HDMI adapter may be needed. Once installed and configured you may want to switch to SSH or remote desktop so that you can remove the monitor, mouse, and keyboard.
Here are the instructions to install the Raspberry Pi Operating System. Raspberry Software Install Procedure
Before continuing make sure your operating system has been updated with the latest updates.
sudo apt-get update
sudo apt-get full-upgrade
sudo reboot now
sudo apt-get install git libtool libusb-1.0.0-dev librtlsdr-dev rtl-sdr cmake automake python3 python3-pip
sudo git clone https://github.com/merbanan/rtl_433.git
cd rtl_433/
sudo mkdir build
cd build
sudo cmake ..
sudo make
sudo make install
cd ~
Matplotlib is used for plotting temperature and humidity:
sudo pip3 install matplotlib
There are 3 python files. To get a copy of the source files type in the following git command assuming you have already installed git:
git clone https://github.com/BrucesHobbies/sdrWeatherStn
Please feel free to fork and contribute or provide feedback on priorities and features. I have an email / SMS alert that I want to clean up and include. Other possible additions are:
- Relay / buzzer
- MQTT
- OpenHab
- Home Assistant
- Domoticz
- Blynk
- IFTT
- PubNub
- Twilio
- Cellular
- APRS
Just simply type the following from a terminal window:
python3 sdrWeatherStn.py
To plot the data, edit the csv file list in the Python script and then run:
python3 plotTempHumidity.py
Type the following command:
sudo crontab –e
Select the type of editor you are familiar with. I used nano. Add the following line at the end of the file and then press ctrl+O to write the file and ctrl+X to exit the nano editor.
@reboot sleep 60 && cd sdrWeatherStn && python3 sdrWeatherStn.py
Let us know what you think of this project and any suggestions for improvements. Feel free to contribute to this open source project.