I'm making automatic cat feeder.
I have arduino nano and the servo to open and close the valve for food the come out.
But when I search online for more, I need to buy RTC to control the time and day?
Is it possible to just program time delay between activation to activation of the servo with only arduino nano or Do I need the RTC chip to control the time of activation.
I want to servo activate 4 times in a day and everyday.
This is to code that I'm trying to use, is it correct?
Thanks!
#include <Servo.h> #define SERVO_PIN 9
Servo demoServo; #define NUM_DISPENSE_PER_DAY 4 // number of times to dispense food per day #define DISPENSE_SECS 5 // amount of time to keep dispenser servo open
The timers built into the average Arduino are not that accurate. You can build a clock based on millis() timing but expect it to drift badly (seconds or minutes per day). You could use an ESP based processor, for example the D1 Mini based on the ESP8266, if you do that then it can connect to the internet and get the time from an NTP server automatically. The problem is that I think you will have a very steep learning curve at the moment given your current level of knowledge.
I suggest you either accept inaccurate timing or use an RTC.