1 / 12
H.Y.F.Y.L.C.! (Hunt your food you lazy cat!) — zdjęcie 1
1 / 12

H.Y.F.Y.L.C.! (Hunt your food you lazy cat!)

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

A prototype to exploit hunting instinct of our house cats to keep them healthier, happy and also feed them.

Ocena
0 / 5
Polubienia
5
Pobrania
7
Wydruki
0
Wyświetlenia
234
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Kategoria
Pets
Licencja
Creative Commons — Attribution — Noncommercial

 

UPDATE: Gerber PCB files available! See circuit section for details.

 

--------

Shortly it's a feeding machine but instead of just fill a bowl why not throw one kibble at a time and have your pet friend have fun (and move)? I bet he will enjoy listening to the buzzing motors and waiting to catch the kibble that comes out at high speed.

This is my first attempt for a device of this kind and it's more like a proof of concept or prototype.

Mechanical, electronic and software parts are functional as I tested them.

Improvements are surely possibile maybe some other sensors should be added to manage clogging or sensing for excessive motor current demand, but first things first.

It should be a good starting point to test circuitry and firmware.

Project name

Hunt your food you lazy cat! Aka H.Y.F.Y.L.C!

Description

We can start from some basic assumptions:

  • House cats tend to be overweight and that’s bad for their health and also a shame to their ancestors. 
  • Cats that live all their lives inside a house can be bored and guess what? It’s also bad for our pets.
  • All cats sleep a lot to preserve energy but the struggle to hunt their food help feral cats to burn lots of calories.
  • Hence the idea for H.Y.F.Y.L.C! A food dispenser (for cats but not just for them) that dispenses food one bite at a time so that the diner is forced to chase each snack.

Functions

  • A motor drive a feeding wheel that load 1 (or 2) kibble at time to a launch chamber.
  • A light barrier detect the food transit.
  • A second motor charge a bat connected to a spring that hit the kibble.

Hardware and Software Used

Hardware:

  • 3D-printed case hosting the loading wheel, the bat, supports for the electronic components, motors, the food silo and so on.
  • 1 x Arduino nano board to manage buttons, the light barrier and the H-bridge motor driver.
  • 2 x 30 RPM 12 Vdc motors.
  • 1 x Dual H-bridge motor driver breakout board (2 x L9110)
  • 1 x 5mm LED (yellow).
  • 1 x photoresistor (approx 5x6 mm surface).
  • 1 x 50x70 mm hand soldered electronic board with:
  • 1 x 5.5 mm barrel connector for power supply (Vin approx. 15Vdc)
  • 1 x power switch.
  • 2 x linear voltage regulator (LM7805, LM7812)
  • 2 x headers for the Arduino board.
  • 2 x push buttons.
  • Connectors for power supply, motor wiring and light barrier wiring.
  • 2 x 330 Ω resistor
  • 1 x green 5mm LED.
  • 1 x 10 kΩ potentiometer.
  • 2 x 0,1 uF ceramic capacitor 
  • 2 x 0,47 uF ceramic capacitor 
  • 1 x 470 uF electrolytic capacitor.
  • 2 x ball bearings for rotating parts (Ø10 mm, Ø17 mm).
  • 4 x M4 nuts.
  • 4 x M4x25 bolts.
  • 4 x M1x3 bolts (to secure the motors).
  • A bunch of M2x5, M2x6 and similar screws.
  • 6 x M3x6 
  • 1 x spring (you can get it form a pen).

Software:

  • TinkerCAD have been used to draw all the printed parts.
  • PrusaSlicer ver. 2.5.2 have been used to obtain the .gcode files.
  • Arduino IDE have been used to firmware implementation.
  • Fritzing have been used to draw the schematics.
  • EasyEDA  have been used to draw all the PCB files.

Wiring Diagram

Electrical circuit description:

  • The prototype circuit has been hand soldered on a 50x70mm prototyping board.
  • There is a 5,5 mm barrel power plug and a switch on the positive line.
  • Power pass through two linear voltage regulators LM7812 and LM7805 to stabilize the unregulated input DC voltage (about 15Vdc) and provide a stable voltage for the uC and motors.
  • Motors are controlled via a dual H-bridge breakout board which is just sketched on the schematics. A 470 uF electrolytic capacitor (C9 in the schematics) is mandatory in order to avoid continuous reset of the microcontroller.
  • There are two buttons with 10k pull-down resistor each (require SW debounce).
  • The light barrier use a 5mm yellow LED continuosly powered up by the +5V and a 330Ω resistor to GND.
  • The light barrier also need a voltage divider that use a photoresistor and a potentiometer (10kΩ) connected to an analog input on the Arduino.
  • A status LED is connected to a digital pin and a 330Ω resistor.
  • Four digital output pin are required to control motors activation.


New PCBs files now available! I made a SMD and a THT version. THT .gerber, BOM and schematics files are now available. If you want the SMD .gerber files before my check just ask me. PCBs will be more flexible since there will be auxiliary connections such as I2C, some extra GPIO and analog inputs so you can make your own mods.

THT board is simpler to mount if you are not confident with SMD soldering. This board have auxiliary connections to +5V and +12V, power supplies, I2C pins and 4 GPIO. On I2C bus it is possible to mount 2 pull-up resistor and decoupling cap. On the 4 auxiliary GPIO you can connect a pull-up or pull-down resistor.

SMD board can handle either an LM317 (SOT223) chip or a LMxx (TO220) on the first power stage, so you can choose for variable or a fixed voltage regulator. The second stage is compatible with LM2940 (SOT223) or LM78xx (TO220). Similarly to the THT version there are auxiliary pins to I2C, 4 GPIO and 2 ANALOG inputs.

Since the Arduino nano 33 IOT is almost pin compatible with the nano you can develop WiFi o BT connections to the device. WARNING if you use the Arduino nano 33 IOT make sure to use a 3.3V voltage regulator!!!. +3.3 V should be enough to drive the motor board. Consider lower the led resistors value.

Code

A state-machine sketch has been implemented for the project. A MyTimer class is used to instantiate the objects that manage the timing of different elements such as motors, status LED and button de-bouncing.

You can find the code on GitHub repository URL: https://github.com/EGDO-maker/HYFYLC

Each states and a description of the activities they manage are listed below.

STATE 0: IDLE

  • Waits for the buttons to be pressed.
    • Button 1: Starts the main cycle.
    • Buttons 1 and 2 pressed for more than 2 seconds: enter calibration state 4.

STATE 1: RUN

  • Starts the food loading motors for the time defined by loadingTime.
  • Reverses rotation at the end of each loading interval to avoid obstructions by calling state 2.
  • Reads the button presses:
    • Button 1: Stops loading and returns to state 0
    • Button 2: Goes to state 2 to remove the obstructions.
  • Reads the photo barrier and detect the food passage then stops the food loading motor then goes to state 3.

STATE 2: UNCLOG

  • reverse the food loading motor in order to prevent loading wheel to get stuck and damage motor coils.

STATE 3: LAUNCH

  • Activates the motor that load the bat spring for a time defined by springChargeTime.
  • Waits 500 ms before returning to state 1.

STATE 4: CALIBRATION

  • Reads the analog input connected to the photo barrier and activates the status LED in a fixed manner if the value read is close to the value defined by lightBaseline with a tolerance defined by baselineTolerance.
  • Reads the button presses:
    • Button 2: exits calibration and returns to state 0.


FUNCTIONS

Here the descriptions of the functions used on the sketch.

go(s): sets the global state variable to the value s. It also initializes the global variable first to run some code only time.

LedSet(A, B): manages the switching on of the status LED by evaluating the values A and B.

  • If A and B are null, the LED is permanently switched off.
  • If A and B are both equal to 1, the LED is continuously switched on.
  • In other cases, A is set as the number of ms in which the LED is switched off and B is the ms in which the LED is switched on.

MotorCmd(n, A, B, T): manages the switching on of the motors.

  • n: identifies the motor to act on, if 0 it is the motor for loading the spring and 1 for the motor for loading the food.
  • A and B: if both 0 or one, they deactivate the motor. If they are different, they activate the motor in one direction or the other depending on which of the two values is 1.
  • T: indicates the time in ms in which the motor remains active.

LightTest(): Runs only on setup to measure the signal strength of the photo barrier by averaging 100 readings.

Additional notes: 

motors have some inertia after they are deactivated. Reversing the rotation during the stop phase resets the micro-controller so 500 ms delays have been inserted to avoid the reset.

In many parts of the code, serial prints have been inserted to help with debugging.

 

Printing Instructions

All the printings were performed with a PRUSA i3 MK3 as shown in the following table. All pieces are printed with PLA filament except for the bat used to kick the kibble which is in flexible TPU.

All pieces were printed as shown in the pictures below.

MAIN CHAMBER

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note:


EXTERNAL SHELL

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note: the external shell have been printed upside down with respect final mounting and usage.

FOOD BOWL

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: from build plate only

Note:


LOADING WHEEL

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note:


LOADING WHEEL HOUSING

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note:

MOTOR WHEEL

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note:

BAT MOTOR HOLDER

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note:

BAT MOTOR GEAR

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note:

BAT GEAR

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: from build plate only

Note:

SOFT BAT

Filament: TPU

Layer height: 0,3 mm

Infill: 20%

Supports: from build plate only

Note:

FUNNEL

Filament: PLA
Layer height: 0,3 mm
Infill: 30%
Supports: from build plate only

Note:

PIPELINE

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: from build plate only

Note: support are disabled inside the pipe.

BOARD LID

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note:

FOOD LID

Filament: PLA

Layer height: 0,3 mm

Infill: 30%

Supports: no

Note: the food lid have been printed upside down with respect final mounting and usage.

 

Assembly Instructions

Assembly of mechanical and electric parts.

  • Insert the 16 mm ball bearing into the loading wheel
  • Mount the loading food motor (already equipped with cables) on the loading wheel housing and securing it with 2 M1x3 mm screws.
  • Insert the loading wheel on the central pin of the wheel housing. On the back of the pin, clamp the M2x5 screw to fix the wheel.
  • Insert the 5 mm LED and the photo resistor (already equipped with cables) in the main chamber as in above picture.
  • Place the 4 M4 nuts into the hexagonal slots on the main chamber.
  • Insert the female barrel connector into the appropriate hole and secure it with the lock nut. Solder the power cables to the input connector. Cables must already be equipped with a switch on the positive pole (and possibly with a connector).
  • Insert the break out board with the double H-bridge onto the appropriate supports and secure it with 4 M2x3 screws as shown in the figure.
  • Insert the four M4x25 screws into the holes of the food cup and the block with the loading wheel and screw them onto the nuts inserted in the main chamber as shown in the figure.
  • Apply a pair of heat-shrink tubing to the small loading wheel and insert it into the pin of the food loading motor.
  • Insert the 10 mm ball bearing into the gear of the bat.
  • Assemble the soft TPU bat and hook the spring into the appropriate hole on the side.
  • Bend a 2 mm diameter and 25 mm length iron pin as shown in the figure.
  • Insert the free end of the spring between pin holder and secure it with the pin itself.
  • Insert the bat into the pin on the main chamber’s bottom and secure it with an M2x3 screw on the bottom of the main chamber.
  • Insert the motor gear into the motor shaft. Mount the motor block by inserting it onto the gear of the bat and secure it with four M2x6 screws.
  • Check that the spring recalls the bat and that there is no excessive friction with the bottom.
  • Mount the funnel above the launch chamber and secure it with a pair of M2x5 screws on the prepared holes.
  • Apply the loading pipeline to the ring where the light barrier is located.
  • Connect the motor cables to the two outputs of the H-bridge.
  • Attach the break out board connector to the cables that will go on the main board.
  • Fix the electronic board on the appropriate supports and fix it with four M2x6 screws.
  • Insert the external shell on the device assembled so far and fix it with the six M3x6 screws.
  • Insert the switch into the appropriate hole on the board cap and fix it with two M2x4 screws.
  • Insert the signal LED into the connector and insert it into the hole on the board cap.
  • Close the board cap and fix it with three M2x6 screws.
  • Insert the cap for the kibble loading compartment.

Demo and Usage Instructions

  • Plug an external 15 Vdc power supply with a 5,5 mm barrel connector to the device. WARNING!!! Double check the polarity of the connector since there is no polarity safety device on the board!!!
  • For the first power up the board cap should not be mounted since a calibration may be required.
  • Power up the device and wait until the status LED blinking. 
  • Press buttons 1 and 2 and wait until the status LED is solid, then release the buttons.
  • The status LED could starts blinking. In this case slowly rotate the potentiometer on the board (R2) with a screwdriver halting every few degrees until the LED remain steady on.
  • Press button 2 to exit calibration.
  • Reset the Arduino board.
  • Fill the food bowl (non too much). 
  • Press button 1 a make sure your pet is in the vicinity.


Additional Notes or Tips

  • For the electronic wiring I recommend using connectors to connect the control board to the sensors, control signals and power supplies. 
  • The level of the kibble in the food chamber should not exceed half the height of the loading wheel.

 

Photos and Videos

See assembly instructions for photos.

Tagi