Microcontroller-based Automatic Pet Feeder System with Load Sensor

Download Full-Text PDF Cite this Publication

Text Only Version

Microcontroller-based Automatic Pet Feeder System with Load Sensor

*A.O. Aransiola, J.A. Adegbite

Department of Electronic and Electrical Engineering Obafemi Awolowo University, Ile-Ife, Nigeria

Abstract:- Most pets owners cannot stay at home to feed their pets several times a day or impatience in feeding them due to their busy schedules. This paper is an automatic pet feeder system which feeds pet with food and water at predetermined time interval. The feeder system has a battery backed-up DS 1307 real time clock that is set to the current time and the feed dispensing time. At the set time, the feed is dispensed until its weight measured with a load cell reaches the preset weight value based on the consumption level of each pet. The system also dispenses water to the pet at the specified time. The firmware of the system was developed in C language using a MikroC ® development environment. The experimental results obtained The automatic pet feeder system has highly made pet feeding easy and cost-effective.

Keywords: Microcontroller, Load cell sensor, Servo motor, LCD, Real time clock, Pet feeder.


Pet or companion animals are kept primarily for a persons company, protection, or entertainment rather than as a working animal or laboratory animal. Popular pets are often noted for their attractive appearances, intelligence, and relatable personalities. Dog is the most commonly owned pet. Research has shown that in about 16,348 household compounds in Ilorin, Nigeria; out of 1,258 dogs, 621(49.4%) of dogs were kept primarily for security of premises, 205 (16.3%) were kept for breeding and commercial ventures, 184 (14.6%) were kept as pets, 103 (8.2%) were kept essentially for game hunting, 98 (7.8%) were used for multiple purposes and 47 (3.7%) were raised as source of meat. Dog management ranges from intensive (kennel confirmed) system in 331 (26.3%), to extensive (free roaming) system in 927 (73.7%) dogs. Dogs were kennel confined mostly (207 (16.5%)) in the high income residential areas, while all dogs in transit areas were free-roaming1. Nowadays, people are busier; and because of this, they tend to forget about feeding their pets at the right time. This causes a lot of discomfort for the pets Several pet feeders such as Arduino-based Food and Water Dispenser for Pets with GSM Technology Control3, Pet feeding Dispenser using Arduino and GSM Technology4, GSM controlled dog feeder and automatic water dispenser using RASPBERRY PI which work basically on sending SMS to the pet owners at the preset feeding time5; Design of Pet Feeder using Web Server as Internet of Things Application2, Automatic Pet Monitoring and Feeding System Using IoT6, Smart Dog Feeder Design Using Wireless Communication, MQTT and Android Client which interacts with other hardware like ultrasonic sensor, servo motor, Wifi module (ESP8266 module) and web server7. The unavailability of the cellular signal, mobile phone maybe unreached due critical battery/fault condition and short range of wifi network to mention just a few are some of the limitations of the existing technologies.

In this work, an automatic pet feeding system with load cell sensor that provides food and water for pets in the absence of pet owners was designed, implemented and tested. The system was developed with PIC microcontroller as its main controller.

Hardware Development


The choice of the individual components was made to achieve the food and water section of the feeding system. The core component used in the system is a microcontroller, PIC16F877A which coordinate the activities of the other components used in the design thereby reducing the design and control complexity9. The block diagram of the system is shown in Figure 1.

Figure 1: The block diagram of a microcontroller-based automatic pet feeder system with load sensor

Design Operation

Figure 3 Flow Chart of the microcontroller-based automatic pet feeder system with load sensor

The system is powered on from the power supply and it is initialized as the current time is set when newly install. When the current time has been set, then the dispensing time will be set. The RTC keeps the current time updated even when there is power failure due to its internal battery. The microcontroller will constantly check if the dispensing time has been reached. Once it is reached, it sends a signal to the servo motor which trigger it and allow the food to be dispensed. While the food is being dispensed, the weight sensor checks if the food is up to 2kg for the pet; if it is not up to 2kg, the feeding continues, but once it reaches 2 kg, the servo motor is triggered and it stops. Consequently, when it reaches the dispensed time, the solenoid valve is also triggered and the water is dispensed for the pet for a minute before it stops. The system thereafter waits for the next dispensing time as set by the pet owner. In this work, the system was designed to dispense both food and water at every twenty- four (24) hours since pets are mostly fed one or twice daily.


The system works effectively and fulfills the objectives of feeding pet in the absence of its owner. The complex work is segmented into different segment, which was first simulated using simulation software, Proteus. The C programming codes were written using MikroC software and added to the simulation to see how it works. The visibility of the project was determined by the simulation. After the simulation, the circuit was implemented on the Vero-board.

Simulation Implementation

The microcontroller PIC16F877A controls and interfaces the activities of other components like RTC, load cell, solenoid valve and the servo motor. The simulation was implemented using Proteus software with various circuit connections made with the microcontroller and the RTC module, servo motor, LCD.

  1. LCD sub-circuit connection: It is connected to PORT D which is interfaced using 4-bit mode communication as shown in Figure 4. A 10k variable resistor is used to adjust the contrast of the LCD via VEE pin. Finally, the R/W pin must be connected to GND before LCD can display.

    Figure 4: LCD sub-circuit connection

  2. RTC sub-circuit connection: The PIC16F877A has an inbuilt SCL and SDA therefore an external I2C communication is not needed, it is connected directly to the PIC16f877A as shown in Figure 5. An internal battery of 3V is also used.

    Figure 5: RTC sub-circuit connection

  3. Servo-motor sub-circuit connection: The servo motor used was SG-90 which can rotate in both directions. A relay was used for the switching of the motor. Before connecting the relay, the transistor was used due to the limited current supplied by the PIC16f877A. The circuit is shown in Figure 6 below.

Software Implementation

Figure 6: Servo motor sub-circuit connection

PIC16F877A is programmed using MikroC software. The software uses C-programming language due to its compiler and the hardware support is vast to using other languages. The microcontroller does all the core control of the system. It obtains the information from the real time clock and it is displayed on the LCD screen. The set time and the current time are displayed on the LCD screen which will then activate the solenoid valve and the servo motor when it reaches the set time.

Additionally, the declaration of the input/output pins of the PIC, the interfacing of the 4-bit communication mode of the LCD, the connection of the solenoid valve or the connection of the servomotor to the microcontroller is achieved by initializing in states and declaring constant valve for specific task in the compiler. The MikroC codes are loaded into the microcontroller using a code dumping device. The code dumping device is an electronic device which serves as an interface to communicate microcontroller with MikroC compiler.

Hardware Implementation

The circuit was implemented on the Vero board as shown in Figure 7 and its prototype design in Figure 8.

Figure 7: Hardware Implementation

Figure 8: Prototype design


This paper has presented microcontroller-based pet feeder system with load sensor. The pet feeder system was specifically designed for the dogs, in which the dog feed which is a dry granule feed is stored in a container and the water is also stored in another container and later dispensed at a particular time interval as the user desire. This gives the owners the power to control the feeding time of their pets on the desired time they want. The implementation of this system has overcome the disadvantages of traditional products and meets the needs of the pet owners.


[1] Aiyedun J.O and Olugasa B. O (2012) Identification and analysis of dog use, management practices and implications for rabies control in Ilorin, Nigeria Sokoto Journal of Veterinary Sciences, 10 (1):22-27.

[2] Andi Adriansyah, Muchud. Arief Wibowo, Eko Ihsanto (2016) Design of Pet Feeder using Web Server as Internet of Things Application International Conference on Electrical Engineering and Informatics (Icon-EEI), October 2016.

[3] Angelo A. Beltran Jr., Allen Rei Clavero, John Mark B. De Vera, Paul Avry P. Lopez, Cyrus A. Mueca, Napoleon A. Pempeña IX, Adrian Zhaniel D. Roxas (2015) Arduino-based Food and Water Dispenser for Pets with GSM Technology Control International Journal of Scientific Engineering and Technology. (IJSET), Vol. 4, Issue 4, April 2015.

[4] Smruthi Kumar (2018) Pet feeding Dispenser using Arduino and GSM Technology International Research Journal of Engineering and Technology (IRJET), Volume: 05 Issue: 11.

[5] Mark Christian G. Cabaltera, Kurt C. Cuaresma, Allen B. Flores, and Dr. Neil P. Balba (2018) GSM controlled dog feeder and automatic water dispenser using RASPBERRY PI LPULaguna Journal of Engineering and Computer Studies Vol. 4 No. 1.

[6] S.Subaashri, M.Sowndarya , D.K.S. Sowmiyalaxmi , S.V.Sivassan, C. Rajasekaran (2017) Automatic Pet Monitoring and Feeding System Using IoT International Journal of ChemTech Research, Vol.10 No.14, pp 253-258.

[7] Vania, Kanisius Karyono, Hargyo Tri Nugroho I (2016) Smart Dog Feeder Design Using Wireless Communication, MQTT and Android Client International Conference on Computer, Control, Informatics and its Applications.

[8] C-Agua.es. (2015). Módulo Sensor de Peso HX711 24 AD. http://c-agua.noip. org/tienda/index.php?route=product/product&product_id=147 [9] Microchip Technology Inc.(2019). https://www.microchip.com/wwwproducts/en/PIC16F877A

Leave a Reply

Your email address will not be published.