Introduction: Automatic Dispenser for Feeding Fish Twice a Day, With a Push Button to Dispense the Food on Demand

About: I am an Engineer,Designer, Maker ..

Automatic programmable fish feeder that would be very useful to me.

I have a fish food box that has a button on the side and a pusher/rack-pinion mechanism will push the button and release some food for my fish.

I designed an assembly that would convert the rotational motion of a motor into translational motion , a gear and pusher/rack-pinion. I created an assembly like this in tinkercad, and the food box is positioned next to the pusher (rack), therefore the button of the fish food box could be pushed very easy.

A gear and pusher system, also known as a rack-and-pinion mechanism, is a simple type of linear actuator that converts rotational motion into linear motion. It consists of two main components: a gear (pinion) and a linear rack.

The pinion is a round gear that rotates about an axis, and the rack is a linear toothed bar that is perpendicular to the axis of rotation of the pinion. When the pinion rotates, it engages with the teeth of the rack, causing the rack to move in a linear direction. The linear motion of the rack can be used to control the movement of a load, such as a machine component or a control surface on an aircraft.

A gear and pusher mechanism is commonly used in steering systems for vehicles, as well as in industrial and hydraulic applications where linear motion is required.

Supplies

Step 1: 3D Print the Housing and the Mechanism

Here are the general steps to 3D print the housing for this project:

  1. Design the housing: Use a 3D modeling software such as Fusion 360, Tinkercad, or FreeCAD to design the housing that fits your electronic project. Consider factors such as the size and shape of your components, the need for ventilation or access to buttons or ports, and the desired aesthetic.
  2. Prepare the 3D model for printing: Export the 3D model in a file format that your 3D printer software can read, such as STL or OBJ. You may also need to check and adjust the orientation and scale of the model, add supports if necessary, and slice the model into layers that the printer can understand.
  3. Choose the printing material: Select a material that fits the requirements of your project, such as strength, flexibility, temperature resistance, and color. Popular materials for 3D printing housings include ABS, PLA, PETG, and Nylon. For my project I used PLA
  4. Load the 3D model and material into your 3D printer: Connect your 3D printer to your computer and use the 3D printer software to load the sliced model and select the material.
  5. Start the print: Check the printer settings, such as the layer height, print speed, and temperature, and then start the print. Depending on the size and complexity of the housing, the print may take several hours to complete.
  6. Finish the print: Once the print is complete, remove the housing from the printer bed and remove any support structures if necessary. Sand or polish the surface if needed, and drill or cut any holes or openings that are required.
  7. Assemble the electronic components: Place the components into the housing and secure them with screws or other fasteners. Connect the wiring and test the assembled project.


Step 2: Connect the ArduinoNano to Servo Motor, RTC Module and Pushbutton

Here's a step-by-step guide on how to connect an Arduino Nano, a servo motor, a real-time clock (RTC) module, and a pushbutton:

  1. Gather the components: You will need an Arduino Nano, a servo motor, a real-time clock (RTC) module, a pushbutton, some jumper wires, and a breadboard.
  2. Connect the servo motor: Connect the power and ground wires of the servo motor to the 5V and GND pins on the Arduino Nano. Connect the control wire of the servo motor to a digital pin on the Arduino Nano, such as pin D3.
  3. Connect the RTC module: Connect the power and ground pins of the RTC module to the 5V and GND pins on the Arduino Nano. Connect the SDA and SCL pins of the RTC module to the A4 and A5 pins on the Arduino Nano, respectively.
  4. Connect the pushbutton: Connect one side of the pushbutton to the GND pin on the Arduino Nano and the other side to a digital pin, such as pin D13. Add a 10kohm resistor between the digital pin and the 5V pin on the Arduino Nano to act as a pull-up resistor.
  5. Upload the code: Use the PlatformIO to write and upload a code to the Arduino Nano (See step 4). The code should include libraries for the servo motor and RTC module, and it should use the digital pin connected to the pushbutton as an input to control the servo motor.
  6. Test the connection: Once the code is uploaded, press the pushbutton to see if the servo motor moves. You can also check if the RTC module is working by logging the current time to the serial monitor.

Step 3: Assembly Everything in the 3d Printed Housing

Here's a general guide on how to do it:

  1. Gather the components: Make sure you have all the components of the rack-and-pinion mechanism, including the rack, the pinion, and any bearings, bushings, or fasteners that may be required.
  2. Clean the components: Clean the components thoroughly to remove any dirt, grease, plastic, or debris that may interfere with the assembly.
  3. Assemble the rack and pinion: Place the rack and the pinion in their approximate positions and align the teeth of the pinion with the teeth of the rack.
  4. Fasten the components: Use screws, bolts, or other fasteners to securely fasten the rack and pinion together. If necessary, use locking nuts or locking washers to ensure that the fasteners stay tight.
  5. Test the assembly: Once the components are fastened, rotate the pinion and observe the motion of the rack. Check for smoothness, proper alignment, and the absence of any binding or rubbing.
  6. Install the mechanism: If the mechanism is to be installed in a larger system, such as a steering system or a linear actuator, place it in its proper position and secure it with any necessary fasteners or brackets.


Step 4: PlatformIO - Configure, Build and Load the Software

To create a new project in PlatformIO, follow these steps:

  1. Open PlatformIO Home: You can do this by running the platformio command in the terminal or through the PlatformIO IDE extension.
  2. Select the "Projects" option and then click on the "New Project" button.
  3. Choose a project template or manually select the board and framework. You can select the board and framework according to the device you want to develop for.
  4. Select a folder location to create the project and then give a project name.
  5. Wait for PlatformIO to create the project files and configure it.
  6. After the project is created, you can start developing your code by adding your source files in the src directory.
  7. To build the project, run the platformio run command in the terminal or press the "Build" button in the IDE.

According to software implementation, the food dispenser will be triggered twice a day, once in the morning and once in the evening, but you could change the implementation as you wish (see the source code attached ).

To be standalone, the food dispenser should be connected to a AC/DC 5V micro USB adapter 1A (see in the components list).

More details on my blog , but select the translation language from right menu of the website : https://automatic-house.blogspot.com/2022/05/dozator-automat-pentru-hranit-pestii-3.html


Thank you for your attention!

Attachments