re 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.