Introduction: Automatic Fish Feeder Using Arduino Nano

About: someone who likes electronics

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.

Step 1: Component and Material

Modul :

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


  • 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


  • 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

Step 2: Skema Dan Layout

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:

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

Step 3: Insert Components Into PCB

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.

Step 4: Modif Servo

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

Step 5: Attach the Servo Motor to the Fish Feed Mechanic

This fish feed mechanic was made by Susilo Harjo. You can download the 3D file here:

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

Step 6: Programming

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()
  //delay to adjust the amount of feed given
  • Upload program to arduinio

Step 7: Assembly

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.

Step 8: Results