Biofloc Monitoring System powered by Wio Terminal

Biofloc Monitoring System (Powered By: Wio Terminal)
Original Arthur: Md. Khairul Alam
https://www.hackster.io/taifur/biofloc-monitoring-system-powered-by-wio-terminal-b22b43

Hardware components

Wio Terminal x1
Grove ORP Sensor x1
Grove PH Sensor x1
Grove EC Sensor x1
Grove DHT11 Sensor x1

Story

In a world where more than 800 million people continue suffering from chronic malnourishment and where the global population is expected to grow by another 2 billion to reach 9.6 billion people by 2050, it is important to meet the huge challenge of feeding our planet while safeguarding its natural resources for future generations. In this context, aquaculture plays a key role in eliminating hunger, promoting health, reducing poverty, as well as generating jobs and economic opportunities. According to FAO, the world food fish aquaculture production expanded at an average annual rate of 6.2% in the period 2000–2012 from 32.4 million to 66.6 million tons, in which Africa grew 11.7%, Latin America and the Caribbean 10%, Asia (excluding China) 8.2, and China 5.5. Employment in the sector has grown faster than the world’s population. The sector provides jobs to tens of millions and supports the livelihoods of hundreds of millions. Fish continues to be one of the most traded food commodities worldwide. It is especially important for developing countries, sometimes worth half the total value of their traded commodities.

Biofloc technology (BFT) is considered the new “blue revolution” in aquaculture. Such technique is based on in situ microorganism production which plays three major roles: (i) maintenance of water quality, by the uptake of nitrogen compounds generating in situ microbial protein; (ii) nutrition, increasing culture feasibility by reducing feed conversion ratio (FCR) and a decrease of feed costs; and (iii) competition with pathogens. The aggregates (bioflocs) are a rich protein-lipid natural source of food available in situ 24 hours per day due to a complex interaction between organic matter, physical substrate, and large range of microorganisms. This natural productivity plays an important role recycling nutrients and maintaining the water quality.

Biofloc technology (BFT) is as an environmentally friendly aquaculture technique based on in situ microorganism production. Fish and shrimp are grown in an intensive way (minimum of 300 g of biomass per square meter with zero or minimum water exchange. In addition, continuously water movement in the entirely water column is required to induce the macroaggregate (biofloc) formation. Nutrients in water (in accordance with a known carbon-to-nitrogen ratio of 12–20:1) will contribute naturally to a heterotrophic microbial community formation and stabilization. These microorganisms play three major roles: (i) maintenance of water quality, by the uptake of nitrogen compounds generating in situ microbial protein; (ii) nutrition, increasing culture feasibility by reducing feed conversion ratio (FCR) and a decrease of feed costs; and (iii) competition with pathogens.

Main water quality parameters in BFT

Water quality maintenance and monitoring in any aquaculture are the essential practices aiming at the success of the growing cycles. Temperature, dissolved oxygen (DO), pH, salinity (EC), ORP, solids [total suspended solids (TSS) and settling solids], alkalinity, and orthophosphate are some examples of parameters that should be continuously monitored, especially in BFT. The comprehension and understanding of water quality parameters and its interactions in BFT are crucial to the correct development and maintenance of the production cycle. For example, safety ranges of pH, DO, EC, total ammonia nitrogen (TAN), solids, and alkalinity will lead a healthy growth and avoid mortalities.

PH Level

pH is a measure of whether water is acidic or basic. Fish have an average blood pH of 7.4, so pond water with a pH close to this is optimum. An acceptable range would be 6.5 to 9.0. Fish can become stressed in water with a pH ranging from 4.0 to 6.5 and 9.0 to 11.0. Fish growth is limited in water pH less than 6.5, and reproduction ceases and fry can die at pH less than 5.0. Death is almost certain at a pH of less than 4.0 or greater than 11.0. In BFT water pH fluctuates throughout the day. Typically, pH is highest at dusk and lowest at dawn. This is because nighttime respiration increases carbon dioxide concentrations that interact with water producing carbonic acid and lowering pH. This can limit the ability of fish blood to carry oxygen.

pH measurement
pH measurement

Alkalinity is water’s ability to resist changes in pH and is a measure of the total concentration of bases in pond water including carbonates, bicarbonates, hydroxides, phosphates and borates. These bases react with and neutralize acids, buffering changes in pH. Carbonates and bicarbonates are the most common and important components of alkalinity. A total alkalinity of at least 20 ppm is necessary for good pond productivity. Water with high alkalinity and similar hardness levels has a neutral or slightly basic pH and does not fluctuate widely.

ORP

It’s an acronym for Oxidation-Reduction Potential (or Redox Potential in some parts of the world). Essentially, ORP is a measurement of water’s cleanliness as a function of the pollution or contaminants in it. The pollution, known as dissolved Organic Compounds (or DOCs), is too small and fine to be removed from the water by traditional mechanical filtration.

The number given by an ORP (ORP stands for Oxidation Reduction Potential) meter is a direct index to the pollution levels of the pond. Unlike most of our other water quality readings, lower numbers are bad, while higher numbers are good. Readings below 150 indicate a pond in need of significant improvements. 250-400 is the range of healthy ponds, and conditions which promote good fish growth. High numbers between 475 and 550 reflect active Potassium Permanganate use, which should kill parasites.

ORP reading can help you determine if your filtration is working properly or if you need more filtration. At readings of below 150, significant improvements to the filtration of the pond should be made as soon as possible to avoid massive fish health problems. At readings between 150 to 200, fish health will not be marginal, with green water and slime algae a usual occurrence, especially in the absence of UV lights.At readings between 200 to 250, fish health will usually be okay, but not optimum, and stringy algae or blanket weed will normally be a problem.Readings between 250 and 400 reflect good to superb water quality, and prevention of fish health problems by water excellent water quality control. The higher end of this range is preferred over the lower end for dependably good fish health and fast fish growth.

EC (Electrical Conductivity)

EC or Electrical Conductivity of water is its ability to conduct an electric current. Salts or other chemicals that dissolve in water can break down into positively and negatively charged ions. These free ions in the water conduct electricity, so the water’s electrical conductivity depends on the concentration of ions. Salinity and total dissolved solids (TDS) are used to calculate the EC of water, which helps to indicate the water’s purity. The purer the water the lower the conductivity.

Major positively charged ions that affect the conductivity of water are sodium, calcium, potassium and magnesium. Major negatively charged ions are chloride, sulfate, carbonate and bicarbonate. Nitrates and phosphates are minor contributors to conductivity, but they are very important biologically. The natural impacts on EC in water are rain, geology, and evaporation. Human impacts include road salt, septic/landfill leachate, impervious surface runoff, and agricultural runoff.

When water is subject to pollution, contamination, or impurities, we will see a change in the EC of that water as the dissolved substances increase the level of EC. As such, EC can be a good indicator of pollution in water. It is worth noting, however, that impurities such as salt in seawater for example, cause very high EC readings as the water contains a large amount of dissolved salt. This is because when salt is dissolved, it separates into ions (electrically charged atoms).

Conductivity is usually measured in microSiemens (µS/cm) and readings generally fall between 30 µS/cm to 2000 µS/cm. Seawater, for example, will have a reading of approximately 50, 000 µS/cm. An interesting fact worth mentioning is that conductivity will actually increase when the temperature of the water increases, hence EC is commonly recorded at a 25°C with temperature and EC being recorded simultaneously. Another unit of measurement for EC is mS/cm or milliSiemens per centimeter. 1 mS/cm = 1000 µS/cm and you will often find measurements displayed as mS/cm for higher levels of EC (i.e. 2000 µS/cm or more).

TDS

Total Dissolved Solids (TDS) refers to the amount of substances that have been dissolved in the liquid. These substances can include salts, minerals, metals, calciums and other compounds which can be both organic and inorganic. In simple terms, TDS refers to anything present in the water that is not pure water and is not a suspended solid. The most commonly used method of determining TDS is measuring specific conductivity to detect the presence of ions in water (EC). Once the EC is determined, a conversion factor is ran (generally by the meter performing the measurement) to determine the TDS. The conversion factor will differ depending on the sample you are testing, conversion factors generally range from 0.4 – 1.0. This method, however, only estimates TDS levels.

TDS is generally measured in parts per million (ppm) but can also be measured in mg/L. Generally, good quality water will fall between 0 and 600 ppm and readings over 1200 ppm is often considered an unsatisfactory level of TDS.

IoT Based Temperature, PH, ORP, and EC monitoring system

For measuring any parameter mentioned above you will get a commercial meter and need to manually measure and record the data. But for continuous monitoring and tracking, an IoT based solution is required. In this tutorial, I will show you how I made an IoT based custom solution for continuous monitoring of

temperature, pH, EC and ORP. I used Wio Terminal for interfacing all the Grove sensors. The data can be visualized from the display of the Wio terminal as well as from an Android app. If any parameter reaches to unsatisfactory level an alert will be generated and ring the buzzer of the Wio terminal. You will get a notification also on your mobile phone. MQTT will be used to send data from the Wio terminal to the mobile app.

Collecting the Hardware

I used all Grove sensors from Seeed studio for my project. The sensors were interfaced with Wio terminal. The project was powered from two 18650 li-ion cells connected with parallel. The output of the battery is 3.7V and this voltage was stepped up to 5V using a boost converter.

Grove sensors
Grove sensors

All the components are connected through a double-sided perf board. Double line pin header is soldered for placing the Wio terminal. Grove connectors are not breadboard friendly. So I cut the cable in the middle and soldered in the breadboard.

For placing the sensors I made a custom 3D printed base. The BNC port of the PCB can be attached easily with the base.

The base is attached tightly with the perf board.

The sensor PCB is attached to the base with the nut thatcame with the sensor.

Then I connect the sensor to the PCB with the cable.

The Wio terminal has two built-in grove connector and one can be used for analog input. So, I used one built-in connector of the Wio terminal for one sensor. The other two sensors were connected through the 40 pin Pi connector of the bottom side of the Wio.

Then I connected the sensor probe to the sensor circuit with the BNC port.

The final hardware looks like the following.

After connecting all the sensors and battery the device is ready but before that, you need to upload the program to the Wio terminal. The program sketch is attached to the code section. But before uploading the program I suggest you read the getting started guide if you are using the Wio terminal for the first time. The official getting started guide is here.

As we are using wifi you need to update the wireless core firmware of the Wio terminal. Learn more from here.

After uploading the program I placed the device in one of my friend’s Biofloc plants for testing. The data can be visualized from the TFT of the Wio as well as from the Android application. For getting the accurate result from the sensors you may need to calibrate the sensors. See the sensor’s datasheet for the calibration process.

The Code

The program for the Wio terminal was developed in the Arduino environment. The sketch has several sections. One snippet is responsible for reading all the sensors. One snippet is responsible for displaying the information in the TFT. Two types of graphical interface were developed. You can change the graphical view by pressing the built-in A and B button of the Wio terminal. Another section of the code is responsible for sending the sensor data to MQTT broker. You need to add some external libraries to compile your code correctly. Follow the code for the details.

The Android App

For visualizing MQTT data from the broker, we need an MQTT dashboard, there is plenty of MQTT dashboard out there, but we are going to use an Android Mobile App called IoT MQTT Panel. For details about IoT MQTT Panel you can follow this excellent guide from here.

The following image shows the output of the app configuration. I choose Vertical Meter for pH, Gauge for ORP and EC, Line Graph for Temperature and Humidity.

After installing IoT MQTT Panel you first need to configure the connection of MQTT broker. There are several MQTT broker available for testing. You must use the same broker in the sketch and the app. I used an open broker (broker.mqtt-dashboard.com). So, configure your connection on the app according to the following figure.

After configuring the connection you need to set up a panel for data visualization. Lots of views are available. You can choose the type as your choice. I chose the following.

You need the set every panel before working. Be careful about the topic name of the panel. Every data has a separate topic name and should be used the same topic used in the sketch.

Custom parts and enclosures

Download

Schematics

code

Arduino Sketch Download

About Author

Calendar

September 2020
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930