EcoMaris: Healthy Waters, Greener Earth.

by CodersCafeTech in Circuits > Arduino

67 Views, 4 Favorites, 0 Comments

EcoMaris: Healthy Waters, Greener Earth.

Bouy_Cover_Pic (1).jpg

The health of aquatic ecosystems is vital not only for marine life but also for the sustainability of human communities and the planet as a whole. Whether in oceans, rivers, lakes, or aquaculture ponds, maintaining balanced water conditions is essential.

Across the globe, aquatic ecosystems are facing unprecedented challenges — from the rapid loss of biodiversity and climate-induced changes to pollution and overexploitation. These issues not only threaten marine and freshwater species but also affect human livelihoods, food security, and public health. Despite this, continuous, real-time water quality monitoring remains inaccessible or unaffordable for many stakeholders.

This project presents a solar-powered, low-cost, and modular smart buoy, built to be universally deployable across a range of aquatic environments — from aquaculture ponds to coral reefs, community reservoirs to coastal restoration zones. The buoy uses a suite of robust sensors to monitor key water quality parameters:

  1. Temperature (°C): Critical for metabolic rates and oxygen solubility.
  2. Dissolved Oxygen (DO) (mg/L): Indicates whether aquatic life can breathe.
  3. pH: Reflects chemical balance and pollution susceptibility.
  4. Turbidity (NTU): Suggests sediment load, pollution, or algal bloom activity.
  5. Total Dissolved Solids (TDS) (ppm): Reflects the concentration of dissolved minerals, salts, and organic matter in water—critical for assessing water quality, osmotic balance for aquatic species, and ecosystem health.

The system is built around open-source hardware and software, allowing for customizability and ease of replication. It transmits real-time data wirelessly and can be accessed via cloud dashboards, mobile apps, or alerts — enabling on-the-go decision-making.

Supplies

Use Cases & Applications

1. Marine & Freshwater Conservation

  1. Endangered Species Monitoring: Helps researchers maintain suitable habitats for vulnerable species such as dolphins, seahorses, and freshwater turtles by continuously logging environmental trends.
  2. Coral Reef Protection: Reefs are sensitive to small changes in temperature, pH, and sedimentation. The buoy helps detect bleaching conditions early, improving conservation response.
  3. Seagrass and Mangrove Restoration: Post-restoration, the buoy ensures that environmental conditions remain optimal, helping NGOs and governments gauge the success of regeneration efforts.
  4. Protected Area Management: Deployed in marine sanctuaries or wildlife reserves to automate water health logging, freeing up human resources and enabling 24/7 monitoring.

2. Sustainable Aquaculture

While originally tested in shrimp ponds, this buoy is species-agnostic and suitable for:

  1. Fish farms (tilapia, trout, catfish, etc.)
  2. Shellfish cultivation (oysters, clams, mussels)
  3. Integrated Multi-Trophic Aquaculture (IMTA) systems

Key benefits:

  1. Reduces stress and mortality by maintaining stable water parameters.
  2. Enables smart dosing of oxygenation, buffering agents, and other treatments.
  3. Cuts operational costs and prevents overfeeding or unnecessary chemical usage.
  4. Increases productivity while ensuring environmentally safe discharge.

3. Community & Public Water Health Monitoring

In many regions, surface water bodies are the backbone of human survival. This buoy supports:

  1. Village ponds, tanks, and community reservoirs: Flags contamination from open defecation, dumping, or algae.
  2. Drinking water source validation: Alerts health officials or communities if conditions degrade beyond acceptable limits.
  3. Civic Monitoring: Citizens can use buoys to track the health of local lakes and rivers, enabling community-driven environmental stewardship.

4. Climate Change Impact Studies

Water ecosystems are among the first to show signs of climate change. With long-term data collected via this buoy, researchers can:

  1. Track temperature trends and their impact on oxygen availability and species diversity.
  2. Monitor acidification (pH drop) caused by increased atmospheric CO₂.
  3. Study how salinity levels change in estuaries due to rising sea levels and irregular rainfall.

5. Industrial & Agricultural Pollution Management

The buoy becomes an on-site watchdog at:

  1. Industrial discharge points, monitoring real-time pollutant levels.
  2. Agricultural runoff zones, where fertilizers and pesticides enter rivers and lakes, causing eutrophication or chemical contamination.
  3. Stormwater outlets, to check water quality after rainfall in urban environments.

6. Early Warning & Crisis Response

  1. Toxic Algae Blooms: Parameters like DO, pH, and turbidity shift before visible signs appear. Early detection saves ecosystems and prevents fish kills.
  2. Oil or Chemical Spills: A network of buoys can pinpoint the spread of a spill, informing containment strategies.
  3. Post-disaster Monitoring: After floods, tsunamis, or hurricanes, deployed buoys can quickly assess the water conditions to support relief and recovery efforts.

7. Research, Academia & Education

  1. Environmental science departments can deploy buoys in field labs, rivers, or near campuses to collect real-world data for student projects or research.
  2. School STEM programs can integrate low-cost kits to teach water chemistry, IoT, and sustainability.
  3. University researchers can gather longitudinal datasets with minimal manual intervention, enhancing studies on hydrology, aquatic biology, and pollution.

Particle B5 SoM

DSC01908.JPG

The B-SoM (Board System-on-Module) is the cornerstone of this project, functioning as a dependable IoT module for cellular connectivity. Built on the Particle IoT Platform-as-a-Service, it comes equipped with a free global embedded SIM card and data plan.

To interface with the module, we utilize the M.2 SoM Evaluation Board, a user-friendly breakout board that provides access to the B-SoM's essential pins and functionalities. This facilitates smooth development and deployment within our system. The evaluation board includes a variety of features, such as USB ports for both the nRF52840 MCU and the cellular modem, an SD card connector, an Ethernet connector, a barrel jack power connector, buttons, an RGB LED, a charge status LED, and a connector for a LiPo battery. These components collectively enhance the board's versatility and ease of use in the project.

For a quick start with the BSoM read this tutorial.

To utilize the full capabilities of the B524 SoM with the Particle platform, you’ll need to set up your Particle.io account and configure your device. Follow the steps here to getting started with the particle.

LM35 Temperature Sensor

DSC02405.JPG

The LM35 sensor is used to measure water temperature, a critical parameter for sustaining healthy aquatic ecosystems. Many aquatic species are highly sensitive to temperature fluctuations, which can affect their metabolism, behavior, and overall survival. Accurate and continuous monitoring enables better management of environmental conditions, supporting conservation efforts and the health of aquatic life. In this system, a waterproof version of the sensor is used to ensure reliable performance in submerged conditions.

The sensor operates by generating an analog voltage proportional to temperature, providing a simple and accurate method for temperature measurement.

Here is the sample code for getting temperature from lm35 and will print in the Serial monitor.

#define TEMP_PIN A0

void setup() {
Serial.begin(9600);
}

void loop() {
int sensorValue = analogRead(TEMP_PIN);
float voltage = sensorValue * (3.3 / 4095.0);
float temperatureC = voltage * 100.0; // LM35 gives 10mV per degree Celsius
Serial.println("Temperature: " + String(temperatureC) + "°C");
delay(1000);
}

PH Sensor

DSC02397.JPG

The pH sensor is employed to measure the acidity or alkalinity of water, a fundamental indicator of water quality across various aquatic environments. It functions by detecting voltage changes resulting from hydrogen ion concentration in the solution.

In most aquatic habitats, maintaining a pH level between 6.5 and 8.5 is essential for promoting growth, ensuring proper oxygen availability, and minimizing ammonia toxicity. Its plug-and-play design and compatibility with micro-controllers make it user-friendly for both beginners and professionals. Additionally, the use of the DFRobot pH library simplifies data processing, ensuring accurate and reliable pH readings for the project.

#include "DFRobot_ESP_PH.h"
#include <EEPROM.h>

#define PH_PIN A1
DFRobot_ESP_PH ph;

float voltage, phValue, temperature = 25.0; // Default temperature

void setup()
{
Serial.begin(9600);
ph.begin();
}

void loop()
{
int sensorValue = analogRead(PH_PIN);
voltage = sensorValue * (3.3 / 4095.0); // Convert analog reading to voltage
phValue = ph.readPH(voltage, temperature); // Get pH value using library function

Serial.print("pH: ");
Serial.println(phValue);

delay(1000);

Turbidity Sensor

DSC02403.JPG

The turbidity sensor measures water clarity by detecting the amount of light scattered by suspended particles in the water. High turbidity reduces light penetration, limiting photosynthesis in aquatic plants and decreasing oxygen production.

Excessive suspended particles in water can negatively impact aquatic organisms by interfering with respiration, reducing light penetration, and increasing stress levels. High turbidity not only limits visibility—affecting behaviors such as feeding and navigation—but also often signals the accumulation of organic matter, which may promote harmful bacterial growth and degrade overall water quality. Regular monitoring of turbidity levels enables timely interventions, such as improving filtration or adjusting aeration, to ensure a stable and healthy aquatic environment for diverse species and ecosystems.

// Sample code for getting Turbidity Values

#define SensorPin A0
#define VREF 3.3 // Adjust for Particle devices (3.3V reference)

float volt;
float ntu;

void setup() {
Serial.begin(115200);
pinMode(SensorPin, INPUT);
}

void loop() {
volt = 0;
for (int i = 0; i < 800; i++) {
volt += ((float)analogRead(SensorPin) / 4095) * VREF; // Adjust for 12-bit ADC
}
volt = volt / 800;
volt = round_to_dp(volt, 2);
// Map voltage to the required range
volt = mapf(volt, 0.0, 3.3, 1.83, 3.68);
// Calculate NTU using the quadratic equation
ntu = 493.17 * pow(volt, 2) - 3749.1 * volt + 7152.3;
// Limit NTU values between 0 and 2000
if (ntu < 0) {
ntu = 0;
} else if (ntu > 2000) {
ntu = 2000;
}
Serial.print("Voltage: ");
Serial.print(volt);
Serial.println(" V");
Serial.print("Turbidity: ");
Serial.print(ntu);
Serial.println(" NTU");
delay(1000);
}

float round_to_dp(float in_value, int decimal_place) {
float multiplier = powf(10.0f, decimal_place);
in_value = roundf(in_value * multiplier) / multiplier;
return in_value;
}

float mapf(float x, float in_min, float in_max, float out_min, float out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;

The code reads analog voltage from the turbidity sensor 800 times and converts it into a calibrated voltage value. This voltage is then used in a formula to calculate turbidity (NTU), ensuring values stay within the 0–2000 range. Finally, the voltage and NTU values are displayed on the Serial Monitor to help monitor water clarity.

TDS Sensor

DSC02419.JPG

The TDS (Total Dissolved Solids) sensor measures the concentration of dissolved substances in water by detecting its electrical conductivity. Higher conductivity typically indicates increased levels of minerals, salts, and organic matter. These parameters are critical in aquatic environments, as they influence water chemistry and can impact the physiological balance of aquatic organisms. Elevated TDS can disrupt osmoregulation—the process by which aquatic species manage internal salt and water levels—potentially leading to stress and impaired biological functions.

Poor water quality due to excessive dissolved solids may also cause gill irritation, hinder oxygen absorption, and increase the risk of infections. On the other hand, very low TDS readings can suggest a shortage of essential nutrients and minerals needed for growth and metabolic processes. Regular monitoring of TDS levels allows timely intervention and helps maintain stable, healthy water conditions that support the well-being of a wide variety of aquatic life, from fish to invertebrates.

// Sample code for getting TDS value

#include <math.h>

#define TDS_PIN A2
#define VREF 3.3 // Reference voltage for B SoM (3.3V)
#define TDS_FACTOR 0.5 // Conversion factor for TDS

void setup() {
Serial.begin(9600);
pinMode(TDS_PIN, INPUT);
}

void loop() {
int rawValue = analogRead(TDS_PIN); // Read sensor output
float voltage = rawValue * (VREF / 1024.0); // Convert to voltage
float ecValue = (133.42 * voltage * voltage * voltage - 255.86 * voltage * voltage + 857.39 * voltage) * 0.01;
float tdsValue = ecValue * TDS_FACTOR; // Convert EC to TDS

Serial.println("TDS: " + String(tdsValue) + " ppm");
delay(1000);
}

Dissolved Oxygen Sensor

DSC02381.JPG

Dissolved oxygen refers to the extent of free, non-compound oxygen present in water or other liquids. It’s one of the most important parameters when assessing water quality due to its influence on the organisms living within a body of water. A DO level that’s too high or too low can harm aquatic life and affect water quality. The dissolved oxygen sensor measures the concentration of oxygen in water using an electrochemical or optical method. It helps ensure sufficient oxygen levels for respiration.

There are three types of dissolved oxygen sensor measurements: galvanic, polarographic, and optical. We are using the galvanic dissolved oxygen sensor for this project due to its reliability and simplicity.

Before getting the Dissolved Oxygen Sensor probe to work, we need to prepare the probe. To prepare the probe, you need to dissolve approximately 4 grams of KCL crystals in 52 grams of water to create a 7.5% KCL solution.

DSC02363.JPG

DSC02375.JPG

Preparation includes adding 7.5% KCL solution into the membrane cap, ensuring the membrane is wrinkle-free, filling 2/3 of the cap with KCL, and securing the cap to eliminate air bubbles. The electrode tube should be free of air bubbles to prevent reading fluctuations. For detailed instructions, visit Dissolved Oxygen Probe Preparation.

DSC02385.JPG

DSC02391.JPG

We are using single-point calibration, which involves calibrating the saturated dissolved oxygen at a fixed temperature, suitable for stable temperature environments.

Use a LM35 temperature sensor to measure the temperature of the liquid and note down the value in °C. Next, wet the DO probe in the same liquid and gently shake off any excess water droplets to ensure the probe membrane is clean and hydrated. Then, expose the probe to air while maintaining natural airflow around it (avoid using a fan or artificial airflow). Wait for the output voltage from the DO probe to stabilize, and once stable, record the voltage. This voltage represents the saturated dissolved oxygen voltage at the current temperature. Use this recorded voltage value in your final code for calibration, as it corresponds to 100% dissolved oxygen saturation at the measured temperature.

// Code to get the reference voltage

#include <Arduino.h>
#define VREF 5000//VREF(mv)
#define ADC_RES 1024//ADC Resolution
uint32_t raw;
void setup()
{
Serial.begin(9600);
}
void loop()
{
raw=analogRead(A1);
Serial.println("raw:\t"+String(raw)+"\tVoltage(mv)"+String(raw*VREF/ADC_RES));
delay(1000);
}
// Code to get the DO value in mg/L

#include <Arduino.h>
// Pin and constants
#define DO_PIN A1 // Analog pin for DO sensor
#define VREF 3300 // Reference voltage in mV
#define ADC_RES 4096 // 12-bit ADC resolution

#define TWO_POINT_CALIBRATION 0

#define READ_TEMP (25) // Current water temperature (°C)

// Single-point calibration values ( Here we are using Single Point calibration)
#define CAL1_V (1455) // Calibration voltage at CAL1_T (mV)
#define CAL1_T (25) // Calibration temperature (°C)

//Two-point calibration needs to be filled CAL2_V and CAL2_T
#define CAL2_V (1300) //mv
#define CAL2_T (15) //℃

// DO lookup table (saturation values from 0°C to 40°C)
const uint16_t DO_Table[41] =
{
14460, 14220, 13820, 13440, 13090, 12740, 12420, 12110, 11810, 11530,
11260, 11010, 10770, 10530, 10300, 10080, 9860, 9660, 9460, 9270,
9080, 8900, 8730, 8570, 8410, 8250, 8110, 7960, 7820, 7690,
7560, 7430, 7300, 7180, 7070, 6950, 6840, 6730, 6630, 6530, 6410
};

uint8_t Temperaturet;
uint16_t ADC_Raw, ADC_Voltage, DO;

// DO calculation using calibration
int16_t readDO(uint32_t voltage_mv, uint8_t temperature_c) {
#if TWO_POINT_CALIBRATION == 0
uint16_t V_saturation = (uint32_t)CAL1_V + 35 * temperature_c - CAL1_T * 35;
return (voltage_mv * DO_Table[temperature_c]) / V_saturation;
#else
uint16_t V_saturation = ((temperature_c - CAL2_T) * (CAL1_V - CAL2_V)) / (CAL1_T - CAL2_T) + CAL2_V;
return (voltage_mv * DO_Table[temperature_c]) / V_saturation;
#endif
}
void setup()
{
Serial.begin(9600);
}
void loop()
{
Temperaturet = (uint8_t)READ_TEMP;
ADC_Raw = analogRead(DO_PIN);
ADC_Voltage = (uint32_t)VREF * ADC_Raw / ADC_RES;
DO = readDO(ADC_Voltage, Temperaturet);
Serial.print("Temp:\t" + String(Temperaturet) + "\t");
Serial.print("ADC:\t" + String(ADC_Raw) + "\t");
Serial.print("Volt:\t" + String(ADC_Voltage) + "mV\t");
Serial.println("DO:\t" + String(DO));
delay(1000);
}

Rain Sensor

DSC02415.JPG

The rain sensor detects precipitation by measuring changes in electrical resistance across its conductive surface when water droplets make contact. This allows real-time monitoring of rainfall intensity and frequency, which is crucial in managing outdoor aquatic systems such as ponds, lakes, or aquaculture setups. Rainfall can lead to rapid shifts in environmental conditions—such as sudden drops in temperature, dilution of dissolved minerals, and reductions in salinity—that may disrupt the delicate balance required for aquatic life to thrive.

Heavy precipitation also contributes to increased turbidity by introducing sediment, organic debris, and pollutants into the water, which can degrade overall water quality. This in turn can reduce oxygen availability and elevate stress levels in aquatic organisms. By integrating a rain sensor into a monitoring system, users can receive timely data and alerts, enabling them to take proactive steps—such as adjusting filtration, aeration, or buffering strategies—to preserve a stable and healthy aquatic environment.

// Code to detect rain

#include <Arduino.h>

#define RAIN_SENSOR_PIN A4 // Define the pin for the rain sensor

void setup()
{
Serial.begin(115200);
}

void loop()
{
static unsigned long timepoint = millis();
if (millis() - timepoint > 1000U) { // Every 1 second
timepoint = millis();

// Read Rain Sensor
int rainValue = analogRead(RAIN_SENSOR_PIN);
bool isRaining = rainValue < 1000; // Adjust threshold based on sensor readings

// Serial Print
Serial.print("Rain Sensor Value: "); Serial.print(rainValue);
Serial.print(" | Rain Detected: "); Serial.println(isRaining ? "Yes" : "No");
}
}

Power Management

The system is powered by 6 solar panels (6V each) connected in parallel to increase current. The panels are wired to the 5V Solar Power Manager, which regulates the power flow to the 1800mAh battery. This battery stores energy and provides stable power for night time or cloudy conditions.

DSC02424.JPG

DSC02433.JPG


image.png

DSC01985.JPG

The Dissolved oxygen sensor needs 9V to operate, to compensate the voltage we have used the LM2596S Buck converter power supply.

DSC02596.JPG

Antenna

DSC02442.JPG

To enhance cellular connectivity and ensure stable data transmission in remote or aquatic locations, we upgraded the default antenna to a rubber duck antenna for use with the Particle B SoM. This antenna features a durable, flexible exterior and connects via a standard SMA connector, offering omnidirectional radiation that's ideal for buoy-based systems, which may shift due to wind or water currents. To connect the antenna to the B SoM's U.FL port, we used a 15cm U.FL to SMA female bulkhead RF cable assembly. Operating across a wide frequency range (698–960 MHz & 1710–2690 MHz) with up to 5 dBi gain, the rubber duck antenna significantly improves performance in low-signal areas compared to embedded or PCB antennas. The sleek form factor also adds a more professional, rugged aesthetic to the final device, making it suitable for both field and demonstration use.

3D Model

Shrimp Monitoring v71.png

Shrimp Monitoring s1.png

Using Autodesk Fusion 360, we developed a bespoke 3D model that combines a trapezoidal housing with a circular semi-spherical foundation to ensure optimal buoyancy performance. This distinctive shape enhances balance and stability on the water surface while offering ample room to mount sensors and securely enclose the electronics.

Shrimp Monitoring exploded.png

The full structure comprises three main parts: the upper trapezoidal section, the semi-spherical middle, and a flat circular base for holding internal components. The trapezoidal and semi-spherical parts were 3D printed using PLA, chosen for its lightweight, water-resistant, and outdoor-friendly properties. For saving the time and the filament the base was laser-cut from 2mm yellow acrylic.

DSC02457.JPG

Assembly

Before getting into the assembly we finalized code and the circuit using breadboard and jumpers,

DSC02463.JPG

First we secured the sensors on their corresponding slots.

DSC02466.JPG

Then we secure the sensors breakout boards on the one side of acrylic and remaining on the other side.

DSC02472.JPG

DSC02485.JPG

Then we attached the solar panel and the rain sensor.

DSC02488.JPG

DSC02585.JPG

DSC02593.JPG

Then we fixed the three parts with the M3 nuts and bolts.

DSC02569.JPG

DSC02572.JPG

So here is the final version.

Final.JPG

Ubidots Dashboard

We used Ubidots to visualize real-time sensor data from the buoy. The Particle B SoM sends temperature, pH, turbidity, dissolved oxygen, TDS, and rain sensor data to the Ubidots platform using webhooks. Ubidots provides a clean, user-friendly dashboard where each parameter can be monitored through graphs, gauges, and indicators.

Interconnecting Particle Cloud With Ubidots

To interconnect Particle cloud with ubidots follow these steps.

  1. Create an account at ubidots.com.
  2. Create a new device and note the device label.
  3. In the Particle console, go to Integrations > New Integration > Ubidots.
  4. Set the event name and paste the Ubidots API endpoint: https://industrial.api.ubidots.com/api/v1.6/devices/{device-label}
  5. Use the POST method and include your Ubidots Token in the header.
  6. Format your JSON body with the variable labels and values as
{
"temperature": "{{{temperature}}}",
"ph": "{{{ph}}}",
"turbidity": "{{{turbidity}}}",
"do": "{{{do}}}",
"tds": "{{{tds}}}",
"rain": "{{{rain}}}"
}


Once configured, data from the buoy will appear in Ubidots and can be customized into a real-time monitoring dashboard.

Dash_boardss.png

Sending Alerts With Ubidots

To create alerts, navigate to Data > Events, and then “Create Event.

1. In the Triggers section:

  1. Click "Add Variable."
  2. Select your device and variable

2. Set condition:

  1. "is greater than" for upper limit
  2. "is less than" for lower limit

3. Enter the threshold value4. In the Action section:

  1. Click "Add Action."
  2. Select "Send SMS."
  3. Enter the recipient’s phone number (e.g., +1234567890)
  4. Type the SMS message ( Hi there, {{Variable name}} was {{Trigger value}} at {{Trigger timestamp}} )
  5. In the Settings section, name your event (e.g., "Temperature High Alert")
  6. Click "Save."

5. Test by sending a value that triggers the condition.

Once everything is configured, you get alerts when the values cross the thresholds.

IMG_7112.png

What Does This Offer

As aquatic ecosystems face mounting pressures from climate change and human activity, the need for continuous, intelligent monitoring has never been more critical. By integrating essential water quality sensors—including temperature, pH, turbidity, total dissolved solids (TDS), and rainfall detection—into a compact, waterproof, and solar-powered platform, this buoy offers a comprehensive snapshot of aquatic health. Its universal design ensures it can be deployed not only in aquaculture settings like shrimp or fish farms, but also in lakes, rivers, reservoirs, and coastal zones for conservation, research, or pollution control efforts.

Beyond its technical capabilities, the Smart Buoy empowers communities, researchers, farmers, and environmental agencies with actionable insights to make informed decisions. It enables early detection of harmful changes in water conditions, helping to prevent disease outbreaks, habitat degradation, and biodiversity loss. Whether it’s ensuring optimal growth conditions for aquatic species, supporting sustainable farming practices, or safeguarding delicate ecosystems, this smart buoy offers a scalable, cost-effective approach to environmental stewardship—demonstrating how accessible technology can play a vital role in protecting our planet’s most precious resource: Water.