অটোমেটিক পেট ফিডার — এক চাপে এক পোরশনAutomatic Pet Feeder with a Servo
বাটন চাপলে সার্ভো দরজা ১.৫ সেকেন্ড খুলে ঠিক এক পোরশন খাওয়ায়, তারপর বন্ধ করে ছোট্ট একটা শব্দ করে। LCD তে দিনের হিসাব জমা থাকে — বিড়াল দুবার খাওয়ার ভয় নেই।
The servo swings a gate over the food jar for exactly 1.5 seconds — one portion — then closes it and chirps. The LCD keeps the day count so nobody double-feeds the cat.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno R3 Arduino Uno
- 1 × Servo motor (SG90) সার্ভো মোটর (SG90)
- 1 × Push button চাপ-বাটন
- 1 × LCD 16x2 with I2C LCD ১৬x২ (I2C)
- 1 × Buzzer (5 V) Buzzer (বাঁশি, 5 V)
- 11 × Jumper wires জাম্পার তার
তার লাগানো · Wiring
| Servo motor (SG90) VCC | → | Arduino Uno R3 5V |
| Servo motor (SG90) GND | → | Arduino Uno R3 GND |
| Servo motor (SG90) SIG | → | Arduino Uno R3 D9 |
| Push button 1 | → | Arduino Uno R3 D2 |
| Push button 2 | → | Arduino Uno R3 GND |
| LCD 16x2 with I2C VCC | → | Arduino Uno R3 5V |
| LCD 16x2 with I2C GND | → | Arduino Uno R3 GND |
| LCD 16x2 with I2C SDA | → | Arduino Uno R3 A4 |
| LCD 16x2 with I2C SCL | → | Arduino Uno R3 A5 |
| Buzzer (5 V) + | → | Arduino Uno R3 D8 |
| Buzzer (5 V) - | → | Arduino Uno R3 GND.3 |
Code (Arduino C++)
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Automatic pet feeder: the servo swings a gate over the food jar. One press
// on the button opens the gate for 1.5 seconds — exactly one portion — then
// closes it and chirps. The LCD keeps the day's count so nobody double-feeds
// the cat. Swap the button for a real-time clock later and it feeds on time.
Servo gate;
LiquidCrystal_I2C lcd(0x27, 16, 2);
int fed = 0;
void setup() {
Serial.begin(9600);
pinMode(2, INPUT_PULLUP);
pinMode(8, OUTPUT);
gate.attach(9);
gate.write(0);
lcd.init();
lcd.backlight();
}
void loop() {
static long lastFeed = -5000;
bool pressed = digitalRead(2) == LOW;
if (pressed && millis() - lastFeed > 2500) {
lastFeed = millis();
fed++;
gate.write(90);
digitalWrite(8, HIGH);
Serial.print("Feeding #"); Serial.println(fed);
}
if (millis() - lastFeed > 1500) {
gate.write(0);
digitalWrite(8, LOW);
}
lcd.setCursor(0, 0); lcd.print("Fed today: "); lcd.print(fed); lcd.print(" ");
delay(80);
}
আরো project · More projects
- সিও ভেন্টিলেটর — MQ-7 সেন্সরে এক্সহস্ট ফ্যান ঘোরেCO ventilator (MQ-7 spins the exhaust fan)
- বৃষ্টি সেন্সর অরশদ — দোকান ভিজে যাওয়ার আগেই নিজে বন্ধ হয়Rain-sensing awning (closes itself before the shop soaks)
- এসএসআর হিটার কন্ট্রোল — রিলের ক্লিক ক্লিক শব্দ নেইSSR burst-fire heater control (silent, no relay clicks)
- এল২৯৮এন দিয়ে মোটরের দিক কন্ট্রোল — সামনে পিছনেMotor direction control with the L298N (forward and reverse)