LoRaWAN Tank Level Sensor Node

Updated 09 December 2020

My brother-in-law has a dairy farm in Victoria and many hours per week are wasted traversing the farm to check water tank levels, opening/closing valves, and other small tasks that could easily be remotely monitored and controlled.

It was an opportunity to learn about LoraWAN networks and build a functioning sensor node which could eventually be duplicated and rolled out across the farm.

The prototype setup was intended to remotely monitor the water level in a tank and be able to control a remote device such as a valve, or raise an alert if a set criteria was met.  A waterproof ultrasonic sensor with a remote probe was selected and also a temperature and humidity sensor.

HARDWARE USED:

ASSEMBLING THE PROTOTYPE:

The parts were initially attached together using a breadboard to confirm all components were functioning correctly.

The uFL SMT Antenna Connector was required to be soldered onto the Adafruit Feather M0 so the higher gain LORA antenna could be used to increase the transmission range.

The solar panel and battery are connected to the solar charging board. The battery output from the solar charging board is then connected to the battery input on the Adafruit Feather (the battery charging feature on the Feather board is not being used).

The DHT22 and Ultrasonic Sensor are then connected to both power and data pins on the Feather.

lorawan-top-down-prototype

SETTING UP THE MICROCONTROLLER:

The following guide helped me achieve success with this project. If you are setting out to build something similar with the Adafruit Feather M0 RFM95 LoRa Radio, I would highly recommend reviewing or following this Adafruit learning guide. 

Using LoraWAN and The Things Network with Feather

The guide provides instruction regarding registering the device with The Things Network and setting up the Arduino software with the correct libraries. The sample code from the guide was modified in a few ways to suit my needs.

  • Modified the region setup to suit Australia
  • Added code to read distance data from the Ultrasonic Sensor
  • Added code to send data to The Things Network in the Cayenne LPP format
  • Added code to receive downlink data from The Things Network to remotely control the onboard LED brightness 

A copy of my modified code is available on GitHub here https://github.com/greencardigan/ttn-featherm0-dht

FROM BREADBOARD TO HOUSING:

The electronics were transferred directly to the waterproof housing without any modifications other than more permanent connections between the boards and some cable extensions. 

The housing used was sourced from the scrap bin and is IP65 rated and includes a hinged waterproof opening which allows easy access to the internals for updating code etc. The housing was attached to some scrap PVC tubing which also supports the DHT22 sensor and the protecting Stevenson Screen. The Stevenson Screen was 3D printed in ABS using a design from Thingiverse. The solar panel is attached to the PVC tubing with parts from a retired phone holder.

lorawan-tank-sensor-rear-final-project

lorawan-tank-sensor-front-final-project

IN USE:

The system has been running continuously on batteries for the last 4 months with no issues. When transmitting every 5 minutes, the battery lasts approximately four days indoors without sunlight and fully charges using the solar panel in a few hours in direct sunlight.

The LoRa transmission range is great with a number of LoRaWAN gateways in the 5 to 7 km range being reached reliably.

The sensor data can be monitored and logged using the free Cayenne platform which includes a web and mobile dashboards. The Cayenne system is a bit clunky and has limited features but is good for the price.

Triggers can be set in the Cayenne Dashboard to trigger actions once certain conditions are met. I currently have an ESP8266 running Cayenne IoT code which is being triggered to perform an action whenever the LoRaWAN sensor node records a temperature exceeding my set threshold.

lorawan-tank-sensor-in-app-readout-1

lorawan-tank-sensor-in-app-readout-2

LINKS:

The following guides and websites helped me get through this project. Check them out:

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.