A repository containing various Arduino sketches made by the Digital Ag Team to read different sensors for smart farming and transmit the data over LoRaWAN using Adafruit Feather M0 Microcontrollers.
Sensors Supported
- Decagon 5TM Soil Moisture Sensor
- Edaphic NDVI Normalized Difference Vegetation Index Sensor
- Meter Atmos 41 Automatic Weather Station
- Meter Teros 21 Soil Water Potential Sensor
- Adafruit Ultimate GPS Module
Notes:
- Sketches require the user to update the LoRa-otaa.h file with the relevant The Things Network otaa (over-the-air-activation) EUI keys.
- Both the Device EUI and the App EUI need to have the Least Significant Bit (LSB) first whilst the App Key has the Most Significant Bit (MSB) first. If these keys are being retrieved from The Things Network device page this can be switched with the buttons next to the field containing the relevant key.
Adafruit Feather M0:
- Requires pin 6 to be connected to io1 for continuous transmission beyond the first uplink. This applies for all sketches, and if not done your device may simply sit there and continue to activate instead of joining the network.
- The Adafruit Feather boards require you download the board information/configuration by first going to preferences and adding the below link to the Additional Board Manager URL's and separating additional URL's with a comma.
- After which you then go to Tools -> Boards -> Boards Manager and search for SAMD and install Arduino SAMD Boards (32-bits ARM Cortex M0+). This completes the IDE setup for the boards.
- To upload to the feather plug it in to the computer and double press the reset button, the LED should now flash indicating the board is in upload mode.
- Ensure you select the device in the Tools -> Port menu before selecting upload.
Libraries: These sketches use the following libraries (which are included in the libraries folder);
- RTC - Real Time Clock
- LMiC - Lora Mac in C (by Mathiaskoojman IBM) Configured to AS-923 for Australia
- Math
- SDI-12 - Arduino Serial Digital Interface
- Cayenne LPP (Low Powered Packet) for transmitting data to the Cayenne platform
- ArduinoJson - JSON library for Arduino and embedded C++
- Adafruit Unified Sensor
- Adafruit ADT7410 Temperature Sensor
- Adafruit ADXL343 Triple Axis Accelerometer
- Adafruit GPS - Adafruit GPS library for Adafruit Ultimate GPS