Beginner electronics project | Automatic fish feeder
Вставка
- Опубліковано 3 лип 2024
- #arduino #arduinoproject #breadboard #electronic #project #fish
---
Automatic Fish Feeder Using Arduino | DIY Project Tutorial
Welcome to my channel! In this video, I show you how to create an **Automatic Fish Feeder using Arduino**. This step-by-step tutorial is perfect for beginners and enthusiasts looking to automate their fish tank feeding schedule.
What's Inside:
- Detailed instructions to build an Arduino-based fish feeder
- How to use a servo motor and DS1307 RTC module
- Easy-to-follow code explanation
- Tips to customize the feeder for your aquarium
- Simple wiring:
- Connect the servo motor's signal wire to Pin 9, power to 5V, and ground to GND
- Connect the RTC module's SDA to A4 and SCL to A5, power to 5V, and ground to GND
Why Watch:
- Ensure your fish are fed on time, even when you're away
- Learn essential Arduino skills
- Save money by building your own fish feeder
- Great project for DIY and tech enthusiasts
Follow Me:
Check out my projects and updates on Instagram: @leviathan_engineer
Subscribe for more: Don't forget to subscribe for more cool Arduino projects and DIY tutorials. Hit the bell icon to stay updated!
code:
#include
#include
#include
RTC_DS1307 rtc;
Servo fishFeederServo;
const int servoPin = 9;
const int feedHour = 8; // Hour to trigger feeding (24-hour format)
const int feedMinute = 30; // Minute to trigger feeding
const int feedSecond = 0; // Second to trigger feeding
bool hasFed = false;
void setup() {
Serial.begin(9600);
while (!Serial);
Wire.begin();
if (!rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
// Adjust RTC time to 8:29:30 AM
rtc.adjust(DateTime(2024, 7, 3, 8, 29, 30)); // Adjust RTC to July 3rd, 2024, 8:29:30 AM
fishFeederServo.attach(servoPin);
fishFeederServo.write(0); // Set servo to 0 degrees (closed position)
delay(500); // Allow time for servo to reach position
}
void loop() {
DateTime now = rtc.now();
Serial.print("Current Time: ");
Serial.print(now.hour());
Serial.print(":");
Serial.print(now.minute());
Serial.print(":");
Serial.println(now.second());
// Check if it's time to feed the fish
if (now.hour() == feedHour && now.minute() == feedMinute && now.second() == feedSecond && !hasFed) {
Serial.println("Feeding Fish...");
feedFish(); // Call the fish feeding function
hasFed = true;
}
// Reset flag after feeding time has passed
if (now.hour() == feedHour && now.minute() == feedMinute && now.second() == (feedSecond + 1)) {
hasFed = false;
}
delay(1000); // Print every second
}
void feedFish() {
fishFeederServo.write(90); // Rotate servo to 90 degrees to dispense food
delay(1000); // Wait for 1 second
fishFeederServo.write(0); // Rotate servo back to 0 degrees (closed position)
}
This is the coolest thing ever 🔥🔥🔥🔥
dudee thats cooll!! keep up the good work mate.. you deserve more subs!
😊