How to make a servo spin every 24 hours

How to make a servo spin every 24 hours. I am a 13 year old making an automatic chicken feeder to help out of the farm. Whats some code to do this?

How accurate does the 24 hours need to be? Arduinos are not real accurate keepers of time of day. They can be off several minutes over 24 hours and the error will accumulate over time. If you want accuracy, I suggest that you use a Real Time Clock (RTC) like the DS3231.

As to the code, the search term "arduino ds3231 chicken feeder" yields nearly 100,000 hits. Read some of those to see how others have done it. Come back if you have questions.

If you do not need the accuracy of the RTC, search for "arduino chicken feeder". There are over 600,000 hits for that.

Make an effort to write your code. If you have trouble, post the code, tell us what the code actually does and how that differs from what you want the code to do.

1 Like

Thank you groundFungus, I appreciate it.

Internet search words "arduino automatic chicken feeder".

If you haven't bought yet a microcontroller you could use a ESP32-nodeMCU-board.

ESP32s have WiFi and an RTC onboard. After adding a board-url and running the Arduino-IDE Board-installer you can program an ESP32 just like an Arduino. If you have it connected to your local WiFi you can obtain the exact time from the WiFi-connection.

best regards Stefan

My two tutorials on How to write Timers and Delays in Arduino and
Multi-tasking in Arduino
should give you some ideas
Although if that is all your code is doing then a simple delay( )'s will do the job.

Don't do timers, just use a light sensor. When it gets daylight, feed the birds.

-jim lee

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