Automatic CHICKEN DOOR Dirt Cheap

by might111 in Outside > Backyard

5772 Views, 50 Favorites, 0 Comments

Automatic CHICKEN DOOR Dirt Cheap

20170923_154233.jpg
20170920_200154.jpg
Automatic CHICKEN DOOR Dirt Cheap

My goal was to make automatic chicken door as cheaply as possible. In metric.

Things used: [please check if it matches, i bought these things a long time ago]

-2x bearing holder or rail support; inner diameter 10mm
-2x bearing MR105 inner diameter 5mm*10mm
-M5 rod
-6X M5 nuts
-shaft coupler 5mm 5mm
-sink chain; L at least 400mm
-polycarbonate 210X300
-stepper motor 28BYJ-48
-2x L profile as stepper motor holder
-2*650mm alu profile for sliding, edges at 90degrees
-photoresistor sensor module
-some wires with female headers
-Arduino UNO
-some screws
-a board

some links:

https://www.aliexpress.com/item/1PCS-SK10-10mm-Sha...

https://www.aliexpress.com/item/10pcs-lot-MR105-MR...

https://www.aliexpress.com/item/1PC-Metal-Plastic-...

https://www.aliexpress.com/item/5V-Stepper-Motor-2...

https://www.aliexpress.com/item/4-pin-photoresisto...

https://www.aliexpress.com/item/Stepper-Motor-5x5x...

Use this extention to get up to 7% off
https://alibonus.com/?u=429363

Assembly

20170910_161802.jpg
20170910_161702.jpg
20170910_161613.jpg
20170910_161622.jpg
20170910_163841.jpg
20170910_163642.jpg
20170910_162820.jpg
20170911_222416.jpg
20170910_163354.jpg
20170910_163329.jpg
20170910_163958.jpg
20170910_163342.jpg
20170911_222511.jpg
20170911_222957.jpg
20170911_223008.jpg

Cut the M5 rod to arround 270mm. Tigheten the screws around the bearing and place it inside the bearing holder, tightening the screw on the holder. Place two screws where chain should start winding and insert the chain. Set up the right bearing holder with a bearing and two nuts. Add two L profiles to the stepper motor, add a coupler and put it in the rod, then tighten the coupler.

Make a hole in the polycarbonate and tighten the other end of the chain with a screw and an electrical connector to secure the chain. Maybe add some rubber or hot glue to prevent unscrewing.

Wooden Board

20170920_170837.jpg
20170920_170935.jpg
20170920_172207.jpg
20170920_190529.jpg
20170920_193412.jpg
20170920_200127.jpg
20170920_191802.jpg

Cut a bigger hole(200mm) at the bottom and smaller one(50mm) at 700mm from the bottom of the board for photocell. Hotglue a transparent lid in the hole; penetrating outside to get more light. Screw in the sliding profile straight. Screw in bearing holders

Electronics

20170920_223252.jpg

Arduino: Stepper

change sequence of pins from Arduino to steppr motor to change direction

pin 4 -in1
pin 5 -in2
pin 6 -in3
pin 7 -in4
Vcc - to plus
Gnd - to minus

Arduino: sensor

pin 12 - Vcc
pin 13 - DO
Gnd - Gnd

Code:

int Pin0 = 4;

int Pin1 = 5;

int Pin2 = 6;

int Pin3 = 7;

int _step = 0;

int t=2100;

int sensorPower = 12;

int sensorPin = 13;

int revs = 24576; //equals 6 turns

int state=1; //0 is doors closed, 1 is open

boolean dir = true;// gre

void setup()

{

pinMode(Pin0, OUTPUT);

pinMode(Pin1, OUTPUT);

pinMode(Pin2, OUTPUT);

pinMode(Pin3, OUTPUT);

pinMode(sensorPower, OUTPUT);

pinMode(sensorPin, INPUT);

}

void loop()

{

digitalWrite(sensorPower, HIGH); //sends power to sensor

int sensorVal = digitalRead(sensorPin);

if (sensorVal==LOW & state==0)

{

for(int i=0;i

{

state=1;

dir=true;

switch (_step) {

case 0:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, HIGH);

break;

case 1:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, HIGH);

digitalWrite(Pin3, HIGH);

break;

case 2:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, HIGH);

digitalWrite(Pin3, LOW);

break;

case 3:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, HIGH);

digitalWrite(Pin2, HIGH);

digitalWrite(Pin3, LOW);

break;

case 4:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, HIGH);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

case 5:

digitalWrite(Pin0, HIGH);

digitalWrite(Pin1, HIGH);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

case 6:

digitalWrite(Pin0, HIGH);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

case 7:

digitalWrite(Pin0, HIGH);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, HIGH);

break;

default:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

}

if (dir) {

_step++;

} else {

_step--;

}

if (_step > 7) {

_step = 0;

}

if (_step < 0) {

_step = 7;

}

delayMicroseconds(t);

}

}

if (sensorVal==HIGH & state==1)

{

for(int i=0;i

{

state=0;

dir=false;

switch (_step) {

case 0:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, HIGH);

break;

case 1:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, HIGH);

digitalWrite(Pin3, HIGH);

break;

case 2:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, HIGH);

digitalWrite(Pin3, LOW);

break;

case 3:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, HIGH);

digitalWrite(Pin2, HIGH);

digitalWrite(Pin3, LOW);

break;

case 4:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, HIGH);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

case 5:

digitalWrite(Pin0, HIGH);

digitalWrite(Pin1, HIGH);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

case 6:

digitalWrite(Pin0, HIGH);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

case 7:

digitalWrite(Pin0, HIGH);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, HIGH);

break;

default:

digitalWrite(Pin0, LOW);

digitalWrite(Pin1, LOW);

digitalWrite(Pin2, LOW);

digitalWrite(Pin3, LOW);

break;

}

if (dir) {

_step++;

} else {

_step--;

}

if (_step > 7) {

_step = 0;

}

if (_step < 0) {

_step = 7;

}

delayMicroseconds(t);

}

}

}

Done!

20170923_154242.jpg

Connect stepper motor to ULN2003A and screw the electronics in. Ajust the sensor trimmer to close at desired darkness and insert it in the lid. Done!

Low power battery operated circuit with solar cell is in here:
https://www.instructables.com/id/Solar-CHICKEN-DOO...

EDIT: now available as compact module for sale
https://www.ebay.com/itm/264159127428