Environmental monitoring is ubiquitous, and IoT has made it easier than ever to collect and action on hyper-localized information about the conditions in a particular location. Whether on a farm, on top of a building in the city, or just in your backyard, monitoring a broad range of environmental parameters can offer valuable insights through historical trends, enable data-driven decisions such as the best time to water crops or plants.
This project showcases an remote environmental monitoring station built with the Monitor One Developer Edition from Particle. The platform offers straightforward integration with off-the-shelf Modbus sensors, and, coupled with the I/O card included in the Developer Edition, the functionality was facilitated through the addition of just around 500 lines of code to the provided Monitor Edge firmware framework.
The station publishes regular reports of solar output, battery state of charge, multiple environmental parameters, and CO2 to a Datacake dashboard. The simplicity of the Datacake platform made it quick to set up real-time and historical data visualizations, and offered an easy way to create a user-friendly interface for interaction with the data the station collects.
Note that the firmware for this project is still under development and will be released alongside Monitor Edge V1.
Linovision Weather Sensor KitFor environmental sensing, an 8-in-1 weather station from Linovision was selected.
The station communicates over Modbus and includes a number of basic sensors — temperature, humidity, wind speed and direction, and more — in a convenient pole-mount environmentally protected enclosure.
A simple library was written to support the sensor which is included in the project repository.
CO2 SensorIn addition to the 8-in-1 station, a CO2 sensor from Linovision was included on the station.
Similar to the 8-in-1 weather station, this sensor also communicates over Mobdus and a library is included in the project repository.
Solar Charger & LiFePO4 Backup BatteryWhile the Monitor One has a large lithium battery inside, the Developer Edition I/O card only supports power input. While a circuit could have been added to add power output for the onboard sensors, a simpler solution was to add a dedicated solar charger and backup battery.
For this, the Rover Elite 20A MPPT Solar Charge Controller was chosen
The charge controller is connected to a 20W solar panel and an 8Ah LiFePO4 battery. To power the sensors, a 12V to 24V boost converter is used, connected directly to the battery.
The Rover Elite also has a RS485 Modbus interface available, and using an existing Python library as an example, a library was written to communicate with the charger and read its status. As with the other sensors, code to read from the charge controller is included in the project repository.
The controller uses an RJ45 jack for its Modbus interface, and the pinout can be found in the documentation for the library above. For this connection, a 3 conductor cable with a passthrough RJ45 jack crimped on the end was used.
Wiring DiagramAssembly was kept simple as this is intended to be an example project. All sensors and the Monitor One are powered via 24V coming from the boost converter, and Modbus is connected to the two sensors and charge controller.
Everything is wired up using DIN rail terminal blocks, including ferrules on all wire ends. The enclosure is outdoor-rated, and uses cord grips for all wire entry points.
The code for this project is built on top of Monitor Edge, a reference application for the Monitor One. Monitor Edge comes with a built in Modbus library, which makes it easy to write interface code for each of the sensors and the solar charger. There are three included libraries to communicate with these devices:
- RenogyModbus
- LinovisionWeatherStation
- LinovisionCO2
Each of these libraries includes a "toJson()" function that takes the most recent data from the station and packages it up for publishing. In the main file, a couple loops run to periodically sample the sensors and publish the resulting data. Additionally, there is a Particle function that enables reading data immediately from the device if needed.
And that's it! We're able to read from all of the connected devices and periodically publish it to the cloud.
A couple of notes about the firmware:
- The location publish callback method built into Monitor Edge could have been used to send up all the sensor data along with GNSS information, however since this unit is not mobile, this wasn't necessary. Therefore a separate publish with just the sensor information was set up, and GNSS information is published separately through the built-in method
- The weather station is sampled more frequently as it may be desired to add in statistical analysis for certain measurements, like averages and standard deviation for wind speed. This was beyond the initial scope of this project, but may be implemented in the future.
- The Modbus library in Monitor Edge is still under development and the implementation used in the included libraries will change in the future.
- Monitor Edge is still under development so expect the code here to change as features get released.
A public dashboard is available here!
Comments