Introduction: SmartAquarium

The SmartAquarium is designed for beginners in the field of electronics, more precisely with Arduino and Raspberry PI.Before, we are going to ask yourself some questions :

• Have you ever thought regulate and check some remote setting for your aquarium such as temperature and brightness?

• Have you ever thought to feed your fish according to a daily schedule and a certain amount of food?

• Have you ever thought of managing the lighting automatically in order to develop the plant and animal species in the aquarium?

Thanks to SmartAquarium it is possible to perform all these functions:

•First It regulates the brightness to enhance energy conservation, animal species and plants.

• Secondly, it regulates the temperature with a temperature sensor and a heating resistor.

• Third a system automation feeds the fish according to a schedule and the type of fish.

• Then, a display informing the set temperature and the temperature of the water

• After it presses, adjusts and monitors the temperature distance, brightness and feeding schedules fish through the software © AquaFish.

• Last, a manual mode allowing action on LED and the supply of fish food

In this instrucatable, you can follow the different steps to construct the SmartAquarium.

Step 1: The Main Components

For this project, you must purchase the major components:

- Arduino :

The wiring is done on the Arduino, so you have to think about buying female and male cables for it.

As for power supply, Arduino must be connected to Raspberry PI. For this, use a USB cable.

The link to buy the cable: https://www.amazon.fr/imprimante-scanner-QUALITE-...

The link to buy Arduino: https://www.amazon.fr/gp/product/B01AXOEIL4/ref=pd...

- Raspberry PI 3 :

The Raspeberry PI is used to connect the SmartAquarium with Internet.

As for power supply, it is needed to use a micro-USB supply of 5V.

The link to buy the power supply: https://www.amazon.fr/Aukru%C2%AE-Alimentation-Cha...

The link to buy the Raspberry PI 3: https://www.amazon.fr/Raspberry-Pi-3-Model-B/dp/B0...

- A breadboard :

The breadboard is the central element of the project.

The link to buy this : https://www.amazon.fr/Adafruit-Full-sized-breadboa...

- A relay :

For our project, we decided to control multiple devices:

- The lighting of leds through a photocell light sensor;

- Ignition of a heating resistor thanks’ to a temperature sensor;

For this, we bought a relay that allows separating the control part (Arduino) and the power unit. We chose 4 relays of the model “Songle: SRD-05VDC”. It has the following characteristic: 10A 250V / AC. It is important to know this information because it means that it is not possible to install equipment more than 2500 W because the relay doesn’t accept a current stronger than 10A for 250V voltage. The relay type corresponds to our project because it has male pins specially adapted for Arduino. In addition, it has a mounting hole in each corner that will fix on our plate behind the aquarium. For the relay supply, it has two pins: a pin to 5V and the other to link to the mass. The control of the relay is connected to a single pin and can be performed during the change of the voltage. Indeed, the change occurs when voltage passes off 5V to 0V.

The link to buy this : https://www.amazon.fr/Neuftech%C2%AE-bouclier-s%C3...

Step 2: The Screen

Using a screen is convenient for the user of SmartAquarium. He will inspect the temperature value of the real-time aquarium. In this way, it may verify whether the heating resistor.

In addition, the LCD will also display the temperature set point.

Note that the screen must be apparent from the box in order to observe easily the information it gives.

The link to buy a screen : https://www.amazon.fr/HD44780-1602-Module-affiche-...

Step 3: The Temperature Regulation

The next step is the temperature sensor that we have used in the aquarium. Considering that the role of this sensor is to measure water temperature, we had to buy a waterproof sensor. We opted for the DS18B20 from Dallas manufacturer which has a measuring range appropriate for our application (-55°C to 125°C).

The link for this component :

https://www.amazon.fr/JMT-Num%C3%A9rique-inoxydabl...

One of the particularities of this component is that it’s a digital sensor so we don’t have to use the analog pin of the Arduino as an analog to digital converter. By this way, we can plug the data wire in any pins of the Arduino. Moreover, this sensor uses the one wire technology which allows connecting several sensors to the same pin. Even if we are not going to use this functionality, we need to include the “OneWire” library. Furthermore, the DS18B20 datasheet specifies that we also need a 4.7K pullup resistor to integrate into the circuit.

Step 4: The Lighting Control

For our project, we thought it was necessary to equip the aquarium of a LEDs. In this way, the aquarium will be enlightened when the room become dark.For this, it was necessary first to buy a light sensor (or photoresistance). The principle is quite simple: more there is light, more the resistance is low. Darkness causes significant resistance. Then we have to connect the sensor to the analog port of the Arduino. Thus, the analog pin transforms the received voltage, between 0 and 5V, to a value between 0 and 1024. However, we have transformed these values in programming to a percentage of brightness between 0 and 100%.

For wiring, we used a resistor as a voltage divider bridge. For this type of sensor, it was a resistance of 10k ohms.In programming, we set a value (for example 20%) which will instruct the relay to change state. Thus, the relay passes to “normally open” in “normally closed” to power the LEDs. Note that it is possible to improve this system because the user wants not necessarily light the LEDs when the room is dark. For this, it is necessary to install a switch that will allow to voluntarily cut the supply of LEDs.

The list of equipment :

- LEDs : http://www.miniinthebox.com/fr/5m-300x3528-rgb-smd...

- A photoresistance

- A resistance of 10k Ohms

- A relay : https://www.amazon.fr/Optocoupleur-pilote-Module-r...

Step 5: The Servomotor

A servomotor is a rotary actuator that allows for precise control of angular. For our project, we decided to use this component to automatically feed the fish.

The idea is simple: we stuck a plastic container on the shaft of the servo-motor. So, when the instruction is supplied to the motor, the latter turns 180 °. Therefore, the food falls through the small holes. After some time, the actuator turns 180° again.

Depending on the amount you want to give to the fish, it is possible to change the number of motor rotation.

To get more information on this power system, the following link illustrates the steps to follow:

https://www.instructables.com/id/Arduino-Fish-Feede...

In below, here are the links to buy the various essential components in this step :

The servo-motor : https://www.amazon.fr/Fivesix-Micro-petits-accesso...

The plastic container : https://www.amazon.fr/Plastique-Graduee-Specimen-R...

Step 6: The Real Time Clock

This timer allows the integration of a time component at the Arduino. Thus, if the Arduino is switched off the timer will be able to save time. It comes in the form of a small electronic circuit powered by a cell.

Why is it interesting for our project? First, when logging data, it’s often really useful to have timestamps! That way you can take data one minute apart (by checking the clock) or note at what time of day the data was logged. Secondly, which is of great significance for the functionality of the project. For example, if a power outage occurs at the user, the aquarium will always functional. So, the feeding of fish will be always carried out at the desired time by the user. We have wired temporarily the timer at the Arduino to check its functionality. This wiring was realized easily, do it according to arrangement :

– VCC Arduino 5V

– GND Arduino GND

– SCL On A5

– SDA On A4

The link to buy this RTC :

http://www.amazon.com/Donop-DS3231-AT24C32-precisi...

Step 7: The Programming

Arduino

The programming language is C++ and libraries used are specifically developed for the Arduino.

The installation will be easily done, you will need some libraries to compile our program that you can find in the requirements. These libraries give an easy way to communicate with sensors.

- Requirements:

- First, you will need to install the Arduino Software, you can download it for Windows, Linux or Mac OS X on: https://www.arduino.cc/en/Main/Software

- Then, you will have to install libraries bellow, you can find these files on the internet depository or directly download it from attachments above. The folder contains the following files, after downloading it, you will have to place it on the following directory in your computer: C:\Program Files (x86)\Arduino\libraries

OneWire.h (Temperature sensor)

DallasTemperature.h (Temperature sensor)

LiquidCrystal.h (Display)

Servo.h (Servomotor)

Raspberry

The programming language is Raspbian based on Debian and optimized for Raspberry Pi.

You won’t have to learn this language a lot due to the small number of commands you will use.

After you have installed Raspbian and update it, VNC and putty are the only thing you will need to have a remote access to the raspberry. The winSCP software will be also required to transfer files easily from your computer to the raspberry.

VNC will give you a Graphical User Interface with a desktop environment which will give you an easy way to interact and launch the SmartFish software.

Note that Putty won’t support the library Tkinter used for our application. (console only)

- Requirements:

- Install the Raspbian Operating System and update it, there are lot of tutorials on the internet

- For VNC, follow the procedure on: http://the-raspberry.com/vnc and establish the connexion between your computer and the Raspberry.

- Install Python libraries: sudo apt-get install python

- Transfer the files picture.gif and SmartFish.py to a directory of your own choice.

- Open the script and run it.

Step 8: The Shoe Box

In the last, we decided to collect material for the final artwork. For this, we have chosen a shoe box on which will be fixed all the equipment.

Using this shoe box, this will reduce the space of clutter. Indeed, the box can simply be placed next to the aquarium and is more easily portable. The shoe box will also cover up too exposed cables. However, the display will be apparent from the box in order to observe the information it gives.

In addition, he will think about the light sensor out of the box or it will not receive external light.