Automatic Fish Feeder Using Arduino Nano

by MrSottong in Circuits > Arduino

4668 Views, 23 Favorites, 0 Comments

Automatic Fish Feeder Using Arduino Nano

Snapshot_2022-04-16-09.57.03.png

In this article I will make an automatic feeding device for fish in an aquarium. This tool uses arduino nano as the main controller to drive the servo in the feeding process.

I will use this tool in an aquarium that I just bought a few days ago. I worry if I forget to feed the fish when I go out for activities. so I hope with this tool the fish can eat regularly.

Not only can it be an automatic fish feeder, this tool can also be used to turn on aquarium lights, turn on water filters, monitor aquarium temperatures and so on. but for these features I will discuss in a future article.

Component and Material

Snapshot 2021-11-09 21.10.50.png
Snapshot 2021-11-09 21.10.55.png
Snapshot 2021-11-21 19.16.31.png
Snapshot 2021-11-21 19.17.15.png
Snapshot 2021-11-21 19.17.18.png
IMG_9996.JPG

Modul :

  • 1*Arduino Nano
  • 1*RTC DS 3017
  • 1*Step down DC to DC LM2596

THT :

  • 1*470u/10V
  • 1*DC Jack
  • 3*Tacth Switch
  • 1*Buzzer
  • 1*5V Relay
  • 4*3mm LED
  • 1*2P T-Block
  • 1*3P T-Block
  • 1*Switch
  • 1*Diode 4007
  • 1*Diode 4148
  • Male Header
  • Female Header

SMD

  • 2*C 22u
  • 4*C 100n
  • 2*T BC847
  • 2*R 100R
  • 2*R 1K
  • 10*R 10K
  • 1*R 220R
  • 1*IC 1117 3v3

Skema Dan Layout

Snapshot_2022-04-16-10.14.44.png
Screen Shot 2022-04-16 at 10.15.41.png
Screen Shot 2022-04-16 at 10.19.46.png

above I have provided a schematic drawing and layout of this automatic fish feed PCB.

To make a nice and neat module. I decided to use PCBway's services to print the PCB. why did I choose PCBway, because By making PCB on PCBway you can get High Quality 10 PCs PCBs for only $ 5 & new member First order Free: www.pcbway.com

For PCB fabrication required gerber file of PCB design. The gerber file can also be downloaded below: coming soon

Insert Components Into PCB

Snapshot_2022-04-15-21.48.23.png
Snapshot_2022-04-15-21.49.01.png
Snapshot_2022-04-15-21.49.39.png
Snapshot_2022-04-15-21.49.43.png
Snapshot_2022-04-15-21.52.19.png

insert the components one by one into the PCB according to the diagram on the schematic.

to make the process easier, install the SMD components first. after that just install the THT components starting from the shortest. Finally, attach the Arduino, RTC and DC to DC modules to the PCB.

Modif Servo

Snapshot_2022-04-15-22.05.24.png
Snapshot_2022-04-15-22.06.09.png
Snapshot_2022-04-15-22.06.01.png
Snapshot_2022-04-15-22.05.50.png

servo motor needs to be modified so that it can rotate more than 360 degrees.

Here's how to modify it:

  1. Set the servo motor to the 90 degree position.
  2. Disassemble the servo
  3. then cut the servo motor position sensor axle
  4. reassemble the servo motor case

Modification result:

  1. If the servo is set < 90 degrees, the servo will rotate to the right.
  2. If the servo is set = 90 degrees, the servo will be silent because the position sensor is always at 90 degrees.
  3. If the servo is set >90 degrees, the servo will rotate to the left.
  4. When turning right or left, servo rotation can be more than 360 degrees

Attach the Servo Motor to the Fish Feed Mechanic

Snapshot_2022-04-15-22.17.59.png
Snapshot_2022-04-15-22.18.05.png
Snapshot_2022-04-15-22.18.10.png
Snapshot_2022-04-15-22.18.17.png
Snapshot_2022-04-15-22.18.28.png

This fish feed mechanic was made by Susilo Harjo. You can download the 3D file here: https://www.thingiverse.com/thing:2921447

Fish feed mechanics consist of two parts. Part of the feed container and gear for removing feed.

Here's how to install it:

  1. Attach the servo to the housing through the hole in the front of the housing
  2. Attach the gear to the servo using glue
  3. because the feed outlet hole is too big, I partially closed the hole

Programming

Snapshot_2022-04-15-22.38.23.png
Snapshot_2022-04-15-22.38.28.png
Snapshot_2022-04-15-22.38.36.png
Snapshot_2022-04-15-22.38.59.png

There are two stages of programming that must be done:

  1. Set the RTC time according to the current time
  2. Programming Arduino with automatic fish feed program

Programm the RTC time according to the current time:

  • see the function in the setup section, in this section you can set the time on the rtc starting from the day, date, and time:
rtc.setDOW(THURSDAY);       // Set Day-of-Week to ..
rtc.setTime(19, 59, 00);    // Set the time to ..
rtc.setDate(4, 14, 2022);   // Set the date to ..
  • Upload program to Arduino
  • check the serial monitor to make sure the time has been set successfully

Programming Arduino with automatic fish feed program:

  • Still using the same program, but the function to set the time is made a comment so that it is not read by the program.

//rtc.setDOW(THURSDAY);       // Set Day-of-Week to ..
//rtc.setTime(19, 59, 00);    // Set the time to ..
//rtc.setDate(4, 14, 2022);   // Set the date to ..
  • Set the feeding time by changing the following variables:

//morning feed time
int JamPakanPagi = 6;
int MenitPakanPagi = 0;
int DetikPakanPagi = 0;


//afternoon feed time<br>
int JamPakanSiang = 12;
int MenitPakanSiang = 0;
int DetikPakanSiang = 0;


//evening feeding time
int JamPakanSore = 19;
int MenitPakanSore = 0;
int DetikPakanSore = 0;
  • Adjust the amount of feed given. Amount of fish feed given = servo ignition time
void Beri_pakan()
{
  buzz();
  delay(500);
  buzz();
  delay(700);
  buzz();
  myservo.write(80);
  //delay to adjust the amount of feed given
  delay(400);       
  myservo.write(90);
  buzz();
  delay(500);
  buzz();
}
  • Upload program to arduinio

Assembly

Snapshot_2022-04-16-09.51.17.png
Snapshot_2022-04-16-09.57.03.png
Snapshot_2022-04-16-09.57.57.png
Snapshot_2022-04-16-09.57.12.png

After all the materials are ready, it is time for the assembly process. Here's the assembly process:

  1. Attach the fish feed mechanic to the edge of the aquarium, I used a wedge so that it can be firmly attached
  2. Fill fish feed as needed
  3. Connect the servo motor to the Arduino module in the following order: Brown = ground, red = 5V, Yellow = data (see picture)
  4. connect arduino with power supply

with this automatic fish feed is complete.

Results

Pakan ikan otomatis
Snapshot_2022-04-16-10.24.14.png
Snapshot_2022-04-16-10.24.25.png
Snapshot_2022-04-16-10.24.28.png