This project shows how to turn a BleuIO USB dongle into a tiny gateway that streams live air-quality data from a HibouAir sensor straight to Adafruit IO. The script listens for Bluetooth Low Energy (BLE) advertising packets, decodes CO2, temperature, and humidity, and posts fresh readings to your Adafruit IO feeds every few seconds. The result is a clean, shareable dashboard that updates in real time—perfect for demos, labs, offices, classrooms, and proofs of concept.
What is Adafruit IO—and why pair it with BleuIO?Adafruit IO is a cloud platform for makers and developers that lets you collect, visualize, and route device data using a simple REST API or MQTT. You don’t need any Adafruit hardware; if you can make an HTTPS request, you can send data. BleuIO fits in beautifully here: the dongle handles the BLE side—scanning and parsing sensor frames—while a short Python script formats those values and pushes them to Adafruit IO. In practice that means you can take any BLE-advertising sensor, translate its packets into numbers, and land them on an IoT-friendly dashboard without servers or containers.
RequirementsTo complete this project, you will need:
- BleuIO BLE USB Dongle– acts as the BLE central device to capture advertising packets.
- HibouAir Air quality monitor– broadcasts environmental data such as CO2, temperature, and humidity.
- Python libraries – install them with:
pip install pyserial requests
- Adafruit IO account – free to sign up at io.adafruit.com.
- Adafruit IO Key – available under your account’s “My Key” page for authentication.
When you start the script, it opens the BleuIO serial port and switches the dongle into central role the very first time the program runs. From then on it repeatedly performs a short BLE scan that filters for HibouAir advertising frames. The scanner always picks the latest matching packet and decodes the fields we care about: CO2 (ppm), temperature (°C), and humidity (%rH). The script then posts each value to its own Adafruit IO feed over HTTPS. Because Adafruit IO is designed for live IoT data, your dashboard widgets update as soon as new points arrive. The loop cadence is configurable (10 seconds by default), which keeps you comfortably under Adafruit IO’s free-tier request limits.
The code (key points)The script is intentionally small and readable. It opens the serial device (for example /dev/cu.usbmodemXXXX
on macOS or COM7
on Windows), sends the BleuIO commands to scan for a few seconds, and parses the returned “Device Data [ADV]” lines.
A compact decoder extracts CO2, temperature, and humidity from the HibouAir manufacturer data, including the byte order and scaling.
To make the setup painless, credentials are read from variables (AIO_USER
, AIO_KEY
) and feed names default to co2
, temperature
, and humidity
. Each value is sent to the REST endpoint /api/v2/{username}/feeds/{feed_key}/data
with a simple JSON body {"value": <number>}
.
The script includes gentle sanity checks (for example, temperature range and humidity bounds) to ignore any malformed frames, and it prints a concise log line each time it pushes fresh data.
Here is the GitHub linkwith the full source so you can clone and run it as-is or adapt it to other sensors.
How to run the codeBefore running, set your serial port and Adafruit IO credentials.
On macOS you can list ports with ls /dev/cu.usbmodem*
;
on Windows use Device Manager to find the COM number. Update username and AIO key information, then run the script.The program will put BleuIO into central mode on first launch and, every cycle, will scan, decode, and push CO2, temperature, and humidity to the three feeds.If you see an HTTP 401 error, double-check the AIO key; a 404 usually means a feed name typo. If the script can’t open the serial port, confirm the path and that no other program is holding it open.
Creating Adafruit IO feeds, key, and dashboardLog in to Adafruit IO and create three feeds named co2
, temperature
, and humidity
. Your AIO Key is available under your account’s “My Key” page; copy it and keep it private. With feeds in place, open the Dashboards section and create a new dashboard for this project (for example, “HibouAir Live”). Add a few blocks: a gauge or line chart for CO₂ (with a range that makes sense for your space), another gauge or slide for temperature, and a slide or line chart for humidity so you can see the trend over time. Each block points to its corresponding feed. As the script posts to those feeds, the blocks will animate and refresh automatically. You can reorder blocks, tweak colors and ranges, and share a read-only link if you want others to watch along.
Once everything is connected, the dashboard shows a live CO2 number in gauge an line chart, an updating temperature value, and a humidity box that advances with each new reading. The values move in near real time as the script cycles, and any spikes or changes in air quality appear immediately.
Real-time air-quality dashboards are useful in far more places than a lab bench. Facility manager can watch CO2 levels across meeting rooms to optimize ventilation; schools and libraries can surface temperature and humidity alongside occupancy schedules; small manufacturers can keep an eye on comfort and safety in production spaces; and hobbyists can monitor their home offices or studios. Because the pipeline is “BLE sensor → BleuIO → HTTPS → Adafruit IO, ” you can swap HibouAir for other BLE advertisers and reuse the same approach to visualize anything from soil moisture to ambient light.
This project highlights how quickly you can go from BLE broadcast to live cloud dashboard with BleuIO and Adafruit IO. There’s no server to maintain, no container to deploy—just a tiny USB dongle, an air quality monitoring device like HibouAir, a short Python script, and a few clicks on the Adafruit IO site. The result is a shareable, real-time view of your environment that’s easy to extend, brand, and automate.
Comments