Introduction: Aquarium Controlling and Monitoring Using Arduino + 1sheed


Smart controlled fishbowl for beginner with video fully described

ET fishbowl is a smart controlled robot that automatically feeds your fish at a given time, control light, oxygen, filter, water level, and add or remove water all by itself using Arduino + 1sheeld.

Functions

1. Control light

2. Control oxygen

3. Control filter

4. Auto feeder (dropping fish food at a certain time)5. Add and remove water

6. LCD display (read temperature and water level)

Auto Feeder really is a useful feature you could use it if:

1. You are forgetful

2. Are busy and working all the time

3. Are on vacation and need to feed the fish when you aren't there.

4. Want the best care for your fishes.

All steps have been written in detail so as to make it as easy as possible for anyone to make this themselves!

Step 1: Skills Required:

1. Experience with Arduino and electronics.

2. Experience with coding.

Step 2: Materials:

1. An Arduino Board: I used ARDUINO UNO

2. 1sheeld board .

3. Smart phone.

4.Bulb .

5. 6-channel relay.

6. Fishbowl .

7. Filter.

8. Servo motor .

9. Lm35.

10. power supply 24v DC.

Step 3: Download Arduino and 1sheeld Application

a) Download Arduino application from the following link

https://www.arduino.cc/en/Main/Software

b) Download 1 shield application on your smartphone from play store.

Step 4: Download Code

Step 5: Download 1Sheeld Library

download 1Sheeld Library from the following link

Step 6: Extract 1sheeld Library Files

  1. Extract 1sheeld library files
  2. open arduino libraries
  3. make new folder
  4. rename it onesheeld
  5. past extracted 1sheeld library files on it

Step 7: Select the Required Shields From 1sheeld Application

  • TEXT_TO_SPEECH_SHIELD
  • VOICE_RECOGNIZER_SHIELD
  • GAMEPAD_SHIELD
  • TERMINAL_SHIELD
  • LCD_SHIELDSLIDER_SHIELD
  • CLOCK_SHIELD

Step 8: How All Functions Works (connections and Coding )

A) Control light, oxygen and filter

  • Initialize Arduino pins
<p>int bulb_pin=13;               // connect relay_bulb to pin 13;<br>int filter_pin=11;             // connect filter to pin 11;
int oxygen_pin=4;              // connect oxygen_pin to pin 9;</p>
  • Initialize Arduino pins as (INPUT OR OUTPUT).
<p>pinMode(filter_pin,OUTPUT);    // Set the filter_pin as output;<br>pinMode(oxygen_pin,OUTPUT);    // Set the filter_pin as output;
pinMode(bulb_pin,OUTPUT);      // Set the bulb_pin as output;</p>

B) HOW TO CONTROL LIGHT, OXYGEN AND FILTER

1.USING clock shield

  • select the required shield from 1sheeld application in smart phone.
  • we must define it in Arduino.
<p>#define INCLUDE_CLOCK_SHIELD</p>
  • we must select hour, minute and second in arduino.
<p>hour = Clock.getHours();</p><p> minute = Clock.getMinutes();
 second = Clock.getSeconds();
if(hour == xx && minute == xx && second == xx) //change hours, minute,second to the desired time;
  {</p><p>// code                   //fully described in the code;<br> }
if(hour == xx && minute == xx && second == xx )  //change hours, minute,second to the desired time;
{
//code                    //fully described in the code;<br> }</p>

2.Using GAMEPAD SHIELD

  • select the required shield from 1sheeld application in smart phone.
  • define it in Arduino code.

<p>#define INCLUDE_GAMEPAD_SHIELD</p>

  • open and close filter using orange button and close it again using the same button.
<p>if ( (GamePad.isOrangePressed()) && (change_button_state_O==0) )<br> {
open and close filter           / /  fully described in the code;<br> }</p>

  • open and close bulb using Red button and close it again using the same button.
<p>if ( GamePad.isRedPressed() && change_button_state_R==0)<br>{
open and close bulb      / /  fully described in the code<br>}</p>
  • open and close oxygen using Greenbutton and close it again using the same button.
<p>if ( GamePad.isGreenPressed() && change_button_state_G==0)<br>{
open and close oxygen         / /  fully described in the code<br>}</p>

3. Using { VOICE_RECOGNIZER_SHIELD} and {TEXT_TO_SPEECH_SHIELD}

  • select the required shield from 1sheeld application in smart phone.
<p>#define INCLUDE_TEXT_TO_SPEECH_SHIELD<br>#define INCLUDE_VOICE_RECOGNIZER_SHIELD</p>
  • choose Voice commands.
<p>const char firstCommand[]="hello";<br>const char secondCommand[]="control servo";
const char thirdCommand[]="turn on light";
const char fourthCommand[]="turn off light";
const char fifthCommand[]="turn on filter";
const char sixthCommand[]="turn off filter";
const char oxygen_openCommand[]="turn on oxygen";
const char oxygen_closeCommand[]="turn off oxygen";
const char seventhCommand[]="add";
const char eighthCommand[]="remove";
const char ninthCommand[]="yes";
const char tenthCommand[]="no";</p>
  • Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new command is given .
<p>VoiceRecognition.setOnNewCommand(&myFunction);<br>void myFunction (char *commandSpoken)
{
// control light, oxygen and filter using voice recognition     / /  fully described in the code file<br>}</p>

c) How FEEDER WORKS

1) USING clock shield

  • select the required shield from 1sheeld application in smart phone.
  • define it in Arduino.
<p>#define INCLUDE_CLOCK_SHIELD</p>
  • we must select hour, minute and second in arduino.
<p>hour = Clock.getHours();  <br>minute = Clock.getMinutes();
second = Clock.getSeconds();</p><p>if(hour == xx && minute == xx&& second == xx)  // change hours, minute,second to the desired time
  {
// code           / /  fully described in the code  (control servo position)</p><p>  <br> }
if(hour == xx && minute == xx && second == xx )    
  {
//code           / /  fully described in the code file  (control servo position)<br>   }</p>
  • Include servo library.
<p>#include <servo.h></p>
  • put a variable to store servo position.
int pos = 0;                   // variable to store the servo position
  • attaches the servo on pin 9 to the servo object.
myservo.attach(9);             // attaches the servo on pin 9 to the servo object

2) USING SLIDER SHIELD


  • select the required shield from 1sheeld application in smart phone.
  • define it in Arduino code.

<p>#define INCLUDE_SLIDER_SHIELD</p>
  • Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a slider position is changed giving a new value
Slider.setOnValueChange(&servo);
  • put the following function outside the loop.
<p>void servo (byte sliderValue)<br>
{
  pos=sliderValue*90/255;       // scale convert from (0 to 255) to (0 to 90 degree) 
  myservo.write(pos);           // tell servo to go to position in variable 'pos' 
  delay(2);
}</p>

D) HOW TO USE LCD

  • WE ARE USING LCD TO SHOW temperature DEGREE AND WATER LEVEL USING LM35 AND WATER LEVEL SENSORS.
  • define it in Arduino code.
<p>#define INCLUDE_LCD_SHIELD</p>
  • select the required shield from 1sheeld application in smart phone.
  • Initialize temperature pin.
<p>int tempPin = A0;              // lm35 temperature sensor is connected to pin A0</p>
  • Initialize water level sensor pin.
<p>int water_sensor = A1;         // water level sensor is connected to pin A1</p>
  • lcd code.
LCD.setCursor(0,0);        //Set the cursor to begin writing from the first row and first column.<p> LCD.print("temp = ");<br> int value = analogRead(tempPin); 
 float mv = ( value/1024.0)*5000; 
 float cel = mv/10;
 LCD.setCursor(0,7);                // Set the cursor to begin writing from the first row and 8 column.
 LCD.print(cel);                         // Print cel value
 LCD.setCursor(1,0);                // Set the cursor to begin writing from the second row and first column.
 LCD.print("water level= ");       // Print water level= .
 LCD.setCursor(1,12);              // Set the cursor to begin writing from the second row and column 13.
 LCD.print( analogRead(A1));  // Print water level value .</p>

E) HOW TO USE PUMP

  • we are using pump to add and remove water

1)using game pad

  • select the required shield from 1sheeld application in smart phone.
<p>#define INCLUDE_GAMEPAD_SHIELD</p>
  • add and remove water using up and down arrow.
if(GamePad.isUpPressed())             // start adding water<p>    {</p><p>    //code       / /  fully described in the code file</p><p>   }</p><p>    if(GamePad.isDownPressed())           // start removing water<br>    { 
    //code       / /  fully described in the code file</p><p>    }</p>
  • stop adding and removing water using blue button.
<p>if ( GamePad.isBluePressed() )           // stop adding or removing water<br>  {<br> //code    / /  fully described in the code</p><p>  }</p>

2)using voice recognizer

  • fully described in the code file

Step 9: Schematic Diagram