This project, codenamed ‘Aria’, started out as remote telemetry system for monitoring water tank levels using 3G radios and ultrasonic sonars but software suite would eventually evolve into the AgConnect project. Setting up these systems involved starting a partnership with an M2M provider for sim card management, deciding on the most effective way of measuring tank levels, and selecting a controller to be the heart of the unit.
- Electronic Systems
- Mechanical Design
- Renewable Power System
- Cellular Radio Comms
- Puppet Software Management
- Linux Scripting
- M2M Management
- Project Management
Pressure sensors are the standard option for measuring tank levels but on a remote cattle station, the water qualities don’t always play well with these types of sensors. By using MaxBotix ultrasonic rangefinders mounted to the top of the tank, the sensors never touch the water and will therefore last a whole lot longer. The sensors offer a variety of outputs including pulse and analog voltage but I selected TTL serial as it was the most cost effective option with the RaspberryPi. The rangefinder reports the distance to the water surface in millimetres through a serial socket, which is easily read using PHP at scheduled intervals.
The main idea behind the project was that no component would be custom, that way if anything were to fail, you could simply purchase another and it would slot right in. Obviously this is not the most economical way of building a product but when these systems are setup hundreds of kilometres away from the nearest electronics store, ease of service was a key requirement. Using a RaspberryPi was more about future product availability more than anything, though the wonderful community knowledge and support were important factors. Their use of a common ARM architecture meant that the linux-based software package could run on similar boards if a substitute were needed. The initial controllers used Puppet for software package management and remote updates.
With the unit being solar powered, power management was central in the selecting electronics and their integration into the system. By using a USB serial board, I was able to switch the 3G radio and Sonar off when they weren’t being used, saving battery power and extending component life. The initial run of units were not controlling pumps or valves so a timer would switch the system completely off after dark, as there is no point sending notifications if everyone is sleeping.
Netcomm radios were selected due to their low entry cost and impressive feature set. The Linux OS would use the radio like a normal data modem to send the sensor readings at scheduled intervals to the AgConnect servers. The radios have a wide input voltage range which allowed them to be powered straight from the battery.
I built AgConnect as a responsive layout web app that could run inside a native iOS app, providing push notification support. This allowed the app to run with 99% functionally on almost any device that had an internet connection. The ‘load-once’ app was built on top of KnockoutJS and would make asynchronous API calls to the PHP-powered backend running a PostgreSQL database. Updates could be applied in the background without requiring the user to do anything. Initial versions of the software displayed the last two tank level readings as well as a three day trend graph.
Hindsight is a wonderful thing and after completing the project as well as building AgConnect, there are a number of things I would do differently for these units. Simplify everything, this would mean making custom components but it would allow for more efficient use of electronics, cabinet space and power requirements. The units perform really simple tasks so a small PCB with an Atmel ATmega processor would be more than enough to accomplish everything required. One cheap (~$50) PCB could replace the 5v power supply, timer, TTL to RS232 converter and relay board. Taking advantage of the TCP socket features of the Netcomm radio, you could have a constant connection to the unit for requesting sensor data at any time.