Tutorial: What are WeatherSense Sensors ?

What are WeatherSense Sensors?

WeatherSense is an open source protocol and software that allows weather and environmental instruments communicate with the Raspberry Pi, ESP32 and Arduino based computers.  You have ALL the software source code available to learn how these devices work and to make your own modification.   A great way to learn and develop your own abilities.

The WeatherSense Sensors

WeatherSense

SwitchDoc Labs has developed a set of WeatherSense compatible sensors and has several others in development.    The current list WeatherSenseof supported sensors are:


WeatherSense

SkyWeather2 Raspberry Pi Weather Station

The SkyWeather2 Weather Station is a full weather station based on the Raspberry Pi.  It supports all the WeatherSense sensors and comes with a WeatherRack2 and a WeatherSense Indoor Temperature and Humidity Sensor.

The WeatherSense Raspberry Pi Software

The Wireless WeatherSense kits come with a full set of open source software for your Raspberry Pi.   You can download the software from github.com/switchdoclabs or add-on a pre-formatted SD Card with all these goodies already on the card for a simpler experience.

The Raspberry Pi software uses a Software Defined Radio (see description below) to demodulate and interpret the 433MHz signals being sent from the WeatherSense instruments to your Raspberry Pi.   There are lots of compatible SDRs available on Amazon and Ebay.  The one SwitchDoc Labs sells here, is just one of many that will work.

If you want to have all this preinstalled on an SDCard from your Pi, a pre-formatted 32GB SDCard is available here.

The latest version of the Raspberry Pi base WeatherSense Software is here.

The WeatherSense Raspberry Pi software includes:

  • All messages published on MQTT  (topic: weathersense/#)
  • Available rtl_433 433MHz open source drivers (download and install from here: https://github.com/switchdoclabs/rtl_433
  • WeatherSense open source MySQL database program – stores your data!
  • A dash_app ready to display and analyize your data from all the WeatherSense sensors!

The WeatherSense software supports:

And more WeatherSense sensors on the way!

WeatherSense

The WeatherSense 433MHz Software

All of the 433MHz WeatherSense sensors are supported by open source software written for the fabulous rtl_433 package.  You can download the modified rtl_433 package here.  Eventually, all the WeatherSense drivers will be migrated to the main rtl_433 package.

 

The WeatherSense Arduino DriversWeatherSense

We have support currently available for the WeatherRack2 and the WeatherSense Indoor T/H Sensors.

These are available here:

We will be releasing Arduino software for the other WeatherSense devices too.

The WeatherSense Raspberry Pi Pico Drivers

The Raspberry Pi Pico drivers are in development now.   Once the Pico is in general release, we will be building software to support the Pico.

The WeatherSense Open Protocol

All of the WeatherSense devices use an open source protocol.  You know exactly what is begin transmitted and when.  You can even play with the source code to change what is being transmitted and where to receive it!

Here is an example of what is transmitted from one of the WeatherSense Sensors, the Air Quality Sensor.

WeatherSense

What is a Software Defined Radio?

WeatherSense

A Software-defined radio (SDR) is a radio communication system where components that have been traditionally implemented in hardware (e.g. mixers, filters, amplifiers, modulators/demodulators, detectors, etc.) are instead implemented by means of software on a personal computer or embedded system (still with significant hardware support.)

The SDR we are using with WeatherSense is based on the powerful RTL2832U and R820T tuner, it can tune into signals from 24MHz to 1850MHz.    SwitchDoc Labs has written drivers for the WeatherSense sensors and supplies the drivers to the community open source.   These are all available in a pre-built SD Card image.

From Our CTO on the Science Behind the Products!

Detecting Lightning with the WeatherSense Lightning Sensor

How the heck do we detect lightning?  You would think it would be pretty easy, but it turns out it is not.   It’s not just like a giant spark.   Well, it is a giant spark, but there are lots of other things that make electrical noise that can be confused for lightning.  Your computer (even your Raspberry PI and Arduino!), your car, the motor in your refrigerator, your cell phone, your computer monitor, your AM/FM radio and even your TV.  They all make electrical noise that can be confused with Lightning.

The Thunder Board detects Lightning and provides a distance estimate to the “leading edge” of an incoming storm.

The phrase “leading edge” is a bit misleading, since it suggests that one is in the direct path of the storm. In fact, for the purposes of the Thunder Board, the leading edge is simply the closest edge of the storm, which may never actually arrive if the storm delivers a glancing blow nearby. However, its distance away from you – regardless of where it is heading – is the most relevant information.

A lightning strike creates an electromagnetic pulse that can be detected using an external antenna tuned to 500 kHz, with a bandwidth of 33 kHz. An analog front-end (AFE) demodulates and amplifies the antenna signal, and a watchdog circuit alerts the lightning detector once an event crosses its threshold. However, numerous other electromagnetic events create high-energy events. It is important that such non-lightning “disturbers” not be misinterpreted as lightning – and vice versa.

We then decide whether the event has the characteristics of a lightning strike. If not, it is rejected as being the result of a disturber. If it decides that it is lightning, the energy of the event is calculated and stored, and then the storm distance is calculated based on that and prior events.

An interrupt then completes the process so that the Arduino or Raspberry Pi can retrieve the information and take action.

Sounds like magic?  It’s not.   But it is pretty cool that you can build a kit that does this.

John has created a video explaining how the lightning detector works and how to tune it.

 

Detecting Air Quality Levels with the AQI Sensor

The Laser PM2.5 Sensor (HM3301) is a next generation of laser dust detection sensor, which is used for continuous and real-time detection of dust in the air.   It is an inexpensive, yet accurate, way of measuring air quality in terms of AQI,

It is very different from the older versions of dust detectors and Different from the pumping dust detection sensor, and uses a fan to drive air during sensing and the air flowing through the detection chamber is used as a test sample to perform real-time and continuous test on dust of different particle sizes in the air.

The HM-3301 Dust Sensor is based on the advanced Mie scattering light theory. When light passes through particles with quantity same as or larger than wavelength of the light, it will produce light scattering. The scattered light is concentrated and focused on a highly sensitive photodiode, which is then amplified and analyzed by the internal circuitry.   Using a specific mathematical model and algorithm you can obtain the count concentration and mass concentration of the dust particles.   Very nice.

The HM-3301 Dust Sensor is based on the advanced Mie scattering light theory. When light passes through particles with quantity same as or larger than wavelength of the light, it will produce light scattering. The scattered light is concentrated and focused on a highly sensitive photodiode, which is then amplified and analyzed by the internal circuitry.   Using a specific mathematical model and algorithm you can obtain the count concentration and mass concentration of the dust particles.   Very nice.

The HM3301 is composed  a fan, an infrared laser source, a condensing mirror, a photosensitive tube, a signal amplifying circuit and a signal sorting circuit.

Understanding the 433MHz Radio Signals

The engineering on this project was great fun for the whole engineering team.    Others handled the sensors and our manufacturers, but I was tasked  with figuring out how to receive (demodulate) all the incoming 433MHz signals from the WeatherSense sensors.    It was a heck of a challenge!

The first thing we did was to learn how to use a Software Defined Radio (SDR) on the Raspberry Pi.  We started analyzing the signals coming into the antenna and figuring out what was going on.   We had the digital data formats from our manufacturing partners but what it looks like coming in over radio waves was quite another challenge.    We first decoded the simpler Indoor Temperature / Humidity Sensor (making sure we used the proper CRC checksum to guarantee correct reception – 433MHz is noisy and there are lot of other things on the frequency band such as your car key, garage door openers, etc., etc.).   We used as a starting step a variety of tools on our Raspberry Pi (RF_Hacker  and rtl_433 for two) and started to match the signals coming from the SDR to the digital bits.   The coding uses something called Manchester Encoding which makes it difficult to read the signal data with just the eye.   We wrote software to decode it and after a lot of effort, we were reading the Indoor Sensor and the WeatherRack2 correctly from the Raspberry Pi using our Software Defined Radio.

 

Next, we had to do the Arduino drivers.   No help with a Software Defined Radio on this platform.  We had to read in the encoded data (from a simple receiver, the RXB6 – we chose this receiver after testing about 10 different ones.  Great value and reception for the cost) and look at the timing down on the order of about 200 usec.  That is 200 millionths of a second!  Using a Saleae Logic Analyzer, we figured out what parts were what and then wrote and modified software to get the data out of our sensors using an Arduino (which is a tiny computer compared to the Raspberry Pi!).   Whew!   One very odd thing we found out this way was the each Indoor Temperature/Humidity message sent each message three times, with no gaps (see picture) and our WeatherRack2 sent each message twice with a gap.  Explained why we would pick up multiple transmissions with the Raspberry Pi SDR!

We repeated the process on the ESP32.

We are giving you all the source code for these products.  We hope you enjoy using it and playing with it as much as we did!

 

2 Comments

  1. I am in the process of re-installing the first build of the SkyWeather unit at the South Florida Science Center. The SkyWeather 2 might be a better configuration using part from SkyWeather? Is there a recommended scenario for this migration. I will be changing the camera orientation to be a overhead sky view to be used in conjunction with the observatory telescopes. I’ve changed the eyepiece on the telescopes to a battery powered RPi camera and stream the observations directly to the internet.
    https://www.youtube.com/watch?v=frkk1W9Afag
    We hope to combine this with a live 24hr view from GOES so we have the view from & to earth. https://w6aer.com/setting-up-goes-weather-satellite-receiver-raspberry-pi/

    • You are doing some amazing things! There is no good migration path from SkyWeather to SkyWeather2 because of the differences in the sensor package. The WeatherRack2 is completely wireless (much easier installation!) and there is a new board that plugs into the Raspberry Pi for SkyWeather2.

      The external sensors have also been reworked for SkyWeather2. Now the Air Quality and Lightning Sensors are wireless and Solar powered. This really helps the lightning detector to get away from the Raspberry Pi and all the RFI from the computer.

      You are probably better off buying a full SkyWeather2 product and then adding the sensors.

      Here is a coupon for $10 off of all the main WeatherSense kits, including SkyWeather2: “Enter the code “WSENSESPRINGSALE” at checkout for a $10 discount for each of the following products.

      We are also giving free domestic shipping for orders over $299.

      The $10 product discount (taken at Checkout) covers these products ($10 per product BTW):

      – SkyWeather2 – Includes the WeatherRack2 Wireless Sensor Unit​

      – Lightning Detector – Solar Powered Wireless – WeatherSense​

      – Air Quality Sensor – Solar Powered Wireless – WeatherSense​

      – WeatherRack2 – 7 In One Weather Sensor – Wireless​

      BP

1 Trackback / Pingback

  1. Tutorial: Adding More Solar Panels to SkyCam and WeatherSense Sensors - SwitchDoc Labs Blog

Comments are closed.