It was difficult to raise chicks and small fishes when I was little.
I always think that it is impossible for me to raise a lovely aquatic animal in my life. Proposed by one of my friends, I decided to make an automatic water change system.
DFRduino UNO R3 *1
Gravity: IO Expansion Shield for Arduino V7.1 *1
Gravity: Analog Turbidity Sensor For Arduino *1
Immersible Pump & WaterTube *1
Gravity: Analog pH Sensor / Meter Kit For Arduino *1
Wall Adapter Power Supply 12VDC *1
Solenoid Valve *1
Gravity: Digital 5A Relay Module *1
Water Pipe *2m
Interface (for solenoid valve) *2
I2C 16x2 Arduino LCD Display Module
Implementation of all module functions
Water supply is the easiest link in the whole system. Here I used the Immersible Pump & WaterTube.
Place the pump body in the container filled with clean water, and place the water pipe in the fish tank. The clean water will be easily supplied to the fish tank only after power-on.
There is a minor problem. The water pipe often moves during water supply. So I design this.
The water pipe will not move after fixed in this way.
The model picture of fixing part is as shown below. Interested friends may refer to it.
I spent much time on water draining.
After the liquid is filled in a U-shaped pipe structure by use of applied force of liquid level height difference, place the end with high opening into the container filled up with liquid. Then, the liquid in the container will continuously flow out from the opening at the lower position through siphon.
The physical principle is that, two containers have different liquid level height; after the liquid in such two containers is connected, the motion trend of same liquid level will be maintained, i.e., the resultant force borne by the flowing liquid will turn downward, so the liquid will flow to the lower location.
Generally, the fish tank is placed on the table, so I only need to place a bucket (or other container) on the ground and then use a pipe to connect it.
After the water draining has been realized successfully, I add a solenoid valve. The switch will be turned on after power-on and shut down after power shutdown. Then, you may drain the water as you wish.
1. The water pipe shall have small diameter, because we raise some small fishes, and the large-diameter pipe will absorb the small fishes out of the tank.
2. It is recommended to buy the solenoid valve with the minimum capacity on line (9V or 12V), not only saving power but also having little noise. It is not necessary to use a larger capacity.
3. For water draining based on siphon principle, first of all, there must be water in the water pipe connecting both containers. I suck lightly with my mouth when the whole system start operating.
If you think it’s dirty, you may buy a manual air extraction device on line. The water will be pumped by squeezing here with your hand as shown in the figure below.
2. Automatic detection of PH value and turbidity value
PH value and turbidity value shall be selected as the indexes for water changing. The PH value fluctuation of water in the fish tank shall not exceed 0.2,i.e., the water quality change shall be controlled within 1.6 times for each water changing. If so, it is all right to change 1/2 water with the same temperature. If not, less water changing volume is allowed.
I decide to only change about one tenth to one twelfth of water each time. However, this water changing frequency must be high, i.e., water needs to be changed when the PH value and turbidity value detected do not conform to the specification. By estimation, the water needs to be changed three or four times a day. Such frequency is not high.
Water level balance test
This problem needs to be explained separately. Although we have realized automation of water draining and supply, we cannot keep the water level balance under this automation, because water draining and supply speeds are different. The speeds are set during production. Thus, I need to figure out how to measure the water draining and supply speeds, and then modify their operating duration accordingly to reach the water level balance.
I test as follows:
Firstly, I inspect my fish tank capacity visually, about 15L. One tenth water is changed every time, i.e., 1.5L. By rounding off, I decide to use 2L water to carry out the test.
I do not have a measuring cup, so I decide to use disposable cup with the capacity of 250 ml.
2L water means 8 cups of water. I use the disposable cup above to pour water in the bucket above for 8 times. Then, I start testing the water supply speed:
While water supplying, I start using the stopwatch on my mobile phone for timing. At last, the water supply time calculated is as follows:
Then, I test the water draining speed:
In the meantime, I also record the water draining time as follows:
Water supply time: 1.01.71=61.71S
Water supply speed: 2000/61=32.41ml/s
Water draining time: 3.56.20=236.20S
Water draining speed: 2000/236.20=8.47ml/s
#define TurbidityPin A0//
#define PHPin A1//
#define Supplywaterpin 11//
#define Drainwaterpin 12//
if (Turbidityval<4.06 || PHval<7.0 || PHval>8)//
if(Turbidityval<4.06 || PHval<7.0 || PHval>8)//
Serial.print(" no change ");
Serial.print(" Trubidity value: ");
Serial.print(" PH value: ");
Detailed explanation has been added. I believe you can understand mostly. However, I want to make some explanations on the following point:
“if (Turbidityval<4.06 || PHval<7.0 || PHval>8)// if the turbidity sensor output is less than 4V or PH value is less than 6.5
getPH();//PH value reading
if(Turbidityval<4.06 || PHval<7.0 || PHval>8)// turbidity and PH value still meet water changing conditions”
Why are there two “if statements” above?
Because a fish passes by the turbidity sensor carelessly or fish feed is scattered near the turbidity sensor which will cause transient turbidity.
We certainly know the water is not truly turbid. However, the machine does not know, so we need to let the machine know.
Thus, I add this line of codes. The equipment will determine the water is turbid if detecting the water is remained turbid within 10 s. (Fishes must have eaten up the feed in a location within 10s)
For water draining and supply time, I plan limit changing volume at high frequency, so each water supply time is only 20 s, and the water draining time shall be 20*3.8=76 s.
It can raise all miraculous small animals which are not seen in temperate zone countries or only exist in deep sea.