en you power up the air quality monitor, using either USB or through the Arduino external power connection (see specifications link), the display will light in a few seconds with a green backlight. From left to right and top to bottom, the diplay will show sensor output for: RH, Temperature (F), CO2 equivalent, and TVOC equivalent values.
As mentioned, normally, the iAQ Core chip takes a few minutes to warm up. During this time, you will see a warm-up code instead of the values. Similarly, if other errors occur with either sensor, the appropriate error code will be displayed instead of a value.
If you exhale close to either sensor, you should see a jump in the RH value as well as the CO2 equivalent value. If you place the monitor in various home environments, like the kitchen when cooking, you will get an idea of the range of values.
Note also that iAQ values outside of the specified sensing range can be displayed, as is mentioned in the datasheet, and I preserved that characteristic in the software. The LCD values will refresh every two seconds, and that rate can be changed in the program code.
An easy way to test the BLE connectivity is to use nRF Connect for mobile (previously called nRF Master Control Panel). This free software is an impressive tool. Install it on your device (I used one with an Android OS), run it, and scan for BLE devices. If you have powered up the monitor you should see it in the list.
Screenshot of the nRF Connect Scan—note the "AirQuali" device
Tap on "CONNECT" and you will see the list of all of the monitor's variables that are being transmitted. Notice also that the LCD backlight has changed to blue, denoting a connection.
Screenshot showing the monitor's six transmitted characteristics
Next, tap on each of the six triple downward arrows (the first one is circled). You will see the same list of characteristics, but now you will see their values and they will update every couple of seconds.
Screenshot showing the monitor's six transmitted characteristics and their values
Those values are the sensor values that are being transmitted by the monitor. In order, they are: iAQ Core status, iAQ Core CO2, iAQ Core TVOC, HIH status, HIH RH, and HIH temperature.
If you examine the program code, you will see where these variables are transmitted, as well as their type. For example, the second value, which is circled in red, is 0xc2, 0x01, 0x00, 0x00. This value is for the CO2 measure which is a 16-bit integer. The first two bytes of the value represent this integer in "LSB, MSB" format. That is, the integer value is 0x01c2, which is decimal 450, which was the CO2 reading on the LCD at the time of the screenshot.
The TVOC variable is a long integer (32 bits), and RH and temperature are floating-point values—you could translate those as well.
Examination of the code will also reveal the assignment of a universally unique identifier (UUID) for each characteristic. These are generated using random numbers and were the product of using an online generator.
The nRF Connect app does not replace a custom app for the monitor which you could write for your device, but it is a very easy way to see what is going on and to verify the BLE functionality.
Below, you can download the complete Arduino code for the Indoor Air Quality Monitor. It is straightforward and should not be too difficult for you to customize, if you are so inclined.
For reference, this is the setup I used to write the code:
- Windows 7, 64 bit
- Arduino 1.6.7
- Intel Curie Board 1.0.6 (as installed through the Arduino Board Manager)
- Samsung Galaxy Notepad Pro 12.2 (as a central BLE device)
This has been an interesting, rewarding, and very educational project for me. I am, in fact, impressed by the sophistication of the sensors as well as the relative ease of the implementation.
Hopefully, you will also find it interesting. If you do build one, or something similar, please let us know how it went for you.
Give this project a try for yourself! Get the BOM.