Arduino Automatic Milk feeder

Arduino Automatic Milk feeder © Apache-2.0

This project is an automatic milk feeder for when it's finally born.

  • 1 respect

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
09590 01
LED (generic)
IR Sensor Box
Relay (generic)
Thermocol Box
12V water pump

About this project

When puppies are born they are wrapped in a clear sac called the amniotic membrane. This membrane must be removed from the puppy’s face in order for it to breathe. Once it is cleared it will start crawling towards its mother.

About first milk:

Colostrum is the milk that the mother produces the first days after birth. It is very thick, yellowish-cream in color, and rich in antibodies that protect the puppy against disease. Puppies that do not drink colostrum during their first 12 - 14 hours of life can not fight the diseases and bacteria they encounter as well as pups that do.

How much milk should I feed it?

That is a very difficult question to answer because puppies arrive in so many sizes. Experienced breeders generally decide when to stop feeding based on the shape of the puppies stomach and its greediness to continue feeding rather than by giving a set amount of formula.

But I can give you some ideas: when the powdered formula I suggested is mixed according to directions (one part formula powder to two parts water); each day the average puppy needs 25 - 35 milliliters of formula for every 100 grams (about 3.5 ounces) of body weight. Divide this number by the number of feedings per day to obtain the amount for each feeding. During week two, give 15 -20 ml for every 100 grams body weight. During weeks three and four give 20 ml for every 100 grams body weight. These amounts are always only a rough estimate. Feed the puppy until its belly is gently rounded or pear-shaped - never more. As long as it is slowly but steadily gaining weight, everything is fine.

How often should I feed?

Feed very young puppies every 2-3 hours or six to eight feedings a day. Some people get up to give their puppy a midnight feeding but this is not necessary if you have a vigorous, healthy pup.

Step 1: Video of switching pump

I have used customized Arduino in this video, but no worries. The code works as well for Arduino Uno. Thank you!And please comment so that I can correct my mistakes in the next project!

Step 2: About milk feeder

If you are a puppy/kitty owner, going on vacation can be stressful. Usually, you need a friend or neighbor to come over everyday and feed your pets. However, by utilizing robots you can keep your pet happy and enjoy a stress-free holiday. Today, we make an automatic milk feeder from:

  • Thermocol Box
  • 12V water pump
  • Relay board
  • IR sensor box
  • LED
  • Arduino

Step 3: Things needed

1) Arduino Uno

Arduino is an open-source computer hardware and software company, as well as a project and user community that designs and manufactures microcontroller-based kits for building digital devices and interactive objects that can sense and control objects in the physical world. The project is based on microcontroller board designs, manufactured by several vendors, using various microcontrollers. These systems provide sets of digital and analog I/O pins that can be interfaced to various expansion boards ("shields") and other circuits.

The boards feature serial communications interfaces, including USB on some models, for loading programs from personal computers. For programming the microcontrollers, the Arduino project provides an integrated development environment (IDE) based on the Processing project, which includes support for the C and C++ programming languages. It controls the whole process: gives signal to the water pump and milk pump to switch on and switch off.

2) 12v Submergible pump

This is used to pump water and milk to lift it from water and milk compartment. A submersible pump (or sub pump, electric submersible pump (ESP)) is a device which has a hermetically sealed motor close-coupled to the pump body. The whole assembly is submerged in the fluid to be pumped. The main advantage of this type of pump is that it prevents pump cavitations, a problem associated with a high elevation difference between pump and the fluid surface. Small DC Submersible water pumps push fluid to the surface as opposed to jet pumps having to pull fluids. Submersibles are more efficient than jet pumps.

Working principle: The submersible pumps used in ESP installations are multistage centrifugal pumps operating in a vertical position. Although their constructional and operational features underwent a continuous evolution over the years, their basic operational principle remained the same. Produced liquids, after being subjected to great centrifugal forces caused by the high rotational speed of the impeller, lose their kinetic energy in the diffuser where a conversion of kinetic to pressure energy takes place. This is the main operational mechanism of radial and mixed flow pumps. The pump shaft is connected to the gas separator or the protector by a mechanical coupling at the bottom of the pump. Well fluids enter the pump through an intake screen and are lifted by the pump stages. Other parts include the radial bearings (bushings) distributed along the length of the shaft providing radial support to the pump shaft turning at high rotational speeds.

3) IR sensor

An infrared sensor is an electronic instrument which is used to sense certain characteristics of its surroundings by either emitting and/or detecting infrared radiation. Infrared sensors are also capable of measuring the heat being emitted by an object and detecting motion. This is used to switch the water pump when thirsty puppy comes in front of the Automatic Milk feeder.

4) 5V Relay board

This is a 5V, 10A 4-Channel Relay interface board. It can be used to control various appliances, and other equipment with large current. It can be controlled directly with 3.3V or 5V logic signals from a microcontroller (Arduino, 8051, AVR, PIC, DSP, ARM, MSP430, TTL logic). It has a 1x4 (2.54mm pitch) pin header for connecting power (5V and 0V), and for controlling the 4 relays. The pins are marked on the PCB:

  • GND - Connect 0V to this pin.
  • IN1 - Controls relay 1, active Low! Relay will turn on when this input goes below about 2.0V
  • IN2 - Controls relay 2, active Low! Relay will turn on when this input goes below about 2.0V
  • IN3- Controls relay 3, active Low! Relay will turn on when this input goes below about 2.0V
  • IN4 - Controls relay 4, active Low! Relay will turn on when this input goes below about 2.0V
  • VCC - Connect 5V to this pin. Is used to power the opto-couplers. This relay driver is used to switch on and switch off the pumps

5) LED #1 and 1k Resistor

It is just an indication of power supply.

6) Small Pipe

It is connected from pump to plate of the puppy.

Step 4: How does it work?

Milk and Water is filled in two different plastic containers, each container has different 12V pump to lift the liquid. These pumps are activated by 5V relay module and it is controlled by the master brain of the unit, the Arduino Uno! Arduino has a 16MHz crystal hence it can calculate time by using its timer, in Arduino programming delay (1000) means 1sec, so if we have to give milk to our pet every 3hrs, for that we need to calculate the delay.

1 sec = 1000ms
60sec = 60000ms
1min = 60sec = 60000ms
60min = 60*60000 = 3600000

Therefore 1hr = 3600000 so we need to calculate it for 3hr 3*3600000= 10800000, hence delay(10800000). We have to give this delay after every feeding process. Whenever this delay finishes, Arduino gives signal to the Relay driver, then relay driver switches on the pump for few sec (based on the pet and age , i.e amount of the milk consumption will be different for different pets). And then it turns of the relay driver, Arduino starts its delay counting again. Now we will see the connection!

Step 5: Connection of Arduino and Relay board!


  • Arduino pin no - 7 to Relay IN1
  • Arduino pin no - 8 to Relay IN2
  • Arduino 5v to Relay VCC
  • Arduino GND to Relay GND

Step 6: Connection of Relay board and 12V submersible pump

Here unconnected terminal goes to 12V DC/AC input from battery.

Step 7: Connection of Arduino and IR sensor!


  • Arduino pin no - 13 to IR sensor O/P
  • Arduino 5v to IR sensor VCC
  • Arduino GND to IR sensor GND

Step 8: Arduino Coding!

Step 9: Overall Connections!

Here, look at the first picture. It is the main part of the project and second pic has got 12v power supply based on 7812IC. I got this for around 35 INR in Bangalore. Here I have used only two relays (iN1,iN2) since I have used two pumps. 12V supply board has got two terminal connectors: one is for input and other is for output. Connect all the components as per the circuit and upload the sketch to the Arduino. I hope you will do it soon for your pet.


Similar projects you might like

3D-Printed Automatic Small Fish Feeder

Project showcase by Team RobotGeek Project Team

  • 1 comment
  • 10 respects

DHT22 Applied To Automatic Irrigation

Project showcase by CristianColweb

  • 11 respects

Pet Feeder

Project tutorial by Namsulee

  • 11 respects

YAFF - Yet Another Fish Feeder

Project showcase by Ronny Rodríguez

  • 8 respects

Automatic Pet Water Chiller

Project tutorial by Mitomon

  • 7 respects

Arduino and AC Devices - Automatic Lights

Project tutorial by Ahmed Hamdy

  • 51 respects
Add projectSign up / Login