Automatic Dog Feeder

Good morning all,

I just found out about a week ago of the wonderful arduino micro controller, and still very new to all of this.

I have no problem with the physical connecting of the board and the components necessary, but when it comes to the programming, I feel like I want to tear my hair out. :confused:

Parts list:

Arduino Uno
Piezo Buzzer
ESP8266-12F
Servo generic
Pushbutton

My question is;

How do I program the buzzer to, well, do what a buzzer does and stop, then the servo to start for about 30 seconds and to stop and the process to repeat itself every 12 hours? Also, with the pushbutton, I want to add a "manual override function", so that whenever I press it, the buzzer should start and stop, then the servo should start and stop, without it interupting the delay?

What is the esp for?

Did you know that the esp is a programmable MCU, like the Uno, but more capable?. It has fewer pins, but itโ€™s much faster and has far more memory. It could replace the Uno. You can use the Arduino IDE and write sketches 99% the same way.

To answer your specific question, there is no magic command you are unaware of that makes problems like this suddenly easy. If you feel like you need some magic command to achieve something, this is a sure and certain sign that you donโ€™t understand the problem well enough yourself yet, in enough detail. You just need to sit and think about it, taking it to the next level of mind-numbing simplicity. When you realise you already know all the commands you need to make it happen, then you have the problem cornered.

You might benefit from using the forum search for dog feeder before making plans. We get versions regularly, the threads tell what to avoid and what works without waiting for new replies.

It sounds like you need to learn some basics, for the buzzer use a active 5v buzzer so you can just set an output to low and high like a button, for the servo use the servo library and just copy their example, as for a button to run the code well that's to simple you should know how to do that but to start you off look in the arduino example under digital - button, and i assume you want to use the esp8266 to have a webpage where you can click a button and feed your dog from anywhere in the world i.e beep and turn the servo so for that i recommend googling esp8266 "turn on led" and just call the needed functions where the led is turned on in the code and lastly to run it every half a hour look in the arduino examples for digital - blinkWithOutDelay, as PaulRB said you can make all this code on and arduino and then just flash it to the esp8266 and keep your uno for other projects. Google is your friend just start with each part such as the button then the buzzer and the servo, then the esp webpage which is more complex.

Heinrich:
How do I program the buzzer to, well, do what a buzzer does and stop, then the servo to start for about 30 seconds and to stop and the process to repeat itself every 12 hours? Also, with the pushbutton, I want to add a "manual override function", so that whenever I press it, the buzzer should start and stop, then the servo should start and stop, without it interupting the delay?

These are things that helped me out with different aspects of my own projects.

You could start out with the Tone Tutorial and get a feel for how to make some noise.

Learn how to Blink Without Delay to see how using millis() will help you greatly.

And have a read through Robin2's Several Things at the Same Time article. I feel this is a must read for anyone just starting out (such as myself).

Heinrich:
How do I program the buzzer to, well, do what a buzzer does and stop, then the servo to start for about 30 seconds and to stop and the process to repeat itself every 12 hours? Also, with the pushbutton, I want to add a "manual override function", so that whenever I press it, the buzzer should start and stop, then the servo should start and stop, without it interupting the delay?

Answer is to not use delay() in your code.
Next answer is learn BlinkWithoutDelay or one of many tutorials teaching the same lesson only better and more, like these:

  1. Gammon Forum : Electronics : Microprocessors : How to do multiple things at once ... like cook bacon and eggs
  2. Gammon Forum : Electronics : Microprocessors : How to process incoming serial data without blocking

Use delay() and your sketch is unable to do anything until it's over. Code execution is blocked for 16000 cpu cycles per ms.

Or don't block but rather have the code check the time for the thing needing to wait and do other things like watch the buttons in between time checks. The lessons tell why and show how well enough to get you started. Don't Bock!

Added:
void loop() should be your code's driving wheel that executes all the code inside of it over and over and over.

The parts inside of loop() should use if() statements to check if they should run or not.
A button handler part would check for the pin changing state (and may debounce the button) and when conditions are met may set a variable that another part also in loop() uses as its own trigger.
Not having the latter part inside the button handler lets other parts also trigger the action part and lets you change the button part without messing with the action part.
Not all of the parts trigger in any one pass through loop(), and whatever does should not be long. If there is a process with many steps, use a variable to control which step to do in one pass and then the next until the process is done. Do NOT make your buttons and timers wait for a long process to finish!

Keeping each part/step small doesn't just make easier to maintain code, it lets you run a very fast loop(). In examples I have posted to do only a few things at once I've gotten loop() averaging over 60000 passes per second (one thing being a loop counter and print part as a sketch health indicator) which tells me how responsive my inputs will be.

First learning C is like learning words and grammar in grade school. The above is about how to write.

Alright, thank you all for insight. I appreciate it!

I'll have a look at the forum, the links and maybe a few other resources. I just wanted to know where to start.

Thanks again.