Context

We are implementing a network of wireless low-power air quality sensors to deploy in the city of Magurele, Romania. This will give citizens and authorities live feedback of our collective behaviour's impact on the air we breathe. Live and historic data will be available through a publicly available web interface. Related projects:

This project covers the AeRate box, the actual devices that will be strapped to trees and lamp-posts, and bolted to buildings to sample the air and send data to the server.

Requirements

  • be weather-proof
  • gather relevant environmental data
  • transmit data periodically to the server
  • be battery powered and low power enough to make maintenance manageable

While the current design uses a rechargable lead-acid battery, no battery charging (e.g. solar cell) circuit is implemented so far. This is an improvement that is on our roadmap.

Sensors

The sensors used are a SDS011 dust sensor and a BME280 temperature, humidity, and pressure sensor. The SDS011 transmits data over UART, whereas the BME280 uses I2C. This combination of sensors has been selected based on its use in this wide-spread project, for us to be able to provide compatible data down the line.

Communication

LoRaWAN communication is handled by the Microchip RN2483 modem as it is fairly easy to use and simplifies development substantially. It uses a UART interface to interface to the application MCU.

Application MCU

A Trinket M0 runs the show thanks to its decent low power capabilities, large program space, I/O, and minimalistic design. Our application needs one full UART for the RN2483, one I2C port for the BME280, just the RX half of a UART for the SDS011, one ADC pin for measuring the battery voltage, and one GPIO for cutting power to unused sections of the circuit. While the MCU has ample connectivity for all of these, not all pins are routed on the Trinket M0. We thus had to also use the exposed SWDIO and SWCLK pads on the bottom of the board.

The Arduino platform simplifies firmware development substantially, offering libraries for most modules.

Power

The AeRate box is powered by a 6V 4Ah lead-acid battery. As there is currently no charging mechanism for this battery, power consumption needs to be kept as low as possible in order to minimize maintenance requirements. The MCU, RN2483, and BME280 can easily be commanded to go into low power modes. To further reduce power draw there is a high-side switch that cuts power completely to the SDS011 and to a resistive divider that is used to measure battery voltage.

The LDO on the Trinket M0 has an upper limit of 6V which makes it unsuitable to be used with a 6V lead-acid battery whose voltage is normally above 6V. It has been substituted for a pin-compatible LDO with a higher maximum input voltage, the XC6209F332MR-G.

There are not many components on the Trinket M0, but to minimize power consumption we have to yank things out. A stock Trinket M0 will consume ~13 mA (active) and ~1.1 mA (sleep). After changing the LDO, removing the power LED resistor and removing the DotStar, the power draw is ~12 mA (active) and ~0.003 mA (sleep).

AeRate box architecture

The Trinket M0 is always powered, straight from the battery. Its upgraded on-board 3.3V LDO also powers the RN2483 and BME280. A high-side switch controlled by pin D19 can switch off power to the SDS011 and to a resistive divider for measuring battery voltage.

Schematic and PCB

Available on EasyEDA.

Firmware

Available on GitHub.

Assembly

A prototype PCB was made on a CNC and assembled in a weather-proof box.

Testing data collection

Sensor was left outside in Magurele for a few days to evaluate performance. To also check power draw, it was configured to peform measurement & transmission every 5 minutes. Also we used a set of lower-capacity batteries.

Ongoing work

We are working on updating the PCB...

Read more »