Automatic chicken feeder

Hello
I am Noé and I am making a arduino project to feed the chickens automaticaly when it is time. I already have the material:

amazon (RTC)

amazon (arduino)

amazon (breadboard and wires)

amazon (buzzers)

12V 5A power suply for motor

esp8266 (it is not exactly that one)

motor 12V 5A

I have this code:

#include <RtcDS1302.h>
#include <ThreeWire.h>

const int buzzPin = 12;
const int relPin = 8;
const int clk = 10;
const int dat = 11;
const int rst = 9;
int Hour = 13;
int Minute = 58;
int Second = 10;

ThreeWire myWire(dat, clk, rst);
RtcDS1302<ThreeWire> Rtc(myWire);

void setup() {
  Serial.begin(9600);  // Start serial communication for debugging
  pinMode(buzzPin, OUTPUT);
  pinMode(relPin, OUTPUT);
  
  Rtc.Begin();

      RtcDateTime currentTime = RtcDateTime(__DATE__, __TIME__);
    Rtc.SetDateTime(currentTime);
  
  if (!Rtc.IsDateTimeValid()) {
    Serial.println("RTC lost confidence in the DateTime!");
    RtcDateTime currentTime = RtcDateTime(__DATE__, __TIME__);
    Rtc.SetDateTime(currentTime);
  }
  
  if (!Rtc.GetIsRunning()) {
    Serial.println("RTC was not actively running, starting now");
    Rtc.SetIsRunning(true);
  }
}

void loop() {
  RtcDateTime now = Rtc.GetDateTime();
  
  // Print current time for debugging
  Serial.print(now.Hour());
  Serial.print(":");
  Serial.print(now.Minute());
  Serial.print(":");
  Serial.println(now.Second());
  
  if (now.Hour() == Hour && now.Minute() == Minute && now.Second() == Second) {
    digitalWrite(relPin, HIGH);  // Note: fixed typo in relPin
    
    // Play melody
    tone(buzzPin, 130.81); delay(600);
    tone(buzzPin, 146.83); delay(600);
    tone(buzzPin, 164.81); delay(600);
    tone(buzzPin, 174.61); delay(600);
    tone(buzzPin, 196); delay(600);
    tone(buzzPin, 220); delay(600);
    tone(buzzPin, 246.94); delay(600);
    
    noTone(buzzPin);  // Stop the buzzer
    digitalWrite(relPin, LOW);
  }
  
  delay(1000);  // Add a small delay to prevent excessive checking
}

Now I can change the time of feeding in the code. But I want to change it via a site or app. I thought blynk IOT is a good site. I also want the posibility to feed the chickens with a button.

Do anyone know how to do this?

thank you in advance

PS: I also posted this in other topics

If you want to control using a virtual button on an app there are a lot of apps available on the internet. You need to connect the app to your esp and program it to perform the function.

If you want to do it using a physical button, you can take an arduino uno, attach a hc-05 bluetooth module to it, connect a button to the arduino and then the arduino and esp can communicate.

I want to do it with an app but I also want to control the variable with the time via the app to change at wich hour they receive food.

I believe this video will help you to create a custom app based on your requirements and communicate with your esp

In order to add an app, simply look at the samples provided by the boards, although I would change either the Arduino or the 8266 so that they are both the same. Adding a button is just a matter of looking for the 'activation' code and inserting a parallel path via the button.

There is nothing on the list that drives the motor.
5A power supply might be under rated for motor that has rated current 6.5A
You don't need arduino, if you have Esp8266. You don't need RTC either if Esp has internet connection (NTP).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.