# DIY Aquarium Evaporation Top Off System © CC BY-NC

A system to automatically compensate water loss in aquariums due to evaporation.

• 6,716 views
• 17 comments
• 31 respects

## Components and supplies

 Arduino UNO & Genuino UNO
×1
 Atlas Scientific Peristaltic Pump Kit
×1
 Breadboard (generic)
×1
 Male/Male Jumper Wires
×1

## Necessary tools and machines

 Measuring Cup
 Clear Tape

## Apps and online services

 Arduino IDE

## About this project

Evaporation reduces the amount of water in an aquarium and if left uncompensated, will lead to changes in the chemistry of the remaining water. Such changes will have negative impacts on the lifeforms within the aquarium. Hence it is important to maintain the water at the appropriate level. This can be done manually, or by a system that does it automatically. In this project, we will be making such a system.

### Advantages

• Helps to maintain stable water chemistry such as pH and salinity.
• Once set up, human intervention is not needed unless maintenance is required.
• Saves time.

### Step 1: Evaluate the Evaporation Rate of Aquarium

The aquarium evaporation rate is vital as it will be used when setting up the peristaltic pump.

a) Ensure that the water in the aquarium is at the correct level. Use a piece of clear tape to mark this point.

b) Let the aquarium sit for a few days without adding water to it. Once the change in the water level is noticeable, proceed to the next step.

c) Use the measuring cup to add water to the aquarium until it is brought back to the correct level (indicated by the mark made in step a). Record the amount of water that is added based on the gauge of the cup. This will be the total volume of water that has evaporated over the number of days in which the tank was left unattended.

d) Calculate the aquarium evaporation rate using the following formula:

Aquarium evaporation rate = (Total volume of water evaporated in milliliters) / (Number of days tank left unattended x 24 x 60) = Rate in milliliters per minute

24 -> number of hours in a day, 60 -> number of minutes in an hour

Example: The test was conducted for 4 days where 4000mL of water was lost. Aquarium evaporation rate = (4000) / (4 x 24 x 60) = 0.69 mL/min

### Step 2: Assemble Hardware

The pump has two communication protocol, UART and I2C. Before assembling ensure that it is in UART mode. For information on how to change between protocols refer to the following LINK.

Connect the pump to the Arduino as shown in the schematic above.

The pump has two power lines. The line that goes to the Arduino's 5V pin is for the circuitry attached to the pump while the external 12V supply is for the motor. Use the five-pin header to mount the data cable of the pump to the breadboard and jumper wires make the appropriate connections from the breadboard to the Arduino.

Since this is a stand-alone unit, it is recommended that the Arduino has its own power supply so that it will not rely on USB power from a computer.

DATASHEET: EZO PMP

### Step 3: Load Program Onto Arduino and Calibrate Pump

a) Download the sample code from this LINK. It will be in a folder titled "arduino_UNO_PMP_sample_code."

b) Connect the Arduino to your computer.

c) Open the code downloaded from step a, in your Arduino IDE. If you do not have the IDE, you can download it from HERE.

d) Compile and upload code to the Arduino UNO.

e) Open the serial monitor. For access go to Tools -> Serial Monitor or press Ctrl+Shift+M on your keyboard. Set the baud rate to 9600 and select "Carriage return". You should now be able to communicate with the pump. As a test, enter the command I which will return the device information.

CALIBRATION:

f) Calibrating the pump is optional, but for improved accuracy, it should be done. Refer to the pump datasheet for instructions.

### Step 4: Compare Max Possible Flow Rate of Pump with Aquarium Evaporation Rate

The pump has four modes of operation. These are continuous dispensing, volume dispensing, dose over time and constant flow rate. Refer to the pump datasheet for information on these modes. For this particular application, the constant flow rate mode is used.

The syntax is shown above. In the command, [ml/min] is the aquarium evaporation rate that was found in step 1.

Note: The maximum flow rate is determined after calibration. If the flow rate is too fast, the pump will produce an error message and will not rotate. Comparing the maximum possible flow rate with your aquarium evaporation rate would let you know if the system will work.

Use the command DC, ? to get the maximum possible flow rate.

• If the max possible flow rate is greater than the tank evaporation rate, the system will work.
• If the max possible flow rate is less than the tank evaporation rate, try calibrating the pump at a different volume and re-comparing the rates.

### Step 5: Connect Pump to Aquarium

• The input side of the pump goes into the water reservoir while the output goes into the aquarium as shown in the sketch above.
• It is recommended to have the purest water possible in the reservoir as this will reduce the influence on water chemistry within the aquarium.

### Step 6: Instruct Pump to Dispense at the Appropriate Rate

After a successful comparison between the max possible flow rate and the aquarium evaporation rate, send the following command in the serial monitor DC, aquarium evaporation rate, *

In the example from step 1, we calculated the aquarium evaporation rate as 0.69mL/min, therefore the command would be DC, 0.69, *

At this point, the computer can be disconnected. The pump will dispense at the specified rate continuously.

Once the dispense command is issued, will the pump run forever? The pump will run continuously for 20 days after which it will reset. To restart the pump, resend the command DC, aquarium evaporation rate, *

What happens if the power gets interrupted? As mentioned before the pump has two power supplies: 5V for the circuitry and 12V for the motor. If the 12V is disconnected the pump will output an under-voltage error and stop dispensing, but once reconnected it will continue to dispense. On the other hand, if the 5V line is disconnected, dispensing will not continue when reconnected. In this case, you will have to resend the command DC, aquarium evaporation rate.*

## Code

##### aquarium evaporation top off codeC/C++
```//This code was written to be easy to understand.

//Modify this code as you see fit.
//This code will output data to the Arduino serial monitor.
//Type commands into the Arduino serial monitor to control the EZO-PMP Embedded Dosing Pump.
//This code was written in the Arduino 1.8.9 IDE
//An Arduino UNO was used to test this code.
//This code was last tested 6/2019

#include <SoftwareSerial.h>                           //we have to include the SoftwareSerial library, or else we can't use it
#define rx 2                                          //define what pin rx is going to be
#define tx 3                                          //define what pin tx is going to be

SoftwareSerial myserial(rx, tx);                      //define how the soft serial port is going to work

String inputstring = "";                              //a string to hold incoming data from the PC
String devicestring = "";                             //a string to hold the data from the Atlas Scientific product
boolean input_string_complete = false;                //have we received all the data from the PC
boolean device_string_complete = false;               //have we received all the data from the Atlas Scientific product
float ml;                                             //used to hold a floating point number that is the volume

void setup() {                                        //set up the hardware
Serial.begin(9600);                                 //set baud rate for the hardware serial port_0 to 9600
myserial.begin(9600);                               //set baud rate for the software serial port to 9600
inputstring.reserve(10);                            //set aside some bytes for receiving data from the PC
devicestring.reserve(30);                           //set aside some bytes for receiving data from the Atlas Scientific product
}

void serialEvent() {                                  //if the hardware serial port_0 receives a char
inputstring = Serial.readStringUntil(13);           //read the string until we see a <CR>
input_string_complete = true;                       //set the flag used to tell if we have received a completed string from the PC
}

void loop() {                                         //here we go...

if (input_string_complete == true) {                //if a string from the PC has been received in its entirety
myserial.print(inputstring);                      //send that string to the Atlas Scientific product
myserial.print('\r');                             //add a <CR> to the end of the string
inputstring = "";                                 //clear the string
input_string_complete = false;                    //reset the flag used to tell if we have received a completed string from the PC
}

if (myserial.available() > 0) {                     //if we see that the Atlas Scientific product has sent a character
char inchar = (char)myserial.read();              //get the char we just received
devicestring += inchar;                           //add the char to the var called devicestring
if (inchar == '\r') {                             //if the incoming character is a <CR>
device_string_complete = true;                  //set the flag
}
}

if (device_string_complete == true) {                           //if a string from the Atlas Scientific product has been received in its entirety
Serial.println(devicestring);                                 //send that string to the PC's serial monitor
if (isdigit(devicestring[0]) || devicestring[0]== '-') {      //if the first character in the string is a digit or a "-" sign
ml = devicestring.toFloat();                                //convert the string to a floating point number so it can be evaluated by the Arduino
}                                                          //in this code we do not use "ml", But if you need to evaluate the ml as a float, this is how it’s done
devicestring = "";                                            //clear the string
device_string_complete = false;                               //reset the flag used to tell if we have received a completed string from the Atlas Scientific product
}
}
```

## Comments

• 10 projects
• 78 followers

July 9, 2019

#### Members who respect this project

and 23 others

See similar projects
you might like

• 6,865 views
• 2 comments
• 30 respects

• 11,599 views
• 13 comments
• 10 respects

• 7,349 views
• 0 comments
• 23 respects

#### Making a Cheap Aquarium Parameters Controller

Project tutorial by Boisse Martin

• 9,301 views
• 4 comments
• 21 respects

#### Simple and Smart Air Purifier System

Project tutorial by Aaron Kow

• 18,263 views
• 5 comments
• 45 respects

• 4,634 views
• 0 comments
• 7 respects