Automated Chicken Feeder - Noob needs help

Hello All, I'm currently working on a school design project that releases chicken feed at 7 in the morning and 7 at night. It is basically a motor geared to a butterfly valve that opens/closes etc.

I'm new to arduino and electronics aren't exactly my thing. But I'm grateful for any help you can provide, circuit lay outs, coding ideas etc. the more simple the better

  • I don't wish to control the speed of the motor i just want to turn it on for say 2 seconds, delay 2 seconds, and reverse it for 2 seconds, closing the valve once every morning. The Arduino has to run off a 9v battery and the motor is this one http://www.jaycar.com.au/productView.asp?ID=YG2734

I have researched other similar projects, like the arduino dog feeder but that uses a servo, and http://www.instructables.com/id/Simple-2-way-motor-control-for-the-arduino/#step3 Looks promising could i just intergrate this into a timed code etc?

Thankyou so much for any help

Welcome to the forums. At 12v, under no load, that motor would make 1.2 revolutions in 2 seconds. Rather than controlling the length of time to the open or closed positions, I think a better approach would be to sense the open and closed positions and operate the motor until the desired position is reached. What power supply is used for powering the motor? - Scotty

More suitable would be http://www.jaycar.com.au/productView.asp?ID=YG2730. I would use limit switches instead of time to control its position. Just run it until it hits the limit switch, wait for 2 seconds and then reverse it until it hits the other limit switch. You might find problems closing the shutter against the flow of feed. Some feed may get trapped and stop the shutter from fully closing.

"Rather than controlling the length of time to the open or closed positions, I think a better approach would be to sense the open and closed positions and operate the motor until the desired position is reached."

thanks for the reply but couldn't i just stick to my original plan of just turning the motor on for a set time and reversing it the same amount of time to open close the valve? i just already CAD 'ed it and im printing it off now on the 3d printer at school.

"What power supply is used for powering the motor?"

With the power supply i have to power the arduino with a 9 v battery (just those ones you buy from the supermarket) that will be charged by a solar panel.

"Some feed may get trapped and stop the shutter from fully closing."

Yeah haha thats what i came across but i managed to eliminate that in prototyping stage so its all good

YES you can do it without sensors, but you will still need some things. You will need to play with the open and close delays before hooking up the motor to the valve. (otherwise you could break the gearbox / burn the motor / break the valve). get the delays to set the motor to where it should be full open / closed or just before the limits then connect the motor and micro adjust the delays.
THIS is not a good way to do it, but if you just want to prove a concept it should be ok
A 9v garden timer
a 9v DPDT relay
2 x opto couplers
2 x npn transistors
2 x 560 ohm Resistors
3 x 1k Resistors
3 x 10k Resistors
1 x 1n4004 diode
and some wire

CODE:

int timePin = 7;
int motorPin = 8;
int dirPin = 9;

void setup(){
pinMode(timePin, INPUT);
pinMode(motorPin, OUTPUT);
pinMode(dirPin, OUTPUT);

digitalWrite(motorPin, LOW); // make sure motor output is low
digitalWrite(dirPin, LOW); // make sure direction output is low
}

void loop(){
if (timePin){
digitalWrite(motorPin, HIGH); // start motor
delay(250); // time to open valve
digitalWrite(motorPin, LOW);// stop motor
digitalWrite(dirPin, HIGH); // ready to reverse
delay(2000); // Your 2 sec delay
digitalWrite(motorPin, HIGH); // start motor
delay(250); // time to close valve
digitalWrite(motorPin, LOW);// stop motor
delay(70000); // time to let timer elapse 1 min 10 sec (Garden timers usually have a minimum of 1 minute on)
}
}

Chook Feeder Circuit.docx (30.6 KB)

Hi, do you have a circuit diagram already, can you post it in jpg, png or pfd for us to see please.

Tom....... :)

Ps What supermarket 9V batts are rechargeable?

turning the motor on for a set time and reversing it the same amount of time to open close the valve?

That method might work sometime but I doubt it would work correctly consistently. The problem with the method is, depending on the load, that there is no way to determine the length of time it will take for the door to open or close. Besides that, the time it will take for the door to open or close will also greatly depend of the charge state of the battery. You cannot recharge a "just those ones you buy from the supermarket" battery.

I think you need to rethink this design. Your current one is just too flawed.

  • Scotty

Alternatively you could use http://www.jaycar.com.au/productView.asp?ID=XC4278 to turn motor and direction on and off. Have the battery just power the timer which would turn the arduino on. This would save a lot of energy and reduce the components from my previous post.

Let me know if you want a circuit. :) CODE:

int motorPin = 8; int dirPin = 9;

void setup(){ pinMode(motorPin, OUTPUT); pinMode(dirPin, OUTPUT);

digitalWrite(motorPin, LOW); // make sure motor output is low digitalWrite(dirPin, LOW); // make sure direction output is low }

void loop(){ digitalWrite(motorPin, HIGH); // start motor delay(250); // time to open valve digitalWrite(motorPin, LOW);// stop motor digitalWrite(dirPin, HIGH); // ready to reverse delay(2000); // Your 2 sec delay digitalWrite(motorPin, HIGH); // start motor delay(250); // time to close valve digitalWrite(motorPin, LOW);// stop motor delay(70000); // time to let timer elapse 1 min 10 sec (Garden timers usually have a minimum of 1 minute on) }

Hi, circuit diagram, yes please.

Tom..... :)

If you're going to move the valve without any position feedback, I suggest you design end stops into the mechanism so that it can't move past the 'fully open' or 'fully closed' positions. Then each time you need to operate the valve, just turn the motor on in the right direction for long enough for it to move full travel, plus a small margin. Design the drive mechanism and motor/driver so that it won't be damaged by the motor being stalled briefly.

Adding limit switches would not add much complication and would give you a much better design IMO.

I didn't know automated chickens needed feeding! :D

Henry_Best: I didn't know automated chickens needed feeding! :D

All chickens are automated. Except the ones in the supermarket. They have been de-automated. =(

Hello All,
Thank you so much for your feedback i really appreciate you taking time to help me and it’s all greatly appreciated.
I think i should have mentioned i have no experience with this but i am eager to learn, so if it’s no big deal could everyone keep that in mind, My project dosen’t need improving it’s from nothing. Circuit diagrams (simple picture ones) or code, anything would be awesome and please find attached my CAD files/images for the whole mechanism.

“What power supply is used for powering the motor?”
I was hoping i could use this.
http://www.greentopia.com.au/9V-Rechargeable-Battery-1-Pack-Energizer/NH22NBP1G1.htm?feed=googleproductsearch&gdftrk=gdfV2426_a_7c983_a_7c6886_a_7cNH22NBP1G1&gclid=CPOi0bfCsr0CFY0svQodgLYATA

“Hi, do you have a circuit diagram already, can you post it in jpg, png or pfd for us to see please.”
Super sorry but i have no idea.

"That method might work sometime but I doubt it would work correctly consistently. The problem with the method is, depending on the load, that there is no way to determine the length of time it will take for the door to open or close. Besides that, the time it will take for the door to open or close will also greatly depend of the charge state of the battery. You cannot recharge a “just those ones you buy from the supermarket” battery.

I think you need to rethink this design. Your current one is just too flawed."

I am in early stages so any suggestions on how i could achieve this in what you think could be simpler, more efficient etc would be great. I only need this thing to work for like a day, since its a design project for school, I’m not using it at home so reliability isn’t a huge issue but if we could that would be awesome. and yes i do think i need to abandon my original idea it is reliant on a constant output from a battery. thank you for your input.

“I suggest you design end stops into the mechanism so that it can’t move past the ‘fully open’ or ‘fully closed’ positions”

That’s a brilliant idea thank you i’ll incorporate that into the design.

“Adding limit switches would not add much complication and would give you a much better design IMO.”
If you could provide a circuit diagram and some code i would be super grateful.

“I didn’t know automated chickens needed feeding! -
All chickens are automated. Except the ones in the supermarket. They have been de-automated.”

Very funny…

Once again thankyou for your replys i am so proud of this project and it means a lot to have people help me in my weak areas

Take Care

X8.skp (2.83 MB)

apreci8design: "Adding limit switches would not add much complication and would give you a much better design IMO." If you could provide a circuit diagram and some code i would be super grateful.

A limit switch is just a switch that is operated when the mechanism reaches a certain position. You would wire the limit switch between Arduino ground and a digital I/O pin, enable the internal pull-up resistor for that I/O pin and use digitalRead() to detect whether the switch was open (HIGH) or closed (LOW). The Arduino IDE comes with example sketches that demonstrate this sort of thing.

A basic relay controlled motor setup where when the relay is energized the motor runs in one direction, and when deenergized the motor runs in the other direction. The motor is stopped in both directions by limit switches. This might be a simple solution if you have solved the issue of feed jamming the shutter.

I have attached a doc that shows wiring connections. You should be ok from here.

Chook Feeder.docx (114 KB)

I know I say it a lot but thankyou all so much for everyones contribtuions. I know it may be frustrating with my limited knowledge, but I am learning so much.

I have attempted to follow the plan provided by Angelo_B with a garden timer. He has even supplied accompanying code, and I think I know how it all works.

Please find the circuit attached (I know it’s not a proper one, but I problem solve better like that, sorry) As well as the actual one Angelo_B provided (Mine is just what i think it means/ my interpretation)

So if it wouldn’t work / explode please point out any flaws or simplifications etc.

Once again I am so thankful for your time and effort, I realise you don’t have to do this and you have your own projects, but you have all inspired me to learn more about electronics and I am so proud of this project.
I am so excited to build this thing!!!

Thanks,

Garden Timer
http://www.ebay.com/itm/NEW-Two-Dial-HOME-WATER-TIMER-GARDEN-IRRIGATION-CONTROLLER-1-16-Set-Programs-/261286807245?pt=LH_DefaultDomain_0&hash=item3cd5e846cd

9v coil
http://www.ebay.com.au/itm/10-Pcs-DC-9V-Coil-7A-240VAC-10A-125VAC-28VDC-5-Pins-SPST-Power-Relay-JQC-3F-/271421926625

4-Channel Relay Driver Module

Sainsmart Uno

Chook Feeder.docx (114 KB)

It's all good except for your relay contact wiring. Take another look at how I have the connections set. You need a double pole double throw relay (DPDT relay).

Hope this Helps. :)

Sorry i don't understand, Why would i need a double pole double throw relay? (Probably a stupid question) Thanks

“It’s all good except for your relay contact wiring”

Is this what you meant?/ Would this work?