Automated Aquarium Control (IoT)

by ekaran6630 in Workshop > Home Improvement

1832 Views, 9 Favorites, 0 Comments

Automated Aquarium Control (IoT)

IMG_0622.jpg

Most people like having an aquarium for joy. Looking at the fish swimming across the aquarium is a pleasing experience that could help clam your mind or reduce the stress. But maintaining the aquarium is a tedious task sometimes. If we could automate some of the trivial tasks like feeding fish and switching lights, it would a great help for your busy life.

The system that I made is pretty simple and consists of 3 main components

  1. Feeding Mechanism
  2. Micro-controller and electronics
  3. Software and cloud service integration

Creating the Feeding Mechanism

IMG_0586.jpg

While I searching for a model, I found this great 3d model on the Thingiverse

It is using an Archimedes screw to push the food out of the nozzle and could store the food using a commonly used pet bottle.

I used 3D printer to print this. It requires a geared DC motor to operate. (Model DC geared N20 mini motor)

Micro-Controller and Electronic Components

Fishfeeder Sketch_bb.jpg
IMG_0621.jpg

I used NodeMCU (which consists of ESP8266 Chip) as the controller because it can be easily programmed with the Arduino IDE and contains build-in wifi access. (Also super cheap :D). For controlling the DC motor I used the LD293D IC. Also for the lights, I used a simple 5v relay module.

Programming and Cloud Integration Service - Sign Up for Remoteme

remoteme_signup.png

For controlling the IoT device, I found this RemoteMe.org as a convenient and free service that can be used for any type of IoT related project. First, you have to sign up

Programming and Cloud Integration Service - Defining the Variables

create_variable.png
create_boolean.png

Most IoT devices use a cloud-based variable to maintaining the status of some activity. Here we need 2 variables to control.

  1. "Relay_1" - for lighting (Boolean variable for keep on/off status)
  2. "Fish_Feeder" - Fish feeder motor (Numeric variable for keeping the timing for the motor in seconds)

We can create those from click on the "Variables" tab and click on the "Add" button.

Programming and Cloud Integration Service - Add Network Device

new_device_add.png
new_device.png

Here we can add the device that we are going to control via this platform.

You need to select Arduino as the "type" and you can enter any name for the "name" field.

It will automatically provide the deviceId.

Click on the submit button after completing the form.

Programming and Cloud Integration Service - Template Code Generation for NodeMCU

open_wizard.png
wizard_2.png
wizard_1.png
wizard_3.png
wizard_4.png

After creating the device you can generate the template for the Microcontroller with this wizard.

You need to fill the body of some methods in order to work accordingly.

Please refer this GitHub repo

NodeMCU needs to be flashed with this code.

Programming and Cloud Integration Service - Creating the Webhooks

set_link (1).png
set_link2 (1).png

In order to set the variables that were defined earlier remote-me site facilitates creating webhooks for each variable. You can set those webhooks by clicking the hamburger icon on the right-hand top corner in the variables section for each variable.

Programming and Cloud Integration Service - IFTTT and Siri / Google Assistant Integration

IFTTT.png
unnamed.jpg

Using the previously created webhooks we can send HTTP post messages.

I created 2 ways to control the aquarium.

  1. Schedule the Lighting and Feed Feeder using the IFTTT time feature.
  2. Create and IOS shortcut to add voice commands to control using new Shortcuts app