Air quality is crucial for a healthy life, and our team has designed a device to help you monitor it easily. Our prototype uses the Infineon PAS CO2 sensor, which is connected to a Bluetooth LE SoC CYW20829. This device is powered through an USB port, making it user-friendly and portable. You can simply plug it in anywhere and connect it to your phone or other sensor networks. With this device, you can monitor the air quality around you with ease and simply breathe better!
What'sthisCO2Sensor?
The XENSIV™ PAS CO2 sensor is a real carbon dioxide (CO2) sensor in an unprecedented small form factor. Designed based on the photoacoustic spectroscopy (PAS) concept, the sensor saves more than 75% space compared to existing commercial real CO2 sensors.
Two boards are used in this hardware design, the first one is the the XENSIV™ PASCO2 Shield2Goboard. This board is equipped with the XENSIV™ PAS CO2 sensor and comes with a ready-to-use Arduino library on GitHub.
Since there is no Shield2Go board available for the Bluetooth SoC CYW20829 we created a custom design for this project - aShield2Go prototyping board, which features a CYW20829 module with necessary pinouts and programming interface. Having some space left, we also put an analog microphone, LEDs, and a user button on the custom board.
Both boards can be fitted together and interfaced using I2C communication.
If you want to rebuild the custom Bluetooth Shield2Go, download the schematics, BOM & Gerber files from here.
Software and ToolsOur team has chosen to use Eclipse IDE-based ModusToolbox™ for the development of the code in our Bluetooth air quality plug. You can easily download or clone the code from this link. To get started, simply follow the step-by-step instructions in the ModusToolbox™ (MTB) user guide to import the project into the MTB. By doing so, you will be able to start working on the code right away and customize it to meet your specific needs.
Import the Project into ModusToolbox™:
Also, the prebuild binary file is available inside the binary folder, this hex can be programmed into the board using MiniProg4 & Cypress Programmer.
Bluetooth Configuration
In this Air Quality Plug, the sensor data is configured in the GATT Database with custom service. The configuration for the Bluetooth is set in the BT configurator (config/design.cybt). And it generates code with database details.
This file configures the GATT DB servers with two characteristics shown below.
- CO2 Sensor: 4bytes of Uint8 array; Read & Write; Holds the CO2 values
- Custom Service UUID: 00000C02-0000-1000-8000-00805F9B0131
- 3. Device Name: AirQ v1
These characteristics database can be read/written from client applications AIROC™ Bluetooth® Connect App.
The CO2 sensor gauge UI is only available in the custom version of AIROC™ Bluetooth® Connect App, which can be downloaded from here.
3D DesignThe enclosure is designed using Autodesk software and the complete setup is placed inside the 3D-printed enclosure. The design files can be downloaded from the attachments section.
Wiring DiagramThe wiring is done as shown in the picture below. It's recommended to use somewhat flexible wires for connection so that the step can be fixed into the enclosure without any trouble.
The device is powered by plugging into the USB ports. It takes a few seconds to initialize the sensors and after that, the LED starts indicating the air quality level.
- Red – Very Poor
- Orange – Poor
- Yellow – Fair
- Light Green – Good
- Green – Very Good
Our device is designed for Bluetooth connectivity, which means you can easily connect it to your smartphone using the AIROC™ Connect app. Once connected, you can access the CO2 UI screen on the app, which displays the current CO2 level in ppm with a gauge. The sensor data is read through the GATT server notification, and the timer interval can be adjusted in the firmware to fit your specific needs. Additionally, our device can also be connected to a gateway device, which allows you to easily publish the data into the cloud. With this feature, you can access your air quality data from nearly anywhere and breathe better.
Here is the customized version of the AIROC™ Bluetooth Connect App with a custom UI screen called Air Quality Checker, which shows the current CO2 level of the device connected over Bluetooth.
This is it, we hope this helps you breathe easy and enjoy a healthy, greeny lifestyle. Remember, monitoring air quality is important, but don't get too obsessed with it!
Also don't forget to check out the working demo here.
Checklist for publicationreathe better and Farewell!
Comments