How to read Airthings Wave Mini Sensor data using Raspberry Pi

Orjan Gengedal

June 15, 2020

RELEASE NOTES:

Initial release 2-June-2020

 

Do you own a Wave Mini? Do you like to code in Image: How to read airthings Wave Mini with raspberry pi your spare time? Great news! You can now read Wave Mini sensor data using a Raspberry Pi.

Airthings Wave Mini has three key sensors including TVOCs, temperature and humidity. It is the perfect first step into understanding the health and comfort level in every room, or a great addition to an existing air quality system.

Our developers provide a starting point to help you read sensor data from an Airthings Wave Mini using a Raspberry Pi 3 Model B over Bluetooth Low Energy (BLE). You can see the full script (read_wavemini.py) on GitHub.

Wave Mini  Airthings Wave Mini. Now with mold risk indication!

Requirements 

The following tables show a compact overview of dependencies for this project.

OS  Model/version Comments
Raspbian Raspberry Pi 3 Model B Used in this project.
Linux
x86 Debian Should work according to bluepy

 

List of linux/raspberry dependencies

Package Version Comments
python 2.7 or 3 Tested with python 2.7.13 and 3.7.3
python-pip
  pip for python2.7
python3-pip
  pip3 for python3
git
  To download this project
libglib2.0-dev
  For bluepy module

 

List of third-party Python dependencies

Module Version
bluepy 1.3.0

 

Step one: Set up your Raspberry Pi 

The first step is to setup the Raspberry Pi with Raspbian. An installation guide for Raspbian can be found on the Raspberry Pi website. In short: download the Raspbian image and write it to a micro SD card.

To continue, you need access to the Raspberry Pi using either a monitor and keyboard, or by connecting through WiFi or ethernet from another computer. The latter option does not require an external screen or keyboard and is called “headless” setup. To access a headless setup, you must first activate SSH on the Pi. This can be done by creating a file named ssh in the boot partition of the SD card. Connect to the Pi using SSH from a command line interface (terminal):

$ ssh pi@raspberrypi.local

 

The default password for the pi user is raspberry.

cloud

 

Step two: turn on the BLE interface 

In the terminal window on your Raspberry Pi, enter the following commands:

pi@raspberrypi:~$ bluetoothctl
[bluetooth]# power on
[bluetooth]# show
[bluetooth]# exit

 

After issuing the command show, a list of bluetooth settings will be printed to the Raspberry Pi terminal window. Look for Powered: yes.

 

Step three: install Linux and python packages 

Raspbian images usually come with Python (2 and/or 3) pre-installed. To verify Python installation, enter the following commands in the terminal window:

pi@raspberrypi:~$ python2 --version
pi@raspberrypi:~$ python3 --version

 

Install Linux packages:

pi@raspberrypi:~$ sudo apt-get update && sudo apt-get install libglib2.0-dev git

If you’re using Python 2, install the following packages:

pi@raspberrypi:~$ sudo apt-get install python-pip

pi@raspberrypi:~$ sudo pip2 install bluepy==1.3.0

If you’re using Python 3, install the following packages:

pi@raspberrypi:~$ sudo apt-get install python3-pip

pi@raspberrypi:~$ sudo pip3 install bluepy==1.3.0

clouds nienke style copyStep four: Downloading the script

Downloading using git:

pi@raspberrypi:~$ sudo git clone https://github.com/Airthings/wavemini-reader.git


 

Downloading using get:

pi@raspberrypi:~$ wget https://raw.githubusercontent.com/Airthings/wavemini-reader/master/read_wavemini.py

Step Five: Reading sensor data  

The general format for calling the script (read_wavemini.py) is as follows:

pi@raspberrypi:~$ sudo python read_wavemini.py SERIAL_NUMBER SAMPLE_PERIOD

 

After a short delay, the script will print the current sensor values to the Raspberry Pi terminal window. Optionally, you may pipe the readings to a text-file (instead of terminal) using the following format:

pi@raspberrypi:~$ sudo python read_wavemini.py SERIAL_NUMBER SAMPLE_PERIOD > somefile.txt

Exit the script using Ctrl+C.

Positional input arguments Type Description
SERIAL_NUMBER Integer 10-digit number found under the magnetic backplate of your Airthings detector.
SAMPLE_PERIOD Integer Time in seconds between reading the current sensor values (excluding the overhead of connecting to target). Note that sensor values are only updated every 5 minutes.

 

Example output of running the script:

Temperature: 27.33 *C, Humidity: 25.51 %rH, VOC: 48 ppm
Temperature: 27.33 *C, Humidity: 25.51 %rH, VOC: 48 ppm
Temperature: 27.33 *C, Humidity: 25.51 %rH, VOC: 48 ppm
Temperature: 27.33 *C, Humidity: 25.51 %rH, VOC: 48 ppm

 

Note that the script requires that your device is advertising. If your device is paired/connected to e.g. a phone, you need to turn off Bluetooth on your phone while using the scripts.

 

Sensor data description

Sensor  Units
Temperature °C
Humidity %rH
VOC ppm

 

 

Airthings Wave Mini

Wave Mini

Featuring TVOCs, temperature and humidity sensors, Wave Mini is the perfect first step into understanding the health and comfort level in every room, or a great addition to an existing air quality system.

 

 

Our most popular products

View Plus

The most advanced smart air quality tech on the market measuring radon, particulate matter (PM), CO2, and more, plus a customizable display.
View Plus
View Plus $299

Wave Plus

The first battery-operated smart indoor air quality monitor with Radon detection, including sensors for temperature, air pressure, humidity, VOCs, and CO2.
Wave Plus
Wave Plus $229.99

Wave Radon

A smart radon detector with quick and accurate results on your smartphone.
Wave Radon
Wave Radon $199.99

Wave Mini

Now with mold risk indication! Wave Mini helps with asthma, allergies, sleep and overall health. The perfect first step to understanding health and comfort levels in any room.
Wave Mini
Wave Mini $79.99

Home

Meet Corentium Home by Airthings, a simple to use, battery-operated radon gas detector with display.
Home
Home $149.99

Hub

Complete the system. The Airthings Hub brings one or more devices online providing on-demand access to your indoor air quality (IAQ) data at anytime, from anywhere!

Radon map

Thousands of Radon sensors across the world, broken down by location. See your region's approximate risk level.

Explore

Thousands of Radon sensors across the world, broken down by location. See your region's approximate risk level.

Explore