Site icon Circuit Ideas for You

Building a Smart Pet Feeder Circuit using Arduino

Feeding times may be made more dependable and effective by automating typical pet care tasks.

Using an Arduino Uno, an IC 7809 voltage regulator, a servo motor SG90, and an ultrasonic distance sensor HC-SR04, this project aims to create a basic automated pet feeding.

The intention is to construct a feeder that uses distance measures to deliver food, guaranteeing that pets eat at the appropriate time without the need for human assistance.

This circuit is great help to the owners which can save their time to feed their pets on regular interval.

Code with Explanation:

#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
}

Explanation:

Circuit Working:

Parts List:

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

In the below circuit diagram you need to select a container that has enough room to accommodate your pets food.

To help direct the food into the dispensing mechanism, attach a open and close lid which is controlled by servo motor.

Install the servo motor in the enclosure so that it can regulate the food containers opening and shutting.

The ultrasonic sensor should be mounted such that it can identify pets within a given range.

Make sure the area where the pet is anticipated to approach is clearly visible to the sensor.

To shield the completed parts from the weather, place them within the enclosure.

Make a little aperture so the pet can get to the food.

To reduce a larger voltage such as 12V to 5V, which is needed by the Arduino, Servo motor, and HC-SR04 sensor, use the IC 7809 voltage regulator.

The sensor and servo are powered by the regulated 5V that is fed to the breadboard.

The HC-SR04 sensor gauges its distance from an item, such as a pet.

It generates ultrasonic waves and uses the time it takes for the waves to return to determine how far away anything is.

The dispensing mechanism is managed by the servo motor.

It may be used to open or close the feeder by rotating to a specified angle, which it gets instructions to do from the Arduino.

How to Build:

To build a mart Pet Feeder Circuit using Arduino following steps need to be followed for assembling:

Conclusion:

This simple circuit for an automatic pet feeder shows how to build a simple automated feeding system using an Arduino Uno, a servo motor, and an ultrasonic sensor.

Pet care may be made more easy by utilizing these components to guarantee that your pet is fed without the need for human interaction.

References:

Reliable Smart Pet Feeding Machine Using Arduino Uno Starter Kit

Exit mobile version