If you're new to EnviroDIY, I suggest you check out the Just Getting Started section of the documentation!
This repo "ModularSensors" gives environmental sensors a common interface of functions for use with Arduino-compatible dataloggers, such as the EnviroDIY Mayfly. The ModularSensors library is specifically designed to support wireless, solar-powered environmental data logging applications, that is, to:
- Retrieve data from many physical sensors;
- Save that data to a SD memory card;
- Transmit that data wirelessly to a web server; and
- Put the processor, sensors and all other peripherals to sleep between readings to conserve power.
- Based in the riparian corridor
- Supports 12V/Modbus interface through Wingboard
- powers sensors when used, and powers the board down to a quiescent of about 3mA between useage.
-
Reliable delivery of the sensor readings to the cloud. If it doesn't work the first time, it retrys later.
-
Adds geographically scaling for multiple loggers using the same program/binarys. It does this with a custom ms_cfg.ini configuration file on the SD memory card
-
If the battery power drops below a threshold, it stops transmitting data to the web and conserves power by only polling the instruments. When the battery is charged it then delivers all the readings to the web.
-
Manages the type of battery power, with best management practices for power demand management. One option is the LiIon rechargeable battery + solar panel. Another option is standalone, no solar panel capability. Confgiruable in the ms_cfg.ini
-
Adds electronic configuration information to the Mayfly board, so that the readings can be traced to specific mayfly at a specific geographical loction.
-
Adds battery power monitoring through a coloumb counter. -
Tested for ruggedness/reliability with the Xbee LTE & WiFi S6 modules.
-
prebuilt hex files at https://github.com/neilh10/ms_releases .
-
ONLY applies to ModularSensors\examples\tu_xx01 (Mayfly)
-
Specific development stream in ModularSensors\a.. directories (Mayfly and other ARM SAMDx boards)
To use, from the IDE Platformio (platformio.org) open folder ModularSensors\a<select a folder> - and press icon "Build" (the tick mark), then download to the target.
(More detail at https://envirodiy.github.io/LearnEnviroDIY/04-GetPlatformIO/index.html)
tbd - download a prebuilt image
This is an open source fork of https://github.com/EnviroDIY/ModularSensors
EnviroDIY/ModularSensors is a comprehensive package that covers a number of boards and example usages. Its the recommended starting point for anybody new to ModularSensors, its assumed you read the excellent https://github.com/EnviroDIY/ModularSensors/blob/master/README.md
There is an comprehensive manual on riparian monitoring using the Mayfly https://www.envirodiy.org/mayfly-sensor-station-manual/
This fork focuses on a rugged reliable scalable use of ModularSensors using the Mayfly 0.5b based on the mature AVR Mega1284 processor with 16Kb ram. Embedded processor functionality is largely dictated by size of the ram and flash memory. Boards for riparian monitoring need solar & LiIon battery, wireless modules such as what the Mafly 0.5b + 12V Wingboard offer. Other more extensible boards based on the Arm Cortex M family will probably be supported over time - eg Adafruit Feather Alogger
To use this fork, and underestand the New features, its best to have code famalirity with ModularSensor.
I hope to make this simpler in the future.
The standard educational route is use a Mayfly 0.5b, open the following - and change the .ino file to a src directory and then build
EnviroDIY/ModularSensors/examples/menu_a_la_carte
Verify builds and dowload to your Mayfly.
To build from this fork, in platformio opend the folder ModularSensors/a// Note the changes in platformio.ini
and other changes. You will need to know how platformio.ini works.https://github.com/neilh10/ModularSensors#release1 ; ^^ Use this when working from this fork
Finally build, and download it to the chosen target. It now requires the SD card to have a ms_cfg.ini https://github.com/neilh10/ModularSensors/wiki/Feature-INI-file
This library is a volunteer open source effort by the author, and is built on the effort of a number of people who open sourced their effor with ModularSensors - thankyou thankyou. As an open source addition to ModularSensors you are free to use at your own discretion, and at your own risk. I've provided some description of what tests I've run at https://github.com/neilh10/ModularSensors/wiki/Testing-overview
For understanding ModularSensors, the best place to start is to visit enviroDIY.org. For bugs or issues with THIS fork, please open an issue. For changes made on this fork the best place to start is with a source differencing tool like http://meldmerge.org/
Open an issue to suggest and discuss potential changes/additions for the whole library.
For this fork open an issue to suggest and discuss potential changes/additions for this fork.
The ModularSensors library coordinates these tasks by "wrapping" native sensor libraries into a common interface of functions and returns. These wrapper functions serve to harmonize and simplify the process of iterating through and logging data from a diverse set of sensors and variables. Using the common sensor and variable interface, the library attempts to optimize measurement timing as much as possible to reduce logger "on-time" and power consumption.
Although this library was written primarily for the EnviroDIY Mayfly data logger board, it is also designed to be compatible with a variety of other Arduino-based boards as well.
There is extensive documentation available in the ModularSensors github pages including details of the class structures and example code.
For some generalized information about attaching sensors to an Arduino style board, see the Sensor Notes page.
- Processor Metrics: battery voltage, free RAM, sample count
- Maxim DS3231: real time clock
- Analog Electrical Conductivity: conductivity
- AOSong AM2315: humidity & temperature
- AOSong DHT: humidity & temperature
- Apogee SQ-212: quantum light sensor, via TI ADS1115
- Atlas Scientific EZO Sensors
- Bosch BME280: barometric pressure, humidity & temperature
- Bosch BMP388 and BMP390: barometric pressure & temperature
- Campbell Scientific OBS-3+: turbidity, via TI ADS1115
- Campbell Scientific ClariVUE10: turbidity
- Campbell Scientific RainVUE10: precipitation
- Decagon Devices ES-2: conductivity
- Decagon Devices CTD-10: conductivity, temperature & depth
- Everlight ALS-PT19 Analog Light Sensor (via processor ADC)
- Freescale Semiconductor MPL115A2: barometric pressure and temperature
- External Arduino I2C Rain Tipping Bucket Counter: rainfall totals
- In-Situ RDO PRO-X: dissolved oxygen
- In-Situ SDI-12 TROLLs: pressure, temperature, and depth
- Keller Submersible Level Transmitters: pressure and temperature
- MaxBotix MaxSonar: water level
- Maxim DS18: temperature
- Measurement Specialties MS5803: pressure and temperature
- Meter Environmental Soil Moisture Probes: soil Ea and volumetric water content
- Meter Environmental Hydros 21: conductivity, temperature & depth
- Northern Widget Tally Event Counter: number of events
- PaleoTerra Redox Sensor: redox potential
- Sensirion SHT40: humidity & temperature
- TI ADS1115: external voltage with support for divided current
- TI INA219: current, voltage, and power draw
- Turner Cyclops-7F: various parameters
- Yosemitech: water quality sensors
- Y502-A or Y504-A: Optical DO and Temperature
- Y510-B: Optical Turbidity and Temperature
- Y511-A: Optical Turbidity and Temperature
- Y514-A: Optical Chlorophyll and Temperature
- Y520-A: Conductivity and Temperature
- Y532-A: Digital pH and Temperature
- Y533: ORP, and Temperature
- Y551: UV254/COD, Turbidity, and Temperature
- Y560: Ammonium, Temperature, and pH
- Y700: Pressure and Temperature
- Y4000 Multiparameter Sonde
- Zebra-Tech D-Opto: dissolved oxygen
Within ModularSensors, the "dataPublisher" objects add the functionality to send data to remote web services. The currently supported services are the Monitor My Watershed data portal, ThingSpeak, and the Ubidots IoT platform.
For information common to all modems and for tables of the proper class, baud rate, and pins to uses, see the Modem Notes page.
- Digi XBee
- Digi XBee® 3 Cellular LTE-M/NB-IoT
- Digi XBee® 3 Cellular LTE Cat 1 (AT&T or Verizon)
- Digi XBee® Cellular 3G
- Digi XBee® Cellular LTE Cat 1 (Verizon)
- Digi XBee® Wi-Fi (S6B)
- ESP8266
- QuectelBG96
- Sequans Monarch
- SIM7080
- SIM7000
- SIM800, including the Sodaq GPRSBee
- u-blox LTE-M R4 and N4 series, including the Sodaq uBee
- u-blox 2G, 3G, and 4G, including the Sodaq 3GBee
Open an issue to suggest and discuss potential changes/additions. Feel free to open issues about any bugs you find or any sensors you would like to have added.
If you would like to directly help with the coding development of the library, there are some tips here on how to set up PlatformIO so you can fork the library and test programs while in the library repo. Please take time to familiarize yourself with the terminology, classes and data structures this library uses. This library is built to fully take advantage of Objecting Oriented Programing (OOP) approaches and is larger and more complicated than many Arduino libraries. There is extensive documentation on our github pages and an enormous number of comments and debugging printouts in the code itself to help you get going.
For power contributors,fork-it, modify and generate Pull Requests. https://github.com/neilh10/ModularSensors/wiki/git-cmds-for-preparing-for-a-PR
Software sketches and code are released under the BSD 3-Clause License -- See LICENSE.md file for details.
Documentation is licensed as Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) copyright.
Hardware designs shared are released, unless otherwise indicated, under the CERN Open Hardware License 1.2 (CERN_OHL).
EnviroDIY™ is presented by the Stroud Water Research Center, with contributions from a community of enthusiasts sharing do-it-yourself ideas for environmental science and monitoring.
Sara Damiano is the primary developer of the EnviroDIY ModularSensors library, with input from many other contributors.
This project has benefited from the support from the following funders:
- William Penn Foundation
- US Environmental Protection Agency (EPA)
- National Science Foundation, awards EAR-0724971, EAR-1331856, ACI-1339834
- Stroud Water Research Center endowment
Other Contributors
Beth Fisher for sharing/helping with her vision of ModularSensors.
Anthony Aufdenkampe for releasing the Modbus Interface/WingBoard, and making it possible to access a class of +12V Modbus Industrial Sensors.
Acknowledgements for this fork [Neil Hancock] is solely responsible for its content.