Controlling a motor with arduino

Hi seand16,

Welcome, have a few suggestions in reguard to the feeder.

Dont just time the motor forward reverse as if things go wrong your motor burns out. Use limiting switches, one for door open and one for door close that way you shut off the motor when the door reaches the right position.

With ref to your daily timer, add a LDR (Light Dependent Resistor) so you can detect day and night then you start the timer from sunrise this limits your error to one day before being reset.

Both of these are easy to add and will remove accumulated errors of just running timers.

I would still use a timer on the motor run time so if the door is ever stuck you can detect it by the fact that the door has not reached the limit switch and the timer runs out. Then set off an alarm.

Main thing is do a rough sketch of what you are putting in and then do a flowchart of how it works. This will make it easyier, to lay the program out and if you need help it will allow others here to see where you are going with the program.

Daz