Close
0%
0%

Automatic Fish tank Feeder

ESP32 control fish feeder mechanism.
using HTML file to send the control numbers to the ESP32 through MQTT broker.

Similar projects worth following

this project use ESP32 controlling stepper motor. The motor drive fish feeder mechanism.

to determine the number of motor turns/time  and number of repeated /day.

the ESP32 is connected to the local WiFi. It will subscribe to MQTT broker and will receive 

a command from the broker. the Command will have the number of turns/time and number of repeats /day.

the commands will be send from HTML(WebPage) file to the MQTT broker using the internet.

the webpage will receive the motor status ( Running , Stop). and also a time stamp for when the motor stoped and the next run time from the ESP32 and display the information in the WebPage.

the ESP32 also connected to a LCD display. The LCD will display the same information that displayed on the WebPage.

the following is the steps to use this project

I- follow the instruction in the build instructions.

II- add the fish food in the funnel 

III- prepare the ESP32 

  1- download the FishTankHackDay_copy.ino

  2- before you upload the file you have to change the following with your

            information 

      A- your  WiFi ( line 26)

      B- your Password (Line 27)  

      C- your MQTT broker (line 28)

      D- your TOPIC_COMMAND (line 31) 

           use the same name in the HTML file 

           “client.publish(“TOPIC_COMMAND”,payload;

  4- upload file to your ESP32 

  5- in first you may not connected. the status in the LCD will display “starting”

  6- push the reset switch (see No 3 in the electronicsholder2.jpg )

  7- the status in the LCD will display “WiFi connected” then will display “waiting”

  8- now the ESP32 ready to receive command fro the WebPage (HTML file)

IV- prepare the HTML file 

   1- download the FishTankHackdayHTML.txt

   2- change the TOPIC_COMMAND to be the same as the sketch for the ESP32

   3- change the file to HTML format 

   4- open the file in any browser .

   5- inter the number of turns and the number of repeats/ day and click send 

   6- the command will go to the ESP32 and it will turn the motor on and send the              feed back to  the webpage and display the information in the LCD.

        Please notice if the motor run in reverse you have to commented the following          in the sketch 

const int stepSequence[4][4] = {

  {1, 0, 0, 1},

  {0, 1, 0, 1},

  {0, 1, 1, 0},

  {1, 0, 1, 0}

};

and use this 

const int stepSequence[4][4] = {

  {1, 0, 1, 0},

  {0, 1, 1, 0},

  {0, 1, 0, 1},

  {1, 0, 0, 1}

};

           

 

Demo.MOV

Demo video

quicktime - 18.00 MB - 06/09/2025 at 16:54

Download

ScrewBase .stl

No 9 in cross section feeding mechanism photo

Standard Tesselated Geometry - 19.65 MB - 06/09/2025 at 04:59

Download

funnel.stl

No 5 in cross section feeding mechanism photo

Standard Tesselated Geometry - 168.83 kB - 06/09/2025 at 03:51

Download

ConnectTube.stl

No 1 in cross section feeding mechanism photo

Standard Tesselated Geometry - 2.87 MB - 06/09/2025 at 03:29

Download

BracketNut.stl

No8 in cross section feeding mechanism photo

Standard Tesselated Geometry - 9.76 MB - 06/09/2025 at 03:29

Download

View all 18 files

  • 1 × ESP32
  • 1 × LCD display (240X360) use ST7798 drive
  • 1 × L298 board drive board for stepper motor controlled by ESP32
  • 1 × NEMA 17 stepper motor
  • 1 × 3D printed mechanism it has 1- funnel for the dry fish food, 2- rotating helical drive to move the food from the food funnel to the fish tank , 3- motor holding parts, 4- mounting bracket to hold the mechanism to the fish tank , 5- electronic box carrying the electronics component (ESP32 , LCD, L298 board)

View all 6 components

  • 1
    Step 1

    Electric build instruction 

    refers to electronics holder photo and wiring diagram. 

    1- solder wires to the ESP32 pins as in wiring photo make sure the wires are long           enough to  reach the LCD and the L298 board. 

    2- Solder the wire to the LCD board.

    3- secure the ESP32(No 1)to the electronics holder with 4 screws. 

    4- make sure the wire to the L298 (No 5)board go through wire tunnel (No 4).

    5- secure the LCD (No 2)in its position in the electronics holder with 4 screws 

    6- solder the wire from the ESP32 to the L298 board. make sure the wires paths              throw the wire tunnel (No 4).

    7- insert the motor wires and power supply wires through the hole (No 9).

    8- connect the motor wires to connector No7 and connector No8 and power wires to   

        connector (No 6).

    9- secure the L298 board in the electronics holder with 4 screws.

    10- I used 2 5V DC power supply one for the L298 and the other one for the LCD and ESP32.

  • 2
    Step 2

    Mechanical build instruction 

    refers to the Cross section of feeding mechanism photo. 

    all the needed STL files for 3D printing are uploaded.  

    1-insert one of the bearing(No 4) in the motor base (No 3)

    2- insert the rotating helical shaft (No 2)in the same bearing 

    3- insert the other end of the rotating helical shaft (No 2)in the other bearing (No 4)

    4- insert the bearing (No 4) in the connecting tube (No 1) align the screw holes of               the  connecting tube (No 1)with the screw holes in the motor base (No 4).

         use 4 screws and 4 nuts to fasten the 2 parts as in the photo.

    5- slide the motor shaft extension ( No 6) to the rotating helical shaft (No 2)

    6- connect the motor shaft extension (No 6) to the stepper motor. use 4 screws and         nuts to fasten the motor to the motor base.

    7- slide the base bracket (No 7) in the dove tail slot in the motor base (No 3)

    8- screw the mounting screw (No 9) to the side bracket (No 8).

    9- slide the side bracket (No 8) in the dove tail slot in the base bracket (No 7).  

    10- slide the food funnel (No 5) in the connecting tube (No 1).   

    11- slide the electronic holder in the electronics grove (No 11).  

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates