Open Aquarium has been designed to work with both 220V (Europe) & 110V (US). For more info go to the "Electrical Features section"

A complete Open Source API is included to easily control the board through Arduino. And we have also designed a web application that allows to store in a data base the information gathered and visualize it from a browser and from iPhone / Android devices. We have released it as Open Source code too, so that you can improve it and make it personal for your own product!

There are 5 sensors available in the platform to measure the key parameters in the fish tank such as temperature , pH or Conductivity and then some others to control the correct state of the fish tank (level and leakages) . In addition, there are 4 different actuators to automate tasks such as heating or cooling the water , feeding the fish , activating the pumps for water change or medicines administration , and controlling the intensity of the light to simulate the day/night cicles.

Open Aquarium has been designed to help you to take care of your fish by automating the control and maintenance tasks that take place in the fish tanks and ponds. Open Aquarium consists of two different and complementary kits: Basic and Aquaponics , and many several extra accessories.

DISCLAIMER: A bad use or failure of the elements of Open Aquarium (heaters, fan cooler, etc) may vary the ideal living conditions of the fish risking their lives. Please have this into account when setting the system in your fish tank. Open Aquarium is an educational and experimentation platform. Try the system on a fish tank with no fish in it until you get the right conditions and check the system stability during some weeks.

Yes. The 433MHz band is unlicensed and free of use in Europe. For extra information about the R&TTE / CEPT / ETSI directive read the next document.

Can I use the 433MHz radios included in Open Aquarium in Europe?

Yes. The US Federal Communications Commission (FCC) regulates operation at 433 MHz under Regulation 10CFR47 Part 15.231. This frequency band is intended for remote control, although some other usages are possible with some restrictions:

Can I use the 433MHz radios included in Open Aquarium in the US?

Open Aquarium gateway communicates with the RF power strip with FSK modulation (Frequency-shift keying) at 433MHz.

Open Aquarium has been designed to work with both 220V (Europe) & 110V (US). To use the RF Power Strip in 110V power setups you just need to use this 110-220V Power Converter .

Open Aquarium must be powered by an external power supply (12V - 2A).

The pack we are going to use in this tutorial is the Open Aquarium platform from Cooking Hacks. Open Aquarium is fully compatible with Arduino UNO.

The library won't work if you put the .cpp and .h files directly into the libraries folder or if they're nested in an extra folder. Restart the Arduino application. Make sure the new library appears in the Sketch->Import Library menu item of the software.

To install the library, first quit the Arduino application. Then uncompress the ZIP file containing the library. For installing Open Aquarium library , uncompress OpenAquarium.zip. It should contain a folder called "Open Aquarium", with files like OpenAquarium.cpp and OpenAquarium.h inside. Drag the Open Aquarium folder into this folder (your libraries folder). Under Windows, it will likely be called "My Documents\Arduino\libraries". For Mac users, it will likely be called "Documents/Arduino/libraries". On Linux, it will be the "libraries" folder in your sketchbook.

Libraries are often distributed as a ZIP file or folder. The name of the folder is the name of the library. Inside the folder will be the .cpp files, .h files and often a keywords.txt file, examples folder, and other files required by the library.

Open Aquarium includes a high level library functions for a easy manage of the board. Before start using this functions you should download the files from this link. This zip includes all the files needed in one folder, "OpenAquarium". Copy this folder in the arduino IDE folder "libraries". Don't forget include these libraries in your codes.

Open Aquarium counts with a C++ library that lets you read easily all the sensors and send the information by using any of the available radio interfaces. This library offers an simple-to-use open source system.

Screw it right to the wall.

Hang the fish feeder on the edge of your aquarium.

Place the temperature sensor into your aquarium and sitck it to the wall. The sensor must be inserted at least 4 cm in water.

Insert the water level into your aquarium. Water level must be completely submerged.

Upload the next code for a full example of Open Aquarium Basic.

Here is the USB output using the Arduino IDE serial port terminal:

NOTE: If you want to feed your fish more than one time a day you have to use readyforfeeding() function one minute before feed them..

Upload the next code for feeding fish at 11:30 and at 23:30:

Connect it into the "FEEDER" connector.

Bend the connector and insert it into the bigger gland.

The Automatic Fish Feeder has only one connector.

Here is the USB output using the Arduino IDE serial port terminal:

Upload the next code for seeing data in the serial monitor:

The water level switch can be read with two simple functions and you can also choose the number of water level to read.

After connecting the cables, tighten the screws.

Connect two wires into the terminal. Wires position doesn't matter.

Water level has two connections. Connect the wires in the water level connector. The contacts have not polarization.

Here is the USB output using the Arduino IDE serial port terminal:

Upload the next code to get the time:

Upload the next code to set the time:

You can read the date and time with this function

The RTC can be synchronized with the computer with this function in the setup()

The Open Aquarium gateway has a built in Real Time Clock (RTC), which keeps it informed of the time. This allows Open Aquarium to be programmed to perform time-related actions.

Here is the USB output using the Arduino IDE serial port terminal:

Upload the next code for seeing water temperature in the serial monitor:

The water temperature can be read with a simple function. This function return a float with the value.

After connecting the cables, tighten the screws.

Connect the red wire with the positive terminal (marked as "VCC" in the board), the black wire with the negative terminal (marked as "GND" in the board) and the white wire with the Data terminal (marked as "DATA" in the board).

The DS18B20 sensor has three connections (positive, negative and data).

This sealed digital temperature probe lets you precisely measure temperatures in wet environments with a simple 1-Wire interface. The DS18B20 sensor provides 9 to 12-bit (configurable) temperature readings over a 1-Wire interface, so that only one wire (and ground) needs to be connected from a central microprocessor.

The parts of this kit are:

Insert the electroconductivity sensor in the water. The sensor must be inserted at least 4 cm in water.

Insert the pH sensor into the water. The sensor must be inserted at least 4 cm in water.

Upload the next code for a full example of Open Aquarium Aquaponics.

NOTE: When you use the electro-conductivity sensor you can't use the dosing pump number 3. However you can still using dosing pumps number 1 and 2.

Here is the USB output using the Arduino IDE serial port terminal:

Upload the next code for seeing data in the serial monitor.

In order to calibrate the electro-conductivity sensor you can buy the conductivity calibration kit and obtain the EC values in resistance with the function OpenAquarium.readResistanceEC() for two values of EC. Now you must change the #defines in the top of the sketch. For example if you use the calibration kit with 10500 µS/cm and 40000 µS/cm you will need to write something like this:

With this simple function we can read the value of the sensor.

After connecting the cable, tighten the connector.

The electro-conductivity sensor probe has two connections. Connect the wires in the EC connector. The contacts have not polarization.

NOTE: When you use the pH sensor you can't use the level number 2. However you can still using level 1.

Here is the USB output using the Arduino IDE serial port terminal:

Upload the next code for seeing data in the serial monitor.

In order to calibrate the pH sensor you can buy the pH calibration kit calibration kit and obtain the pH values in mV (millivolts) with the function OpenAquarium.readpH() for the three values of pH. Now you must change the #defines in the top of the sketch.

With this functions we can read the value of the sensor.

After connecting the cable, tighten the connector.

You can connect it directly to the Open Aquarium Aquaponics board.

The pH sensor probe has only one connector which integrates all the different wires of the sensor. It is a BNC connector.

NOTE: Aquaponics extension needs Open Aquarium shield in order to work.

The parts of this kit are:

6. Extra accesories

6.1 Gateway box

To facilitate the installation of Open Aquarium, the kits include different types of boxes. In this step, we will explain you a way to mount the box but it is only an example. You can set the box as you want depending on the number of sensors, the type of power supply, the number of actuators or the place where you are going to place the box.

You can differentiate between two types of boxes.

To mount this box, you will need the following material.

First, you have to put the glands and the vent plug in the different holes of the box.

You have to tight the nuts.

Once the glands are fixed, you need to fix the Arduino to the internal plate with four M3 screws and nuts.

Then, you have to fix the plate to the box.

Now you have to take the Open Aquarium Gateway and screw the sensor and actuators in the correct position.

Mind the wires position.

You can choose the nearest gland to screw the sensor easily.

After that tighten all the glands, put on the Open Aquarium Gateway over the Arduino.

Finally, you can close the box.

And you have got the gateway box ready to use.

6.2 Gateway with Aquaponics box

To mount this box, you will need the following material.

First, you have to put the glands in the different holes of the box and tight their nuts.

Once the glands are fixed, you need to fix the Arduino to the internal plate with four M3 screws and nuts.

Then, you have to fix the plate to the box.

Then, you have to take the Open Aquarium Gateway and screw the sensor and actuators in the correct position.

Now take the Aquaponics extension board and put it over Open Aquarium shield.

Screw the EC sensor

Now put the BNC pigtail in the box.

Connect the pH sensor to the external BNC connector.

Connect the BNC pigtail to the Aquaponics extension.

Now put the Open Aquarium Gateway over the Arduino and the RF communication module.

Finally you can close the box. You have got the gateway box with Aquaponics ready to use.

6.3 RF Power Strip

Open Aquarium has been designed to work with both 220V (Europe) & 110V (US). To use the RF Power Strip in 110V power setups you just need to use this 110-220V Power Converter.

RF Power Strip Features

Features:

Working voltage: 240V, 50Hz

Max. Load Power: 2400W

Transmission frequency: 433,92MHz

Standby power consumption: 0,3W

RF link Features

Features:

Frequency: 433Mhz

Modulation: ASK

Connecting the actuator

To use this actuator you will need the following materials:

RF Power strip and remote control

Arduino

Open Aquarium shield

Antenna

RF receiver

RF transmitter

Cable USB Arduino

First, you need to power the RF Power Strip.

Then, connect the shield to the computer with the USB cable, put the antenna and put the jumpers in the correct position (RX, at the right).

Connect the RX module to the Open Aquarium gateway.

Once you have got the device ready for reading the values of the remote control, you need to upload the reading RF code to your Arduino.

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" void setup() { Serial.begin(115200); RemoteReceiver::init(0, 2, readCodes); } void loop() { } void readCodes(unsigned long receivedCode, unsigned int period) { RemoteReceiver::disable(); interrupts(); unsigned long code=receivedCode; code = code & 0xFFFFF; code |= (unsigned long)period << 23; code |= 3L << 20; Serial.println(code); RemoteReceiver::enable(); }

Now, open the serial monitor and press the different buttons of the remote control to a distance of 10 centimeters from the antenna and you will see the codes of each button.

For example these are the received codes when you press the button 1 ON:

1580367986 1605533810 1597145202 1613922418 1588756594

And these are the received codes when you press the button 1 OFF:

1580367988 1605533812 1597145204 1613922420 1588756596

Please, note you receive multiple codes for a single button, all of them are valid, but we recommend choosing the value fixed when holding down the button for 2 seconds. You can also observe that both are often consecutive and have a difference of 2.

For example we have choose these two codes:

on1: 1613922418 off1: 1613922420

Save all your chosen codes for all the buttons in a .txt file.

If you want to use tempcontrol(temperature) function in order to control your aquarium temperature you have to modify the library.

Put your codes at the beginning of the OpenAquarium.h file and connect the heater in socket 5 and the fan cooler in socket 4.

NOTE: You can also change temperature range in tempcontrol(temperature) function to adecuate it for your fish species.

After that, put the jumpers in the correct position (TX, at the left).

Now, change the RX module to the TX module.

Once you have got the device ready for sending the values of the remote control, you need to put the saved codes of each button in the code and upload it to your Arduino.

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" //Power strip codes. Please insert here your own codes generated with //RF_Receive_remoteControl_codes unsigned long on1 = 1613922418; unsigned long off1 = 1613922420; unsigned long on2 = 1597145220; unsigned long off2 = 1597145222; unsigned long on3 = 1597145112; unsigned long off3 = 1597145114; unsigned long on4 = 1597144950; unsigned long off4 = 1597144952; unsigned long on5 = 1597144464; unsigned long off5 = 1597144466; void setup() { Serial.begin(115200); } void loop() { OpenAquarium.sendPowerStrip(on1); //Turn ON plug 1 Serial.println("Plug 1: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off1);//Turn OFF plug 1 Serial.println("Plug 1: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on2); //Turn ON plug 2 Serial.println("Plug 2: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off2);//Turn OFF plug 2 Serial.println("Plug 2: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on3); //Turn ON plug 3 Serial.println("Plug 3: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off3);//Turn OFF plug 3 Serial.println("Plug 3: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on4); //Turn ON plug 4 Serial.println("Plug 4: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off4);//Turn OFF plug 4 Serial.println("Plug 4: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on5); //Turn ON plug 5 Serial.println("Plug 5: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off5);//Turn OFF plug 5 Serial.println("Plug 5: OFF"); delay(3000); //Wait five seconds }

You will be able to see how it turns on and off all the plugs in your RF power strip.

NOTE: When sending RF codes It's important that there is a minimum distance of 1 meter between the Open Aquarium antenna and the RF power strip. With smaller distances you can lose some pulses. Please check that you don't lose any pulse when your Open Aquarium is installed in the final place.

Library Functions

Actuating:

The RF power strip can be activated with a simple function which must include the code of the plug that we want to actuate.

Example:

{ OpenAquarium.sendPowerStrip(on1); //Turn ON the plug number 1 OpenAquarium.sendPowerStrip(off3); //Turn OFF the plug number 3 }

Example

Upload the next code to turn on and off all the plugs in your RF power strip:

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include <OpenAquarium.h> #include <Wire.h> //Power strip codes. Please insert here your own codes generated with //RF_Receive_remoteControl_codes unsigned long on1 = 1613922418; unsigned long off1 = 1613922420; unsigned long on2 = 1597145220; unsigned long off2 = 1597145222; unsigned long on3 = 1597145112; unsigned long off3 = 1597145114; unsigned long on4 = 1597144950; unsigned long off4 = 1597144952; unsigned long on5 = 1597144464; unsigned long off5 = 1597144466; void setup() { Serial.begin(115200); } void loop() { OpenAquarium.sendPowerStrip(on1); //Turn ON plug 1 Serial.println("Plug 1: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off1);//Turn OFF plug 1 Serial.println("Plug 1: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on2); //Turn ON plug 2 Serial.println("Plug 2: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off2);//Turn OFF plug 2 Serial.println("Plug 2: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on3); //Turn ON plug 3 Serial.println("Plug 3: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off3);//Turn OFF plug 3 Serial.println("Plug 3: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on4); //Turn ON plug 4 Serial.println("Plug 4: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off4);//Turn OFF plug 4 Serial.println("Plug 4: OFF"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(on5); //Turn ON plug 5 Serial.println("Plug 5: ON"); delay(3000); //Wait five seconds OpenAquarium.sendPowerStrip(off5);//Turn OFF plug 5 Serial.println("Plug 5: OFF"); delay(3000); //Wait five seconds }

Here is the USB output using the Arduino IDE serial port terminal:

6.4 Water leak sensor

Sensor features

Features:

Material: PE + alloy lead

Pull force limit : 60Kg

Core resistance : 3ohm/100 meters

Maximum exposed temperature: 75°C

Connecting the sensor

The water leak sensor has two connections. Connect the wires in the water leak connector. The contacts have not polarization

Gateway connection

Connect two wires into the terminal. Wires position doesn't matter.

After connecting the cables, tighten the screws.

Library Functions

Read values:

Leak sensor reads an analog value and makes alarm sound if it detects water presence.

Example:

{ OpenAquarium.leak(); //Reads value of the leak sensor and make alarm sound }

Example

Upload the next code for seeing data in the serial monitor. If there is water leakage, an alarm sound.

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" void setup() { OpenAquarium.init(); //Initialize Serial.begin(115200); } void loop() { OpenAquarium.leak(); delay(2000); //Wait 2 seconds }

Here is the USB output using the Arduino IDE serial port terminal:

6.5 Fan Cooler

Actuator Features

Features:

Rated Voltage: DC12V

Rated Current: 0.43A

Max Air Flow: 13.6CFM

Max Air Pressure: 15.7mmAg

Acoustical Noise: <39dB

Operating Temperature -10~60°C

Connecting the actuator

You can connect the fan cooler in any of the available sockets in the RF power strip. If you are going to use tempcontrol(temperature) function you have to connect it in socket 4.

Library functions

Actuating:

The RF power strip can be activated with a simple function which must include the code of the plug that we want to actuate.

Example:

{ OpenAquarium.sendPowerStrip(on1); //Turn ON the plug number 1 OpenAquarium.sendPowerStrip(off3); //Turn OFF the plug number 3 }

Example

Upload the next code to control the temperature between 26 and 28°C

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" float temperature; //Power strip codes unsigned long on1 = 1597145202; unsigned long off1 = 1597145204; unsigned long on2 = 1597145220; unsigned long off2 = 1597145222; unsigned long on3 = 1597145112; unsigned long off3 = 1597145114; unsigned long on4 = 1597144950; unsigned long off4 = 1597144952; unsigned long on5 = 1597144464; unsigned long off5 = 1597144466; void setup() { Serial.begin(115200); OpenAquarium.init(); } void loop() { temperature=OpenAquarium.readtemperature(); Serial.println(temperature); if(temperature>28){ OpenAquarium.sendPowerStrip(on4); //Turn ON plug 4 Serial.println("Fan ON"); } if(temperature<26){ OpenAquarium.sendPowerStrip(off4); //Turn OFF plug 4 Serial.println("Fan OFF"); } delay(500); }

Here is the USB output using the Arduino IDE serial port terminal:

6.6 Heater

Actuator features

Features:

Power: 100W

Voltage: 220/240V 50/60Hz

Length: 22cm

Diameter: 2.2cm

Length of power cord: 85cm

Recommended Tank Size: 20 to 33 gallon

Temperature range between 65°F and 93°F(17°C-35°C).

Fully submersible heaters work in any position (horizontal or vertical) to provide optimum aquarium water temperature.

Shatterproof glass.

Connecting the actuator

You can connect the heater in any of the available sockets in the RF power strip. If you are going to use tempcontrol(temperature) function you have to connect it in socket 5.

Library Functions

Actuating:

The RF power strip can be activated with a simple function which must include the code of the plug that we want to actuate.

Example

{ OpenAquarium.sendPowerStrip(on1); //Turn ON the plug number 1 OpenAquarium.sendPowerStrip(off3); //Turn OFF the plug number 3 }

Example

Upload the next code to control the temperature between 25 and 27°C

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" float temperature; //Power strip codes unsigned long on1 = 1597145202; unsigned long off1 = 1597145204; unsigned long on2 = 1597145220; unsigned long off2 = 1597145222; unsigned long on3 = 1597145112; unsigned long off3 = 1597145114; unsigned long on4 = 1597144950; unsigned long off4 = 1597144952; unsigned long on5 = 1597144464; unsigned long off5 = 1597144466; void setup() { Serial.begin(115200); OpenAquarium.init(); } void loop() { temperature=OpenAquarium.readtemperature(); Serial.println(temperature); if(temperature<25){ OpenAquarium.sendPowerStrip(on5); //Turn ON plug 5 Serial.println("Heater ON"); } if(temperature>27){ OpenAquarium.sendPowerStrip(off5); //Turn OFF plug 5 Serial.println("Heater OFF"); } delay(500); }

Here is the USB output using the Arduino IDE serial port terminal:

6.7 Water pump

Actuator features

Features:

Flow: 100-350 L/H

3.5-12 DC input voltage

Power range: 0.5W-5W

Submersible pump

Water output hole: 8 mm

Connecting the actuator

The water pump has two connections (positive and negative).

Gateway connection

Connect the brown wire with the positive terminal (marked with a "+"" in the board), the blue wire with the negative terminal. As you can see, you can connect this actuator in two different positions. Or, if you want, you can connect two different actuators.

After connecting the cables, tighten the screws.

Library Functions

Actuating:

The pump can be activated with a simple function which must include the number of pump (1 or 2)

Example:

After connecting the cables, tighten the screws.

{ OpenAquarium.pumpON(1); //Turn ON the pump number 1 OpenAquarium.pumpOFF(2); //Turn OFF the pump number 2 }

Example

Upload the next code to activate/deactivate the pump each five seconds:

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" void setup() { Serial.begin(115200); OpenAquarium.init(); } void loop() { OpenAquarium.pumpON(1); //Turn ON the pump number 1 (insert 1 or 2) Serial.println("Pump 1: ON"); delay (5000); //Wait five seconds OpenAquarium.pumpOFF(1); //Turn OFF the pump number 1 (insert 1 or 2) Serial.println("Pump 1: OFF"); delay (5000); //Wait five seconds }

6.8 Peristaltic pump

Actuator features

Features:

12V DC input voltage

Flow: 20-60 ml/min

Working condition: 0-40°C

Relative humidity: <80%

Driver size(Ø x H):Dia.27.6 x Height 37.9 (mm)

Pump head size(Ø x H):Dia. 31.7 x Height 20.1(mm)

Pump tube size(ID x OD) :2.5*4.7mm

Connecting the actuator

The peristaltic pump has two connections (positive and negative).

Gateway connection

Connect the red wire with the positive terminal (marked with a "+"" in the board), connect the black wire with the remaining terminal. As you can see, you can connect this actuator in three different positions. Or, if you want, you can connect three different actuators.

After connecting the cables, tighten the screws.

Library Functions

Actuating:

The pump can be activated with a simple function which must include the number of pump (1, 2 or 3)

Example:

After connecting the cables, tighten the screws.

{ OpenAquarium.perpumpON(1); //Turn ON the pump number 1 OpenAquarium.perpumpOFF(3); //Turn OFF the pump number 3 }

NOTE: If you want to use empty() function, you can choose number of drops changing it in OpenAquarium.h file

Example

Upload the next code to activate/deactivate the peristaltic pump each five seconds:

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" void setup() { Serial.begin(115200); OpenAquarium.init(); } void loop() { OpenAquarium.perpumpON(1); //Turn ON the peristaltic pump number 1 (insert 1 or 2) Serial.println("Peristaltic pump 1: ON"); delay (5000); //Wait five seconds OpenAquarium.perpumpOFF(1); //Turn OFF the peristaltic pump number 1 (insert 1 or 2) Serial.println("Peristaltic pump 1: OFF"); delay (5000); //Wait five seconds }

Here is the USB output using the Arduino IDE serial port terminal:

6.9 LED Lamp

Actuator features

Features:

Dimensions: 41 x 9 x 2cm (L x W x T)

Brackets add 4.5cm in height

Extendable brackets: 46.5~67cm

72 LEDs

Color of LED: 60White + 12Blue)

Luminous Flux: 500 Lumen

60 x 10000K LEDs

Uses 5.5 watts

Connecting the actuator

LED lamp has a mini jack connection - two connections (positive and negative)

Gateway connection

Connect the brown wire with the positive terminal (marked with a "VCC" in the board), the blue wire with the negative terminal (marked with a "GND" in the board).

After connecting the cables, tighten the screws.

Library Functions

Actuating:

Light intensity changes in order to simulate daylight

Example:

After connecting the cables, tighten the screws.

{ OpenAquarium.lighting(now); }

Example

Upload the next code for lighting program:

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" DateTime now; void setup(){ Serial.begin(115200); OpenAquarium.init(); } void loop(){ now =OpenAquarium.getTime(); OpenAquarium.printTime(now); OpenAquarium.lighting(now); }

6.10 RGB LED Waterproof

Actuator features

Features:

10.0mm wide, 3.2mm thick, 50mm long per segment (3 LEDs)

Clear waterproof molded (IP65)

3M adhesive strip on back

Maximum 12V per strip segment

Max 1.2 Amps per meter (all LEDs lit full brightness)

3 common-anode RGB LEDs per segment, 20 segments per meter

No microcontroller or chip controller ('analog' only!)

Connecting the actuator

You can connect the RGB LED waterproof with the RGB controller in any of the available sockets in the RF power strip.

Library Functions

Actuating:

The RF power strip can be activated with a simple function which must include the code of the plug that we want to actuate.

Example:

{ OpenAquarium.sendPowerStrip(on1); //Turn ON the plug number 1 OpenAquarium.sendPowerStrip(off3); //Turn OFF the plug number 3 }

Example

Upload the next code to turn LED ON at 22:15 and OFF at 23:59

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" DateTime now; //Power strip codes unsigned long on1 = 1597145202; unsigned long off1 = 1597145204; unsigned long on2 = 1597145220; unsigned long off2 = 1597145222; unsigned long on3 = 1597145112; unsigned long off3 = 1597145114; unsigned long on4 = 1597144950; unsigned long off4 = 1597144952; unsigned long on5 = 1597144464; unsigned long off5 = 1597144466; void setup() { Serial.begin(115200); OpenAquarium.init(); OpenAquarium.setTime(); } void loop() { now =OpenAquarium.getTime(); OpenAquarium.printTime(now); if (now.hour() == 22 && now.minute() == 15){ OpenAquarium.sendPowerStrip(on1); //Turn ON plug 1 Serial.println("RGB ON"); } if (now.hour() == 23 && now.minute() == 59){ OpenAquarium.sendPowerStrip(off1); //Turn OFF plug 1 Serial.println("RGB OFF"); } }

Here is the USB output using the Arduino IDE serial port terminal:

6.11 Full example

Upload the next code for a full example of Open Aquarium Extra accesories.

/* * OpenAquarium sensor platform for Arduino from Cooking-hacks. * * Copyright (C) Libelium Comunicaciones Distribuidas S.L. * http://www.libelium.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * a * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Version: 1.0 * Design: David Gascón * Implementation: Marcos Martinez, Luis Martin & Jorge Casanova */ #include "OpenAquarium.h" #include "Wire.h" float temperature; DateTime now; //Power strip codes unsigned long on1 = 1597145202; unsigned long off1 = 1597145204; unsigned long on2 = 1597145220; unsigned long off2 = 1597145222; unsigned long on3 = 1597145112; unsigned long off3 = 1597145114; unsigned long on4 = 1597144950; unsigned long off4 = 1597144952; unsigned long on5 = 1597144464; unsigned long off5 = 1597144466; void setup() { Serial.begin(115200); OpenAquarium.init(); } void loop() { now =OpenAquarium.getTime(); OpenAquarium.printTime(now); temperature=OpenAquarium.readtemperature(); Serial.println(temperature); OpenAquarium.lighting(now); OpenAquarium.tempcontrol(temperature); OpenAquarium.waterlevel1(); OpenAquarium.waterlevel2(); if (now.hour() == 8 && now.minute() == 30){ OpenAquarium.feedfish(); } if (now.hour() == 22 && now.minute() == 29){ OpenAquarium.readyforfeeding(); } if (now.hour() == 22 && now.minute() == 30){ OpenAquarium.feedfish(); } if (now.hour() == 12 && now.dayOfWeek()==7){ OpenAquarium.empty(); OpenAquarium.fill(); } OpenAquarium.leak(); if (now.hour() == 22 && now.minute() == 15){ OpenAquarium.sendPowerStrip(on1); //Turn ON plug 1 Serial.println("RGB ON"); } if (now.hour() == 23 && now.minute() == 59){ OpenAquarium.sendPowerStrip(off1); //Turn OFF plug 1 Serial.println("RGB OFF"); OpenAquarium.newday(); } delay(500); }

Step 1:

Before filling your aquarium, remove plastic protection from LED Strip.

Then glue RGB LED Strip at the bottom of the aquarium wall.

Take out cables and connect it to the RF Power Strip.

Step 2:

Insert rubber hose into the pump.

Step 3:

Insert first pump into your aquarium.

Step 4:

Carry rubber hose to a bucket for empty aquarium water (water changes function).

Step 5:

Repeat same process for the other pump and place it into a bucket.

Step 6:

Carry rubber hose to the aquarium for refill it with clean water.

Step 7:

Places peristaltic pumps togheter near to the bucket with clean water.

Step 8:

Carry rubber hose to the bucket with clean water to drop medicine.

Step 9:

Place water leak sensor arround the aquarium and the buckets.

Stick it straight to the table without too many loops.

Step 10:

Put the LED Lamp on the top of your aquarium.

Adapt it to the lenght of your aquarium with the extendable brackets.

Step 11:

Place the aquarium heater inside of your tank and hang the aquarium fan cooler on the edge of the wall.

Connect them to the RF Power Strip.

NOTE: If you are going to use tempcontrol(temperature) function, you have to connect fan cooler in socket 4 and aquarium heater in socket 5 of the Power Strip.

Step 12:

Finally, power OpenAquarium.