Aquaponics Monitoring with Cacti

Setting up the Raspberry Pi

This is a very versatile kit, and it is really as easy as following the instructions, screwing the kit together (without the Tentacle Board), plug in a keyboard, mouse, and monitor, and turning it on.

It will boot into a nice GUI of Linux.

 

Linux raspberrypi 5.10.17-v7l+ #1421

I highly recommend that you DO NOT use wifi, this I just a personal preference, but when I am running monitoring software I want to be able to guarantee connectivity, so always use Ethernet.

Altas Scientific

Aquaponics is a balance of many inputs and internal structures. 

Monitoring helps to provide a good record of where you have been, how your system is responding to various conditions, and give early visual warning to potential issues.

We are using a Raspberry Pi from CanaKit, this Tentacle T3 add-on board from Atlas Scientific, and three probes.

You can stack three Tentacle Boards on top of each other for a total of nine probes.

You can see our graphs here.

At this point, you can either plug into your network with an ethernet cable or set up your wifi on the Raspberry Pi.

I highly recommend that you DO NOT use wifi, this I just a personal preference, but when I am running monitoring software I want to be able to guarantee connectivity, so always use ethernet.

You will need to learn how to use the Linux Terminal as well as a Breadboard.

PT-1000 Temperature Probe

Purchase Link

Live to Campus guest:guest

You can see the temperature cycling through the day. This pond is fully shaded and contains between one hundred to three hundred fish.

 

PT-1000 Temperature Probe

This probe comes with a nice long lead. It can be fully submerged in fresh water or salt water, up to the BNC connector indefinitely.

It will plug directly into the Tentacle Board. You will also need the EZO™ RTD Temperature Circuit that plugs into the Tentacle, which enables you to read the specific signal coming off this probe. Each probe needs a corresponding EZO Circuit.

Mini Lab Grade pH Probe

Purchase Link

The spikes were when the probe was actually out of the water, we had to order an extension cable to make sure the probe was fully submerged.

 

Mini Lab Grade pH Probe

This probe comes with a rather short cable that necessitated us buying one of these.

It will plug directly into the Tentacle Board. You will also need the EZO™ pH Circuit that plugs into the Tentacle, which enables you to read the specific signal coming off this probe. Each probe needs a corresponding EZO Circuit.

Mini Lab Grade Dissolved Oxygen Probe

Purchase Link

After the 1st we started to get more accurate readings.

 

Mini Lab Grade Dissolved Oxygen Probe

This probe comes with a rather short cable that necessitated us buying one of these.

Designed for small spaces, this small probe gives you the same quality readings found in our lab-grade Dissolved Oxygen just smaller.  Because smaller probes use fewer precious metals, we can get the price lower. Keep in mind; smaller probes hold less electrolyte. Because of this, they need to be refilled more frequently than full-size or industrial probes. Each probe needs a corresponding EZO Circuit.

Using Probes.

Calibrating Probes.

  • Out of the box, the probes do need calibration.
  • If you put an extension cable on the probes they will need calibration.
  • Over time the probes need to be re-calibrated.

Temperature.

Boil a jug of water to 100c.
Calibrate the probe to this temperature.

You can buy one-time solutions to re-calibrate the pH and DO probes.

pH.

We have re-calibrated the pH probe by using normal tap water, getting a reading using pH test solution, and seeing a pH of 7.  This gave us the mid-bound reading. We then used the test solution and got a reading from a tank that was a pH of 4. This gave us a low-bound reading.

Dissolved Oxygen.

Taking the probe out of the water, with or without an extension cable. You can interrogate the probe and when the numbers settle down to a constant, then you can generally know you are getting a reading of 8 ppm, and calibrate the probe to this setting.

 

Raspberry-Pi-sample-code

This is the current PDF for the python code from Atlas Scientific.

The command of interest is:

git clone https://github.com/AtlasScientific/Raspberry-Pi-sample-code.git

This downloads the python code that we will be using to test the probes, calibrate them, and even change this code so we can use it with Cacti.

Once you have the code downloaded you can list the dir and see:

pi@raspberrypi:~/scripts/Raspberry-Pi-sample-code $ ls
AtlasI2C.py  AtlasI2C.pyc  ftdi.py  i2c.py  
LICENSE  README.md  readOrp.py  uart.py

When you run the main python program, you will see:

pi@raspberrypi:~/scripts/Raspberry-Pi-sample-code $ python i2c.py
>> Atlas Scientific I2C sample code
>> Any commands entered are passed to the default target device via I2C except:
  - Help
      brings up this menu
  - List 
      lists the available I2C circuits.
      the --> indicates the target device that will receive individual commands
  - xxx:[command]
      sends the command to the device at I2C address xxx 
      and sets future communications to that address
      Ex: "102:status" will send the command status to address 102
  - all:[command]
      sends the command to all devices
  - Poll[,x.xx]
      command continuously polls all devices
      the optional argument [,x.xx] lets you set a polling time
      where x.xx is greater than the minimum 1.50 second timeout.
      by default it will poll every 1.50 seconds
>> Pressing ctrl-c will stop the polling
    
--> DO 97
 - pH 99
 - RTD 102
>> Enter command:

 You can see that we have three probes.

 

Temprature Calibration

  • As an example, let’s say you have a pot of boiling water.
  • You want to recalibrate the Temperature probe.
  • You know the water is at 100 degrees celsius.

The command to enter, in our case is:

>> Enter command: 102:cal,100

And we will get back:

Success RTD 102: 
>> Enter command: 

And now we could run a new calibration.

pH Calibration

  • We have a low reading of water at a pH of 4.
  • We have a mid-reading of water at a pH of 7.

Clean off the probe.
Place in the mid-point solution.
Wait for the readings to stabilize.
The command to enter, in our case is:

>> Enter command: 99:cal,mid,7

And we will get back:

Success pH 99: 
>> Enter command: 

Clean off the probe.
Place in the low point solution.
Wait for the readings to stabilize.
The command to enter, in our case is:

>> Enter command: 99:cal,low,4

And we will get back:

Success pH 99: 
>> Enter command: 

The calibrations must be done mid, low, and high if you have a high.

Cacti Installed on a Raspberry Pi

Cacti

Cacti is a very programmable PHP-based Open Source monitoring system.

I have been using Cacti in a number of projects for over fifteen years.

It will receive inputs from standard protocols like SNMP, Simple Network Management Protocol, to home-brewed scripts in Bash, Perl, or Python, to importing customer plugins for Cisco, Tarango, and other manufacturers.

Using the python code provided by Atlas Scientific, we reworked their python code to integrate with Cacti.

 

Preperations

If you have just installed your Raspberry Pi there are a few things we need to make sure are installed.

Update to latest.

sudo apt-get update
sudo apt-get upgrade

This is for information and may change from when I installed and you do.

sudo apt-get install php7.3 mariadb-server-10.3
  mariadb-client-10.3 php7.3-mysql php7.3-snmp 
  php7.3-gd php7.3-ldap rrdtool snmp snmpd -y

https://community.spiceworks.com/how_to/105702-raspberrypi-how-to-install-cacti

Help

Working with Linux and Cacti is a moving target.

If you are doing a new installation, please contact me if you would like some help and so I can update this documentation to reflect the process, now, at the end of 2021.

What Next

.

Cacti Setup

Working with Linux and Cacti is a moving target.

If you are doing a new installation, please contact me if you would like some help and so I can update this documentation to reflect the process, now, at the end of 2021.

What Next

.