The hat, dubbed Enviro+, comes from Pimoroni, which is pitching the add-on as a cheap alternative to expensive environmental monitoring stations.
With an additional particulate matter sensor, the Pi-based air-monitoring device can be placed just outside a house. Without the additional sensor, it can be used to monitor indoor air characteristics.
The Enviro+ itself costs £45 ($57), while the Plantower PMS5003 particulate matter sensor with a cable costs an extra £25 ($32). Pimoroni's recommended setup includes a Raspberry Pi Zero, a 16GB microSD card, and a Raspberry Pi Universal Power Supply unit.
The base Enviro+ includes a single sensor for measuring temperature, air pressure, and humidity. A separate sensor measures light and proximity, and another analog sensor measures gas.
Assuming Pimoroni and Plantower devices accurately capture air-quality data, they could allow many users to contribute to a body of data that helps researchers better understand the environment in residential areas across the world.
As Pimoroni points out, the types of particulate matter the PMS5003 promises to measure include dust, pollen, mould spores, smoke particles, organic particles, and metal ions.
Meanwhile, the gas sensor can measure changes in gas concentrations allowing users to ¨tell broadly if the three groups of gases are increasing or decreasing in abundance".
However, it can't measure the concentration of carbon monoxide in parts per million.
The EU, in its 2017 assessment of low-cost air-pollution sensors, wasn't confident in the accuracy of cheaper equipment.
"Measurements by low-cost sensors are often of minor and questionable data quality [compared with] the results from official monitoring stations as carried out by EU member states in accordance with European legislation and International standards," the EU wrote in its report on the emerging technology.