Airthings Wave Plus and Raspberry Pi

Orjan Gengedal
December 17, 2018

How to read Airthings Wave Plus Sensor data using Raspberry Pi

RELEASE NOTES:

  • Release dated 14-Dec-2018
  • Added SAMPLE-PERIOD as an input argument.
  • Initial release 12-Dec-2018

View the full script on GitHub.


Due to popular demand, Wave Plus owners can now read sensor data using a Raspberry Pi. Our latest code is hosted at Github which has the most recent updates and HOW-TOs for using Raspberry Pi. Additionally, you can request new features, open issues or even contribute to the project by creating pull requests.

Airthings Wave Plus is a smart IAQ monitor with Radon detection, including sensors for temperature, air pressure, humidity, TVOCs and CO2.

In a previous post, we showed you how you could use a Raspberry Pi 3 Model B to read sensor data from the Airthings Wave over Bluetooth Low Energy (BLE).

Similarly, this guide explains how to read sensor data using the Raspberry Pi 3 Model B from the Airthings Wave Plus using the same approach.

To get started, follow the setup as explained in the previous Airthings Wave article and install the required packages/modules on the Raspberry Pi device.

Download the Python script:

 <span style="font-weight: 400;">pi@raspberrypi:~$ wget https://raw.githubusercontent.com/Airthings/waveplus-reader/master/read_waveplus.py</span>

The following python script "read_waveplus.py" is only compatible with python2.7. In this guide, we have used python version 2.7.13. In addition to the pre-requisites listed in the previous post, the following python module must also be installed:

 pi@raspberrypi:~$ sudo pip2 install tableprint==0.8.0

Read sensor data from the Airthings Wave Plus

The available sensor data are temperature, humidity, CO2 level, TVOC level, pressure, running average 24-hour radon concentration and running long-term average radon concentration.

To read the sensor data from the Airthings Wave Plus, you need the 10-digit serial number of the device. This can be found under the magnetic backplate of your Airthings Wave Plus. If your device is paired and connected to e.g. a phone, you may need to turn off bluetooth on your phone while using these scripts.

The general format for calling the "read_waveplus.py" script is as follows:

 <span style="font-weight: 400;">read_waveplus.py SN SAMPLE-PERIOD [pipe &gt; yourfilename.txt]</span>

Where the input arguments are:

Input arguement Example Comments
SN 0123456789 10-digit number. Can be found under the magnetic backplate of your Airthings Wave Plus.
Sample period 60 Read sensor values every 60 seconds. Must be larger than zero.
Pipe pipe > yourfilename.txt Optional. Since tableprint is incompatible with piping, we use a third optional input argument "pipe".


Except for the radon measurements, the Wave Plus updates its current sensor values once every 5 minutes. Radon measurements are updated once every hour. The radon measurements are given in Bq/m3 and the maximum value that can be read by the script is 16383 Bq/m3. Please note that the radon measurements are only available 1 hour after the batteries have been inserted.

Printing data to the terminal window

By default, the read_waveplus.py script will print the current sensor values to the Rasberry Pi terminal. Run the Python script in the following way:

<span style="font-weight: 400;">pi@raspberrypi:~ $ sudo python2 read_waveplus.py SN SAMPLE-PERIOD</span>

where you change SN with the 10-digit serial number, and change SAMPLE-PERIOD to a numerical value of your choice.

After a short delay, the script will print the current sensor values to the Raspberry Pi terminal window. Exit the script using Ctrl+C.

Piping data to a text-file

If you want to pipe the results to a text-file, you can run the script in the following way:

 <span style="font-weight: 400;">pi@raspberrypi:~ $ sudo python2 read_waveplus.py SN SAMPLE-PERIOD pipe &gt; yourfilename.txt</span>

Change SN with the 10-digit serial number, and change SAMPLE-PERIOD to a numerical value of your choice. Exit the script using Ctrl+C.

Final notes

This guide has been tested with Raspberry Pi 3 Model B, Raspbian Stretch, bluepy 1.2.0, tableprint 0.8.0 and Python 2.7.13.

Let us know how it went and what you would like to see next on our facebook page.