Automated Aquarium

by georgey_bastian in Living > Pets

480 Views, 2 Favorites, 0 Comments

Automated Aquarium

IMG20210727111600.jpg
IMG20210727111921.jpg
IMG20210727112216.jpg
IMG20210727111614.jpg
IMG20210727112149.jpg

Everybody wishes to make an aquarium or pond for growing beautiful fishes as pet or for commercial purpose. But majority of people didn't get proper time for look after them and this leads to the death of the fishes. Some of the processes are tiresome and hence many refuse to grow fishes.

Some of the major problems that leads to the death of aquarium animals:

  • Many don't have proper time to take care of the aquarium.
  • Forget to clean the aquarium
  • Very difficult to change the water in aquarium.
  • Over functioning of aquarium aerators or purifiers leads to wastage of electricity.
  • Loss of water in tank due to leakage or evaporation of water.
  • Over filling of aquarium with water.
  • Increase or decrease in optimum temperature of aquarium water.
  • Proper feeding of fishes.

This AUTOMATED AQUARIUM get rid of almost all the problems except feeding. I will include an automated feeding system in my next version which will surely make the process easier. Incorporating computer vision technology helps to monitor the fishes, tracking there habits and then taking necessary steps.

In this project for knowing the water level, a simple technique is used which will detect when water is below a particular range and also when it is above the optimum range.

Supplies

  1. Aquarium with fishes or pond.
  2. Temperature sensor(LM35 module)
  3. Thermocol boards(polystyrene) or wood
  4. Arduino UNO
  5. Bolt IoT device
  6. Inlet valve
  7. Aquarium pump
  8. Jumper wires
  9. Relay*2

The inlet valve used in this project is from a washing machine.

Setting the Water Level Detecting Equipment

IMG20210726202427.jpg
IMG20210726195808.jpg
IMG20210726195832.jpg
IMG20210726195905.jpg
IMG20210726205711.jpg
IMG20210726205724.jpg
IMG20210726200213.jpg
IMG20210726200305.jpg
IMG20210726201455.jpg
IMG20210726201827.jpg
IMG20210726204156.jpg
IMG20210726203456.jpg

The water level detecting equipment must detect the water level when it is below a particular level also above a particular level. So it must sense the changes in the level of water. Therefore a floating object must be placed and it's position is used for detecting the level of water.

Wood or themocol can be used as the floating object.

Steps in making the water level detecting equipment:

Step 1

  • Making a thermocol box like shown in the figure. you can also make it using wood.

Step 2

  • Now cut 2 pieces of thermocol and hinge it inside the thermocol box so that it will act as switches which will automatically open or closes when water go up or below the specified level.

Step 3

  • Now connect the wires as shown in the figure.

Step 4

  • As I programmed in the Arduino code, from 2 wires from the each upper and lower switch, connect 1 from each to the common ground of Arduino and then the upper wire of the equipment to Arduino's digital pin 4 and lower switch wire to Arduino's digital pin 2.

Step 5

  • Now connect the 2 relay modules to the Arduino's digital pin 6 and 7.

Step 6

  • Connect the relay from Arduino's 6th pin to the inlet valve and 7th pin to the pump.

Step 7

  • Now power the inlet valve and the pump using the relay.

Code from Arduino

int pump_pin = 7;
int inlet_pin = 6;

void setup() {

pinMode(2,INPUT_PULLUP);

pinMode(4,INPUT_PULLUP);

pinMode(pump_pin,OUTPUT);

pinMode(inlet_pin,OUTPUT);

Serial.begin(9600);

}

void loop() {

int pinValue1 = digitalRead(2);

delay(1000);

int pinValue2 = digitalRead(4);

delay(1000);

if(pinValue1 == 1) //Means the water is below the minimum optimum range

{ Serial.println("The water is below the minimum optimum range");

while(digitalRead(4) == 1) {

digitalWrite(inlet_pin,HIGH);

delay(10);

int pinValue2 = digitalRead(4);

delay(10);

Serial.println(pinValue2);

}

digitalWrite(inlet_pin,LOW);

Serial.println("The water is in the optimum range");

if(pinValue2 == 0) //Means water is above the maximum optimum range

{ Serial.println("The water is above the maximum optimum range");

while(digitalRead(4) == 0)

{ digitalWrite(pump_pin,HIGH);

delay(10);

int pinValue2 = digitalRead(4);

delay(10);

}

digitalWrite(pump_pin,LOW);

Serial.println("The water is in the optimum range");

}

}

The dimensions of the water level detecting equipment can be made according to the dimensions of your aquarium and the things used and the glues used must be friendly with the aquarium animals. You van also use this in a pond.

The inlet valve and pump can be placed anywhere on the aquarium.

Working of the Water Level Detecting Equipment

Automated aquarium water level detecting equipment

This video shows the working of Water level detecting equipment. We can't use float valve in the place of this equipment because placing the circuit for switches will be difficult, costly and won't fit small aquarium tank.

Setting the LM35 Temperature Sensor With Bolt IoT

IMG_20210728_091541.jpg
IMG_20210728_091605.jpg
IMG_20210728_091637.jpg
a669962-twilio.png
Screenshot_2021-07-27-09-17-06-38_cf3cf72bd8e53b0db7ddb0a6f2208af9.jpg
Annotation 2021-07-27 091918.png

The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly-proportional to the Centigrade temperature. The LM35 device is rated to operate over a −55°C to 150°C temperature range which is best suited for the temperature measurements in an aquarium.

Hardware required

  • The Bolt Wifi module
  • 3 female to male wire
  • Temperature Sensor: LM35 sensor

Connecting the LM35 sensor to the Bolt

Step 1: Hold the sensor in a manner such that you can read LM35 written on it.

Step 2: In this position, identify the pins of the sensor as VCC, Output and Gnd from your left to right.

In the above image, VCC is connected to the red wire, Output is connected to the orange wire and Gnd is connected to the brown wire.

Step 3: Using male to female wire connect the 3 pins of the LM35 to the Bolt Wifi Module as follows:

  • VCC pin of the LM35 connects to 5v of the Bolt Wifi module.
  • Output pin of the LM35 connects to A0 (Analog input pin) of the Bolt Wifi module.
  • Gnd pin of the LM35 connects to the Gnd.

Then you want to create in Twilio for getting messages when the water temperature crosses the threshold.

Creating an account on Twilio
Step 4: Create an account on https://www.twilio.com/try-twilio

After successfully creating the account, click on the home icon on the leftmost bar as shown in the image below. This screen will have your SID and Auth token which we will use later during coding. Copy both and save them in a text file.

The code

import temp
from boltiot import Sms, Bolt import json, time

minimum_limit = 20

maximum_limit = 30

mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)

sms = Sms(temp.SID, temp.AUTH_TOKEN, temp.TO_NUMBER, temp.FROM_NUMBER)

while True:

print ("Reading sensor value")

response = mybolt.analogRead('A0')

data = json.loads(response)

print("Sensor value is: " + str(data['value']))

try:

sensor_value = int(data['value'])

tempe = (100*sensor_value)/1024

if tempe > maximum_limit or tempe < minimum_limit:

print("Making request to Twilio to send a SMS")

response = sms.send_sms("The Current temperature sensor value is " +str(tempe)) print("Response received from Twilio is: " + str(response))

print("Status of SMS at Twilio is :" + str(response.status))

except Exception as e:

print ("Error occurred: Below are the details")

print (e)

time.sleep(10)

The above imported temp file is a python file which contain the details of the bolt module I used and all the details of the twilio account.

for this you can refer this link.

Step 5: Import this code to the Bolt module.

Step 6: Place the LM35 module inside the aquarium in the water.

Step 7(optional): You can connect the arduino and bolt module using serial communication. By doing this way if the temperature crosses the threshold value you can drain out the water from aquarium using the drain pump and then filling cool water into the tank using the inlet valve.

By knowing the abnormality in temperature you can easily change the water in the aquarium and save the fishes.

Optional

Actually this was in my idea in creating the automated aquarium but due to the unavailability in the RTC module during the making time I can't demonstrate it. By adding the RTC module we can change the water inside the aquarium during a specific interval of time and refill it using new fresh water from the inlet valve.

Connecting the Arduino and the Bolt module using the serial communication, we can change the water inside the tank and fill it with cool fresh water. But unfortunately my Bolt module and Arduino is not linking due to some problems.

Also you can incorporate a water purifier/ filter in this. Usually they work almost all time unnecessarily because they just need to work after regular interval and not continuously. So by programming using RTC module you can operate the purifier in regular intervals of time and reduce the wastage of electricity.