A chicken door - us...
 
Notifications
Clear all

A chicken door - using photo illuminated sensor

16 Posts
6 Users
1 Likes
559 Views
KimSki
(@kimski)
Active Member
Joined: 3 years ago
Posts: 5
Topic starter  

Dear specialists,

I'm totally new in the world of Arduino, and have seen several video's of the dronebotworkshop.
A friend of me gave me an Arduino Uno R3 for free and that's all i have so far. No components or other parts.
It's my very willing intention to buy me a complete starters set as i've seen how fantastic it is. 
But.... for now... i have a quiet urgent project asked by my house-boss  😆 

My son ( who has autisme), got 3 silkies this summer and as a good dad, i've build an inner sleephouse and around a fence to keep predators away. But...... the inevitable happend recently. For 1 night i forgot to close the sliding door on the sleepbox, and a marten got in, killing them all. 
I don't have to tell you what a drama it was for my son. He found them the morning after. 
So, the lady-of-the house is looking at me now to build a more automated solution. It is not because i repair aircrafts that dad can do anything....  So, i've' taught about buying a controller that lifts and lowers a sliding wooden door ( lightweighted) via a cord on a wheel that is driven by a small slow-turning motor.

The commercial sets are quiet expensive, so a colleague of me said he knew about the existing of a microcontroller that could control DC motors. And so i got the name Arduino found during my research. Once i saw the Arduino name, i recalled that my friend gave me once such board, which was for a very long time in my boxes stored away.

So.... I realise that it's not an easy job for me to build such system.
Chosing the components, composing the code ( of which i know nothing so far) will take a long time. Time that will force us to continue to open and close the chicken coop door manual each day. 
Therefore, i would like to ask, if someone would be so gentle to tell me which components i need to buy and how to hookup to the arduino board / power supply and/or any H-Bridge ( if required to swich polarity) / and which stepper motor i would need? 

I've read and saw so much video's that i lost a total oversight what would serve me the best. 
I've seen things like :

An

ULN2003 motor controller with a 28BYJ-48 unipolar stepper motor ( with a 5 Vdc power supply. Not sure if it would be strong enough to lift the lightweighted door, but i still can change the door into an aluminium plate) 

An L298N H-Bridge system with also an unipolar stepper motor using a 12Vdc power supply.

Don't know which light sensitive sensor i must choose. The sensor must be installed on a distance of the arduino board to sense the day/night transition at best.

 

And another element is that i would like to see reed switches to stop the motor when the door is full open and stop it again once full close.

To be honest.... if i need to build this project i'll think that my chickens will live for months with fear. 
I would realy need someones help who would be so nice and gentle to help me build it.....

 

Looking forward to any replies.

In advance, many thanks.... and i will ask a complete starters kit, for my christmas/newyears gift so i don't need to ask this once more, but learn it for myself 😉 

Kind regards,

Kim. 

 


   
Quote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3926
 

@kimski I always defer to @will in matters re steppers. He is also very good at providing guidance when the problem statement is so well enunciated. Hopefully he will jump in here soon before the crazies come out.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 2 years ago
Posts: 2219
 

@kimski

I'm afraid that we'll need you to do more research and collect some more information. You seem to have a good grasp of the overall bits and pieces so far. It's time now to get down to finer details 🙂

For instance, does the door open horizontally (i.e. lifting flap) or vertically (I.e. conventional door) and how much does it weigh. This information is needed to determine what kind and strength of stepper you'll need and that, to a degree will determine what kind of driver you'll need as well. At a guess, I'd judge that a 28BYJ and ULN2003 are too wimpy to do the work unless your coop door is only the size of one chicken at a time.

You also should take some more time thinking about using the light level as the basis for closing and opening the door. I don't know where you live but I'm sure that you wouldn't want an afternoon snowfall (that would block the sensor and fool it into thinking it's night time) to lock the door, thus trapping your hens out of the coop.

You may, for instance wish to include an RTC (real time clock) in your mechanism and open and close the doors based on the time of day and day of the year. Earlier and later in the summer and later and earlier in the winter.

Another, much simpler method would just be to install a wireless system that monitors the state of the door. and sends a signal to the house every minute or so indicating the state of the door. Inside the house, you could just set an alarm that squeals at you f the door is still closed after 8:900 AM or still open after 6:00PM.

How do you know all the chickens are back so that it's safe to lock the door shut ? You may want to install 2 sensors in a short path so that you can count the chickens entering and leaving. Then you won't risk locking out one that had a late date.

Experience is what you get when you don't get what you want.


   
Inst-Tech reacted
ReplyQuote
hilldweller
(@hilldweller)
Trusted Member
Joined: 2 months ago
Posts: 55
 

There are so many ways to screw up using stepper motors my vote goes to a DC geared motor. This is simpler to control as well, maybe as little as two relays. Relays are good too, hard to kill them and simple to diagnose.

Maybe a reworked car windscreen wiper motor ? + pulley + string.


   
ReplyQuote
KimSki
(@kimski)
Active Member
Joined: 3 years ago
Posts: 5
Topic starter  

Dear Ron, Will, Hilldweller, 

I would like to thank you already for the replies. i was on duty the last day's, so therefore my reaction today.
About the door, i can say that i will measure the weight tomorrow. It's a simple system. The wooden door is moving vertically in 2 guided profiles. The idea is to place a motor above ( or sideway"s ) and use cords to lift and lower the door. 

What Ron say's, is true. I've taught about the light sensor, but also about a timer. Perhaps even 3 systems in combination ( like the light sensor, timer clock, and a manual override switch). Or 2 systems, preferring the timer and manual override.

The entry of the door is good for 1 chicken only. Silkies are quiet small, so the door is also not to large.
But to give a beter idea, i will make picturesd tomorrow and post them.

O yes... Ron, i live in Belgium, KAPELLEN near Antwerp. So our meteo is quiet variated. In winter times often gray, rainy and dark moments. 

I also like the idea of couting the number of chickens, but want to start simple. Or... if you are convinced that it's not that big effort more, then i'm surely open for this option...

As promise, so, tomorrow more details about the weight and size of the door, with pictures of our silkies home...

 

many thanks to all...

And for the new year, wishing you a tremendous health, succesfull things in all what you do and a safe peaceful passage to 2024. 


   
ReplyQuote
KimSki
(@kimski)
Active Member
Joined: 3 years ago
Posts: 5
Topic starter  

As promised, following additional information and pictures.

The door weight is about 105Gram. The size is 21cm by 27cm height. 
The included pictures will tell more about the situation. But if i could choose, I would go for the Timer, and a manual open/close override system.

What's next then? That's my question to the specialists. What do i buy as components.
Which motor? Which reed switches? Which timer? and Which motor-controller and/or H-Bridge control board?

Happy to hear how it will go further.

 

Thanks in advance. 
Kind regards,

Kim


   
ReplyQuote
KimSki
(@kimski)
Active Member
Joined: 3 years ago
Posts: 5
Topic starter  
20230103 115237 resized
20230103 115327 resized
20230103 115257 resized
20230103 115338 resized
20230103 115356 resized

   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3926
 

@kimski Sounds good, but I will leave it to the experts to recommend which motor and controller board to use. The limit switches either mechanical or magnetic will need to be inclosed in resin to weather proof them. You will need some sort of power out there but likely already have that. Keeping track of the birds is tricky, RFID tags is likely the most reliable way.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
DaveE
(@davee)
Prominent Member
Joined: 2 years ago
Posts: 788
 

Hi @kimski,

  Sorry, mechanics is not my forte, and I suspect you will need to go through a few trials. A couple of things to look out for.

The door weight at about 100g is obviously low, and most small motors with suitable gearing could lift it in 'free space'. A concern I would have is the chance of jamming, and requiring a much larger force and sometimes a 'wiggle' ... all things you would do without thinking, when handling it manually. Obviously, if you supply a big enough motor, it is going to move, but you might consider providing a 'smooth' bearing like path to reduce your motor problems.

I would be concerned about using something like a windscreen wiper motor ... they can exert a considerable force, which could harm yourself or your birds. Also, if they stall, they are likely to overheat, if no protection mechanism is provided. Considering ex-car parts, an electric window motor might be closer to what you want from a mechanical point of view, but they too tend to be able to exert considrable force and would need a careful protection mechanism in case they got stuck halfway.

Stepper motors, although a little more complex to power, are far more controllable for slow, small movements, and with a little care when choosing voltages and controllers, will not be damaged if they are stalled. They would need to be combined with some kind of sensors to detect when 'fully open' and 'fully closed' ... and which combined with some simple software can also provide an alarm to say that the door is 'stuck'.

In your position, I think I would start with a simple 'mock up' of the door, and one of the small stepper motor and driver of the types you mentioned, plus your Arduino etc. , some microswitches or equivalent as position sensors, and see how you get on. (I assume you have seen Bill's (i.e. @dronebot-workshop) excellent videos on motors .. if not, you are on the right website to find them!)

Using cords to pull the door up and gravity to pull it down is the most obvious, but it might be more reliable if the 'cord' became a loop so that the door was driven both ways by the motor. Also, you might look at using a small drive belt or band, rather than cord.

Clearly, there is a degree of guesswork at the beginning, so I would start with small, cheap motors and see how it goes. There is a risk you will need to 'upgrade' the motors, etc., but if your initial outlay is small, then it shouldn't be too painful on your wallet, and you wil get a much better idea of how to do it 'properly'. And most of the software experience should transfer with minimal effort.

------

And for a free, crazy suggestion .... which may or may not be useful....

As for detecting whether the birds are in or out, I wondered if the PIR detectors that are often used for burglar alarms and automatic light switches would work (and readily available as sensors on small boards to connect to Arduinos) ... obviously they are usually aimed at detecting humans, but they might work at the shorter distances for smaller, warm, moving objects. Again, experiment and learn.

These sensors wouldn't count the birds ... merely indicate whether they could see at least one in the area covered by that sensor. So you would need at least two sensors, possibly more to avoid 'blind spots'. Also note, these sensors detect movement, so if the birds are near stationary (asleep), they will become 'invisible'. Obviously, this is not ideal, but it might be good enough ... e.g. if the door is shut, then the main need may be to detect a bird outside .. and maybe a bird outside is more likely to be moving.

---------

I wish you well with your project. Good luck! Dave


   
ReplyQuote
robotBuilder
(@robotbuilder)
Noble Member
Joined: 4 years ago
Posts: 1647
 

@kimski 

Have you looked at home made Arduino solutions by others who have placed their solution on the internet?

What about the door flaps used to let a cat or dog into or out of a house?

The electronics could set the door to swing both ways,  one way or the other or not at all (shut).

It could have a counter as well which could triggered each time the flap is used which would count up when the door swings one way and count down when it swings the other way.

Below is a cat door flap so a bigger one would have to be bought or built and the mechanics and electronics to control the four possible settings added.

You might also add a clock to the Arduino as well as a light sensor.

https://dronebotworkshop.com/real-time-clock-arduino/

To enlarge an image, right click image and choose Open link in new window.

 

catFlap

 

This post was modified 4 weeks ago 4 times by robotBuilder

   
ReplyQuote
robotBuilder
(@robotbuilder)
Noble Member
Joined: 4 years ago
Posts: 1647
 

@kimski 

Perhaps forget the dog flaps they will damage the chicken's delicate necks thus the reason they are not used.
https://pentagonpets.com/will-chickens-use-a-cat-or-dog-flap-door/

So I would look for a dc motor (doesn't have to be super strong). I see some using a battery operated electric drill so if you have an old one or can get a cheap second hand one that might be a good solution.

Once that is working by winding the door up and down you can think about how to control it with the Arduino.

 


   
ReplyQuote
KimSki
(@kimski)
Active Member
Joined: 3 years ago
Posts: 5
Topic starter  

Dear Arduino colleagues, 

In meanwhile i have bought a starters set and hooked up the Stepper motor. The motor turns left and right, with a configurable interval. Code taken from Bill's you tube tutorial. 
So, happy to see that the motor is working fine. The next step now is to choose a timer. But one which is capable to set a DAY program (Example MON till SUN : Door OPEN at 07:00 and door CLOSE at 17:00)

I would like to have a timer which has the easiest setup. Not a complex large code.  Just something simple and easy to install and easy to merge the code.

Also it would be nice to have already tips for the reed switches or microswitches. Which ones to buy?

 

As i work in shifts, i try to look as much as possible to this forum replies. 
Many thanks in advance.

Kind regards,

Kim


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3926
 

@kimski For your timers, you need to adjust them for the day of the year, maybe better to find a time source with dusk/dawn data then offset the open/close from that. Maybe NTP? or if internet is not an option then a RTC board.

Reed switches are triggered by magnets, microswitches are mechanical. I suspect in an outdoor environment with animals that the magnetic reed switch is the more reliable option BUT I would maybe have a second switch a microswitch beyond the normal travel as an emergency. That switch needs to be mostly enclosed and a plunger used. Just common sense.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3926
 

@kimski I just chatted with a friend who has chickens and other birds. He does NOT have any kind of automation and does NOT always close the door at night. He is in an area with a lot of predators. What he does is have a totally enclosed run for the birds.

He uses 1/2"/10mm mesh to stop rats, the mesh extends 3'/90cm out from the perimeter to stop critters from digging in.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3926
 

@robotbuilder The door is opened at dawn and closed at dusk. There is no need to operate the door during daylight hours.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Page 1 / 2