In this project, we’ll show how to build a real-time air quality monitoring system using the BleuIO USB dongle and Ubidots. The setup listens for Bluetooth Low Energy (BLE) advertising packets from a HibouAir sensor, decodes the CO2, temperature, and humidity data, and sends them directly to Ubidots, where you can visualize and analyze the readings on a live dashboard.
The result is a seamless pipeline from BLE sensor to Ubidots’ cloud platform. This makes it easy to track air quality in real time and share the results with colleagues, clients, or your own IoT applications.
What is Ubidots?Ubidots is a powerful industrial IoT platform designed to help developers, researchers, and businesses transform raw sensor readings into meaningful insights. More than just a place to store data, Ubidots provides tools to build custom dashboards, alerts, and reports that can be shared across teams or even embedded into products. It is widely used in industries such as smart cities, agriculture, energy, logistics, and healthcare, where real-time monitoring and automation are critical.
By integrating BleuIOwith Ubidots, you gain the ability to collect real-time BLE sensor data without the need for complex gateways. The values captured from your sensors can be pushed directly to Ubidots variables through simple HTTPS POST requests, making the process both fast and reliable. Once the data is in Ubidots, you can take advantage of its powerful dashboard features to create professional visualizations with gauges, charts, and triggers, giving you an intuitive way to monitor and analyze your environment.
In short, BleuIO acts as the BLE gateway, and Ubidots becomes the visualization and analytics layer.
RequirementsTo complete this project, you’ll need:
- BleuIO USB Dongle– to capture BLE advertising packets.
- HibouAir Sensor– broadcasts CO2, temperature, and humidity.
- Python libraries:
pip install pyserial requests
- Ubidots account (a free version is available).
- Ubidots API Token – used to authenticate when posting data to your account.
We’ve written a Python script that automates the whole process from BLE scan to Ubidots push. You can find the full code on GitHub:GitHub Link for Script
Here’s how the script works step by step:
- Connects to the BleuIO dongle over the serial port you specify (e.g.,
/dev/cu.usbmodemXXXX
on macOS orCOMX
on Windows). - Switches the dongle into central mode with the
AT+CENTRAL
command (done only once). - Scans for HibouAir packets using
AT+FINDSCANDATA=220069=3
, which looks for advertising data that matches HibouAir’s manufacturer ID. - Selects the last valid packet that contains the expected pattern (
5B070504
). This ensures we work with the freshest data.
Decodes the advertising data into usable values:
- CO in parts per million (ppm).
- Temperature in Celsius (°C).
- Humidity in relative percent (%RH).The script also applies sanity checks to ignore invalid readings.
- Decodes the advertising data into usable values:CO in parts per million (ppm).Temperature in Celsius (°C).Humidity in relative percent (%RH).The script also applies sanity checks to ignore invalid readings.
- Pushes the values to Ubidots via HTTPS POST requests. The request format looks like this:
{ "co2": { "value": 415 }, "temperature": { "value": 23.4 }, "humidity": { "value": 52.1 } }
Each key (co2, temperature, humidity) becomes a variable in Ubidots. - The script repeats this process every 10 seconds, so your dashboard stays updated in real time.
This approach keeps everything lightweight and avoids any need for complex backend servers or brokers.
OutputOnce the script is running, your Ubidots device (e.g., bleuio-hibouair
) will automatically appear in the Devices section. It will have variables for CO2, temperature, and humidity.
This project can be applied in many real-world scenarios where air quality and environmental monitoring are essential. For example, it can be used for indoor air quality monitoringin offices, classrooms, or laboratories to ensure a healthy environment for occupants. In smart building management, the integration of CO₂ and temperature readings into HVAC systems can help optimize ventilation and energy use. The approach also fits perfectly into cold chain logistics, where continuous temperature and humidity tracking is critical for maintaining the safety and quality of sensitive shipments. In the field of environmental research, this setup provides a quick and reliable way to capture and visualize field data without the need for heavy infrastructure. Finally, it is also ideal for IoT prototyping, as Ubidots makes it easy to build dashboards and visualize sensor data quickly without writing or maintaining a backend system.
With just a BleuIO dongle, a BLE sensor, and a few lines of Python, you can build a real-time IoT dashboard in Ubidots. This project demonstrates how easy it is to collect, decode, and visualize BLE data without needing extra hardware or complicated setups.
Comments