Site icon Circuit Ideas for You

Building a Smart Pet Feeder Circuit using Arduino

Feeding pets can be easy and on time using automatic system.

This project for Building a Smart Pet Feeder Circuit using Arduino and other parts like IC 7809, SG90 servo motor and HC-SR04 sensor to make simple pet feeder.

Feeder work with distance sensor to give food so pet can eat on time without people help.

This system help pet owners save time and feed pets regularly.

Code:

#include <Servo.h>

Servo myservo;  // create a servo object to control the servo

const int trigPin = 9;    // Trigger pin of the ultrasonic sensor
const int echoPin = 10;   // Echo pin of the ultrasonic sensor

const int   
 servoPin = 2;   // Servo motor pin

int duration, distance;

void setup() {
  myservo.attach(servoPin);  // attach the servo to pin 2
  pinMode(trigPin, OUTPUT); // sets the trigPin as an output
  pinMode(echoPin, INPUT);  // sets the echoPin as an input
}

void loop() {
  // Generate a pulse of 10us on the TRIGGER pin
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  // Read the duration of the pulse on the ECHO pin
  duration = pulseIn(echoPin, HIGH);

  // Calculate the distance in centimeters
  distance = duration * 0.0343 / 2;   


  // Check if a pet is within the desired range
  if (distance >= 10 && distance <= 20) {
    // Dispense food by rotating the servo
    myservo.write(90); // Adjust the angle as needed
    delay(1000); // Delay for dispensing
    myservo.write(0); // Return to initial position
  }

  // Add code for timer-based feeding if desired
}

Code Explanation:

Circuit Working:

Parts List:

ComponentQuantity
Arduino Uno1
IC 7809 (Voltage Regulator)1
Servo Motor SG901
Ultrasonic Distance Sensor HC-SR041

In this circuit diagram choose container big enough to hold pet food.

Add open-close lid on container and servo motor will control this lid.

Fix servo motor in box so it can open and close food container properly.

Fix ultrasonic sensor so it can see pet in set distance.

Ensure pet can come in front of sensor clearly.

Put all parts inside box to protect from weather.

Make small hole so pet can reach food.

Use IC 7809 to change 12V to 5V which is needed for Arduino, servo and sensor.

Give 5V power to sensor and servo using breadboard.

HC-SR04 sensor check how far pet is by sending sound waves and measuring return time.

Servo motor control food lid.

Arduino tell servo to turn and open or close feeder.

How to Build:

For Building a Smart Pet Feeder Circuit using Arduino following steps need to be followed for assembling:

Conclusion:

This Building a Smart Pet Feeder Circuit using Arduino shows how to make automatic pet feeder using servo motor and ultrasonic sensor.

It helps feed pet without human help by making pet care easier.

References:

Reliable Smart Pet Feeding Machine Using Arduino Uno Starter Kit

Exit mobile version