When it comes to gathering datasets over large spans of time, having hardware that maintains energy efficiency, connectivity, and the ability to stay in a known, working state is vital. This project explores how Particle's newly released Monitor One IoT platform can be harnessed to gather weather data from nearly anywhere- complete with GNSS and cellular connectivity.
The Monitor One is meant to act as a rugged, customizable IoT gateway that can record information, track assets, and interact with other devices. In addition to cellular connectivity and GNSS location services, the kit supports Bluetooth Low-Energy, has an ESP32 for Wi-Fi geolocation, contains two built-in sensors (IMU and temperature), a built-in rechargeable battery, and a plethora of serial bus options. Its nRF52840 SoC, similar to other Particle devices, allows for DeviceOS-based programs to be flashed over-the-air using the Particle Cloud. Lastly, the Monitor One has a set of pin headers which accept expansion boards that allow for other modules/hardware to be added and access the outer connectors.
After receiving a Monitor One Developer Edition kit, I connected the included 24V 2A power supply to the M12 8-pin cable and then threaded it into the appropriate port. With the device now powered on, I went to setup.particle.io and followed the on-screen directions to configure/activate it.
Heading to the associated product's map page gives the real-time location of the device as well as the ability to change fleet-wide settings. Because this is going to be flashed with custom firmware, I first had to mark it as a development device in the console so that the stock firmware does not overwrite the custom one. Having done that, the next step was to clone the latest Monitor Edge firmware from its GitHub repository which contains the Edge library and all other required libraries for working with the hardware. Once opened in VS Code and after configuring the project to use deviceOS 4.2.0
and the correct device, development of the custom firmware could start.
I decided to use the common Bosch BME680 environment click board from MikroE due to its ability to measure temperature, relative humidity, pressure, and volatile organic compound concentrations via a gas sensor- all over the I2C bus. I also included an Adafruit ADT7410 high-accuracy temperature sensor for future use if increased accuracy and resolution (0.0078°C!) are required.
To attach them to the Monitor One, I soldered headers to one of the provided Basic Prototype Expansion Cards and connected the 3.3V, GND, and I2C pins to each module. The Monitor One is able to differentiate between expansion card SKUs thanks to each one having an EEPROM chip with factory-set configuration data.
As with other radios, facilitating wireless communication, especially with a cell tower that might be kilometers away, uses a lot of power. The main technique to reduce this high consumption typically involves a sleep > wake > transmit > sleep cycle, and the Particle Console provides an easy way to control how this occurs through setting configuration values according to the device's schema. I set mine to publish the location at minimum every 300
seconds and at a maximum delay of 600
seconds between publishes. When combined with enabling sleep mode, the Monitor One will automatically go to sleep in between in order to preserve battery.
Particle Device OS programs are largely based on Arduino-style conventions/classes, meaning that they contain the typical setup
/loop
functions, Wire
for I2C communication, and Serial
for USB IO. In this case, setup
calls the init
method for the Edge instance
which starts all of the built-in subsystems and registers a location callback function. Once started, the BME680 is initialized and configured to oversample temperature, humidity, and pressure as well as set the gas sensor's filter.
The loop
function only has a single line to call the Edge instance
's loop
method. It is responsible for checking onboard modules, performing periodic tasks, and handling communication with the Particle Cloud. Based on the location settings, the location callback will be called automatically wherein it reads the latest data from the BME680 and places it into a JSON object named "weather"
. Then when the loc
event is set to the Particle Cloud, "weather"
is nested inside the "loc"
object.
Seeing the events appear in the Particle Console was great, but I also wanted a way to store historical data for future analysis.
To do this, I followed Particle's IFTTT integration instructions in order to make the Particle Cloud send a POST webhook on each loc
event publish and store the data in Google Sheets. After letting it run for a while, I had dozens of rows with time, location, and weather information.
The Monitor One is a great choice whenever a combination of connectivity, location tracking, and resiliency are required. Since its power management system supports charging from 6V all the way to 30V inputs, adding a solar panel would be a great way to provide indefinite battery life, and other integrations could be added in the future for improved data analysis. To get started with the Developer Edition kit, you can view its quickstart guide here on Particle's website.
Comments