A year ago, I installed a system based on a Raspberry Pi Zero to manage my backyard lights. Since the system is installed outside in a weatherproof box, I have decided to install a DS1820 temperature sensor, send the data to APRS1, and use the APRS infrastructure to monitor the weather.
The DS1820 is a sensor that uses the one-wire protocol and is easy to install on a Raspberry Pi. I just had to connect the positive, negative wires, and I have attached the data wire to the GPIO-17 (pin 11).
If you search the internet on how to use the DS1820 with a Raspberry Pi, people suggest using a pull-up resistor. In my setup, I don't use an external pull-up resistor. Instead I have enabled the pull-up the resistor within the microprocessor.
I have added the following line to the
/boot/config.txt file. This
line tells the kernel to load the one-wire driver, which GPIO pin to
use, and to use the microprocessor internal pull-up resistor.
After rebooting the system, look inside the
directory to find the sensor's address. The sensor's name should
28 followed by a 16 digit number.
The temperature from the sensor can be read using the command
cat. The first line ending with
YES means that the data was read from
the sensor without errors. On the second line, you will find the
temperature in thousands of degrees Celsius.
pi@pizero:~ $ cat /sys/bus/w1/devices/28-3c01f095702b/w1_slave 68 01 55 05 7f a5 81 66 43 : crc=43 YES 68 01 55 05 7f a5 81 66 43 t=22500
APRS is an amateur radio-based system for real-time digital communications. APRS is free but to use it, you need to have a valid ham radio license.
I wrote a python program to send the weather data to the APRS network. The code and the explanation on how to install it are available on my GitHub account at the address https://github.com/0x9900/aprs_wx
The data collected on APRS are also sent to the Citizen Weather Observer Program. The CWOP is a public-private partnership with three goals:
- to collect weather data contributed by citizens;
- to make these data available for weather services and homeland security;
- to provide feedback to the data contributors so they have the tools to check and improve the data quality.
Automatic Packet Reporting System ↩