Automatic Fish Feeder Using Arduino Nano
by MrSottong in Circuits > Arduino
4668 Views, 23 Favorites, 0 Comments
Automatic Fish Feeder Using Arduino Nano
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
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
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
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
servo motor needs to be modified so that it can rotate more than 360 degrees.
Here's how to modify it:
- Set the servo motor to the 90 degree position.
- Disassemble the servo
- then cut the servo motor position sensor axle
- reassemble the servo motor case
Modification result:
- If the servo is set < 90 degrees, the servo will rotate to the right.
- If the servo is set = 90 degrees, the servo will be silent because the position sensor is always at 90 degrees.
- If the servo is set >90 degrees, the servo will rotate to the left.
- When turning right or left, servo rotation can be more than 360 degrees
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: 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:
- Attach the servo to the housing through the hole in the front of the housing
- Attach the gear to the servo using glue
- because the feed outlet hole is too big, I partially closed the hole
Programming
There are two stages of programming that must be done:
- Set the RTC time according to the current time
- 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
After all the materials are ready, it is time for the assembly process. Here's the assembly process:
- Attach the fish feed mechanic to the edge of the aquarium, I used a wedge so that it can be firmly attached
- Fill fish feed as needed
- Connect the servo motor to the Arduino module in the following order: Brown = ground, red = 5V, Yellow = data (see picture)
- connect arduino with power supply
with this automatic fish feed is complete.