Automatic chicken door time input (low power, simple) - Page 1
Forum section: electronics / projects

author: Amper
author_rank: Frequent Contributor
timestamp: January 15, 2019, 01:09:22 pm
content: Hi!Im looking for some random ideas here, no perfect solutions for my problem but just a bit of brainstorming help.A year ago i built an automatic chicken coop door for my mother. It has to close and open a door every day and lock it reliably. Since its usually quite dirty around and i didnt want to play around i decided to mount two industrial pneumatic cylinders to the swing open door and since i dont want a chicken decapitator its powered by a small 12V air pump rather than a real compressor. The mechanical part works very nice for over a year now but the electronics were just bodged together by lack of time. I used a leftover arduino, and some chinese boards to control the two selenoids and the pump. Since i want it to be operated by everyone intuitively and i dont want to write a manual the adjustment of the "business hours" is currently done by adjusting an external line power timer that tells the arduino to open or close. This obviously sucks big time and im not proud of hacking stuff together like that. Also the continuous power consumption of the mechanical timer, the line relay and the arduino make me dependent on the grid.Its no big deal power wise but it sucks to have cables laying around in the dirt and also in a wooden house with hay and dust its a significant fire hazard.Since i have also built a few low power data loggers recently i decided that its time to change this thing. Power will be supplied by a small solar panel on the window and stored in two 400F 2.7V Supercaps (I also dont like batteries that freeze and/or leak when broken). The arduino will be kicked out and be replaced with just the ATM328, the selenoids need quite a bit of power (6W) and will be replaced by a second air pump. This way only very little standby power is needed (5uA for the micro is all) and the Opening / closing takes only around 100J each day.What worries me only is the adjustment of the times depending on seasons, weather and other needs. There has to be some way of telling the 328 two daily times in 24h format when to open and close. The obvious solution would be to add an oled display and an encoder, wake the 328 via pin change interrupt and have a menu appear. But i dont really like this idea for practical reasons of noone wanting to climb a ladder and change settings on a tiny screen. Also i like low tech solutions in these situations.The next idea was to use bcd coding switches but to put these directly onto the pins of the controller would take 10 pins even if i decided that i dont need minute adjustment. This will not leave open enough for the RTC and control of the door.Enough blabbering around on my side, do you guys have any nice ideas?cheers

author: nsrmagazin
author_rank: Regular Contributor
timestamp: January 15, 2019, 01:48:42 pm
content: This is easy, but the cables can not be avoided unless you have a heavy duty battery and you charge it at least every 3 months. Why not pass the cables with a good cable and outside isolation? Its a plastic square tube through which you pass the cables. Its the best solution to me, you don't need to pass them through the ground, it can be through the roof.

author: mycroft
author_rank: Regular Contributor
timestamp: January 15, 2019, 01:51:02 pm
content: How about two pontentiometers for the opening and closing times? Put a hand written scale and it is done.

author: rhodges
author_rank: Frequent Contributor
timestamp: January 15, 2019, 02:12:18 pm
content: I was thinking about using a table or equation to adjust the open and close times every day, to follow the day and night cycles. The solar cell might give a useful signal to help this.I like the suggestion of two pots. They could be for absolute times, or offsets from the internal day and night times.

author: nsrmagazin
author_rank: Regular Contributor
timestamp: January 16, 2019, 10:42:52 am
content: For absolute times the pots are the best option. You should mark the pot setting so you can use it again afterward.If you want to do it with the changing of the light, you can use an IR LED with a comparator. You can still add pots to the circuit to make it calibratable.Here is an example(exclude the white transmitter IR LED, it will be replaced by the day and night sunlight unless something blocks it like a leaf or other).http://elonics.in/breadboard-projects/infrared-ir-proximity-obstacle-sensor-using-lm-358With absolute settings(which is better) you need to remove the IR white transmitter LED. Remove the black receiver IR LED and add the input voltage in the place of the black receiver IR LED.A digital clock with a timer 555 would be an option too. The clock counts 24 hours and on certain hours it does something.I guess you don't want to go in the dark and check the chiken's door, if its because you are afraid of something its a dog you need.

author: Amper
author_rank: Frequent Contributor
timestamp: January 16, 2019, 12:18:16 pm
content: Thanks for the suggestions!Running cables cleanly would be no issue, thats true but things are already cluttered enough and since the transformer in our doorbell almost burned down the house this summer i really dont like the idea of anything being plugged in constantly when its not really needed for reasons of high power. Using batteries i considered in the beginning but as i know my peers they will rather shut the thing manually than change themalso in that case it would need reliable indication and battery warning wich is not really easy when noone is actively checking. maybe some Flipdot or E-Ink display not needing power in standby.Pots are a solution as well, yes. Even though i dont really like analog to adjust digital things. But the simplicity is definetly a reason for it.Adjusting for the date automatically would be nice too, it shouldnt even be difficult since the RTC has a month output anyways so i dont even have to do the calculation myself. The downside only would be that.The light sensing option i actually like a lot but i wonder if i can calibrate it presicely enough. In the morning and evening hours depending on the month the changes in brightness may vary a lot. Even the weather will make things difficult. Maybe ill first of all install a light data logger and check how reliable it would be that way. Probably a combination of both will be best.The main reason for all of this is when no one is home. or in summer on weekends when its just very nice to stay in bed instead of getting up and opening the door at 5am. It has to be closed at night because we previously had problems with foxes and even large birds of prey getting in and killing chicken. Also the door is large enough for our leonberger so in winter it is an issue of loosing heat.I guess for now i will get it to run on rtc and fixed times to get the power supply working and then add adjustments later after doing light measurements.

author: cowana
author_rank: Frequent Contributor
timestamp: January 16, 2019, 02:08:21 pm
content: Is there a reason not to use sunrise/sunset times?If you have an RTC (and know your latitude/longitude), it's fairly trivial to calculate the time of sunrise and sunset. Pots could then be used for how much before/after these events happen that the door actuates.

author: Amper
author_rank: Frequent Contributor
timestamp: January 16, 2019, 02:56:06 pm
content: Yes, thats on my list of things to try as well. Im just still not sure if its good to keep using hard timing because i cant risk locking animals outside over night. They are more or less pets and not livestock, so it would be horrible to loose one while trying stuff or doing some sub optimal thing. The perfect solution would be to rfid tag all of them and close the door only when all are inside but i guess thats a bit much for nowHere is a video of the current setup just for a reference and maybe someone is interested in my way of doing it. Please ignore the dirt, its winter time and birds are ... messy ...https://youtu.be/H2Bx83tGSnA

author: NivagSwerdna
author_rank: Super Contributor
timestamp: January 16, 2019, 03:06:13 pm
content: FWIW.... I spent a while looking at the construction of my...https://www.flytesofancy.co.uk/chickenhouses/VSB-Automatic-Door-Opener.htmlThis is a commercial unit but has some interesting design decisions... firstly the sliding aluminum door works well although it is 'locked' by gravity only.The VSB approach to door opening is that you use a light sensor and/or a timer... (I just use a timer). The circuitry is very simple, basically just CMOS comparators and a few NORs attached to a motor with reed switch sensing for the open/closed positions.In respect of opening times... In my experience you want to open some time AFTER dawn during spring time since Vixens will be out and about around Dawn when it is time to provide for their new cubs....The standard commercial timer is this...https://www.flytesofancy.co.uk/chickenhouses/Digital-Battery-Timer-for-VSB-Door-Opener-Unit-BTVSB_D.html#SID=828Again has some nice design features... e.g. LCD segments for open/close and lasts for 4 years on 2x AA.(If you are a masochist you could also read some of my musings athttps://www.eevblog.com/forum/projects/4-aa-cells-direct-to-pic/)

author: Amper
author_rank: Frequent Contributor
timestamp: January 16, 2019, 03:19:04 pm
content: Oh wow, i didnt expect anyone here to have done something that similarIll definetly have a look.I chose to go with the pneumatics since the door was already done this way and i coulnd change the construction of the large 4*4 meter ones just for this. Also the cylinders were laying around looking for some application which meant i didnt have to order anything. The original setup was done in a day because my mother had to leave the house unattended for a few days without much time for preparations.Since i now have a quite large 20W solar panel im actually thinking about using it for some other stuff too. Maybe put a 12V outlet near that can be hooked up to lead acids in gardening vehicles for saving them in winter. Or a AA battery charger. That way i can also do away with the LTC3105 and LTC3110 i wanted to use for the supercaps.For the sake of adaptability i will stick with the 328 though and not go for hard logic. I might have applications outside of chicken keeping for this system and with a small LDo the power consumption is really low.EDIT:Here is a pic of a datalogger that could almost be used. Its very low standby power and can log strain gauges, 4-20mA industrial sensors, air pressure and temperature. This is where the chicken door parts of power supply could be implemented as well to make it completely off grid and mount it on the source of our hydro power plant to measure stuff in the forest. Atm its supplied with two lead acid blocks because the 20mA actually needs a bit of oompf compared to everything else. Not really winter cpaeable.

author: Ian.M
author_rank: Super Contributor
timestamp: January 16, 2019, 03:51:29 pm
content: Quote from: Amper on January 16, 2019, 02:56:06 pmRFID used as you describe would be a really *DUMB* idea. If a fox gets one, the henhouse door wont close till that tag goes past the sensor, so at best the fox has free access, or at worst, if the fox swallowed the tag, it'll lock the fox in with the chooks!OTOH a remote alarm in the house that goes off if the system hasn't logged in all the tags by door closing time could be worthwhile. RFID bird rings are pretty cheap, but you'll need two sensors with a tunnel between them to make sure the chook goes past both so you can determine whether the chook is going in or out.As for setting the door timer, consider a battery backed RTC module mounted in a plug shell that can be taken up the house and programmed in comfort, to set its clock, and also set parameters stored in the RTC RAM for opening and closing times. e.g. Your code could calculate sunrise and sunset times from the RTC calender then apply monthly offsets for open and close times stored in 24 bytes of RTC RAM.Another option would be a weatherproof exterior button you could press to enable a Bluetooth module for the next five minutes (as leaving it on 24/7 would probably be too power-hungry), then use a custom app on your smartphone to change the door settings.

author: Amper
author_rank: Frequent Contributor
timestamp: January 16, 2019, 04:04:31 pm
content: Mh, the fox stealing a tag is something i havent thought of xD Also yes, it would be difficult to implement. My idea would be to put the reader not on the door but to the ladder were they sleep. The downside obviously is if one decides to sleep somewhere else or sit on the eggs it wouldnt close. Those are the reasons why i decided not even to look at rfid as it would only produce more problems than it solves.An app or module would be a little overkill, its not that uncomfortable to stay in that place. I just want to reduce the effort to a minimum. I noticed from movement sensored ligts in and around the house. Some had really horrible settings and turned off after only seconds. Still i would rather be pissed off over several years and wave my arms in the air to get the light to turn on again than to just get a ladder and a screwdriver and adjust the stupid thing. Thats what id expect if setting new times is more work than just opening the lid and turn a knob. Just horrible laziness but thats how people work...Also i really love machines that work without attending to them. Its absolutely facinating to have built something that does its job without any human interaction for years or even decades at a time. Just really satisfying.

author: nsrmagazin
author_rank: Regular Contributor
timestamp: January 19, 2019, 09:17:41 am
content: Your option is good, but unnecessarily powerful. If these are pets that you care for, you should know that chickens are not from the smartest animals, they can't get back inside after more than a few meters of distance and when it begins to get dark they just snug somewhere and fall asleep.You can try these options, i have not tested them so I don't know how well thye work.https://electronicsforu.com/electronics-projects/hardware-diy/daytime-running-lights-controllerhttps://www.instructables.com/topics/How-do-I-make-an-automatic-door-openercloser-for-/A solar cell might be a better option than a sensor, but they produce current, not voltage.

author: Amper
author_rank: Frequent Contributor
timestamp: January 19, 2019, 06:50:44 pm
content: Thanks for your concern ^^The cylinders look huge but the pump behind them is using only 2W of power, no worries of crushing a chick. They have 200x200m of space to run free but so faar they have pretty much always come back, usually even before its dark.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: January 19, 2019, 10:43:31 pm
content: The predominant mechanisms for chicken scoop doors seems to be 2 cantilevers and a small winch.The winch rope is connected to the canilevers which get unlocked if the winch starts:For the timer you have a multitude of options.There exists a sun up/down algorighm, just plug in where you are on this sphere but it has a bunch of sines and cosines.Much simpler and good enough would be 2 tables with sun up / down times for the first of each month, with a piecewise lineairly interpolation.Add a light sensor, with an algorithm that changes the open/close times at most most 10 minutes each day.For more fancy algorithms you can monitor the actual behaviour of your chickens.With a sensor like the VL53L0X you can measure if chickens are entering or leaving through the door and you can count them, and only open the door in the morning when the chickens want to get out (or anticipate half an hour earlier).But that sensor might get dirty, maybe use 2 for redundancy?You can also use a weight scale and put that near the door opening.Put something above it, so do don't accidentally step on the scale yourself, which would ruin a 5kg or 10kg kitchen scale.HX711 is an "arduino"-esque chip. Cheap and easy to interface.With a search for "chicken scoop door" on youtube you can also find purely mechanical systems.No electricity.They work by using the pole the chickens sit on and a lever.If all the chickens are sitting on their pole it is heavy enough to tip the balance and the door is closed.With the electronic sensors it is probably a good idea to monitor the behaviour of the chickens for a few days.If they walk (wobble) in and out of the door during the day, you can use that to auto callibrate your timing intervals.If you want to go real fancy you should add redundancy. Use 2 uC's which check each other behaviour.If you use an ESP8266 you can connect to WiFi and send an e-mail if a malfunction is detected.(You can extend the range of WiFi with a Cantenna, but put it under an angle, so do don't irradiate your neighbours).ESP8266 is fun to use, cheap also.The "Wemos D1 Mini" boards are compatible with the arduino environment. I've written a small demo program with them and platformio in half an hour. But you have to be carefull with these. ESP8266 is 3V3 only and is easily damaged by overvoltage.

author: soldar
author_rank: Super Contributor
timestamp: January 19, 2019, 11:03:39 pm
content: Sunrise and sunset times can be easily approximated with a simple function but from one day to the next there can be a big difference in light if one day is clear and the other is heavily overcast. There can be an hour's difference in light conditions. If you want to get fancy you can combine ambient light, sunrise/set times, temperature, etc. to decide.If you really want to use minimal electric power you could power it with compressed air from a bottle and just need a couple valves which would use close to nothing. You refill the bottle with compressed once or twice a month. This has the advantage of not destroying the chicken coop with a fire. Maybe an explosion but not a fire

author: Amper
author_rank: Frequent Contributor
timestamp: January 19, 2019, 11:37:51 pm
content: I have thought about making a guillotine door in the very beginning but its just not really doable in my place. Its just to large ( 40x50cm) because of our dog (leonberger, size and weight close to a human). Also while locking mechanics are simple im afraid of something getting stuck. Just a little dirt or some water making the wood swell will be enough to jam the thing completely. Then the limit switches wont help either, the winch motor will be pulling as hard as it can for as long as the power is there or in case of grid power it might get hot. This means without current monitoring and redundant limit switches there is no way. I want this thing to be maintainance free as much as possible, not checking for stuck wood pieces every few days. The mechanics have also been working with absolutely no problem for more than 500 days now, im quite happy with it. No limit switches that fail, no string getting tangled. With a winch if the limit switch will fail the thing will wind up the other way and the door will stay open. If the String breaks in the wrong moment and i have a heavy locking door it will chop a chickens head off easily. My dad had chicken as well when he was a child and it was a guillotine style door. It was fixed by a string and some day he held it in his hand and slipped off in the right time to have some tasty soup the next day. I dont want to be responsible for that.The time calculating by table and functions is all well and dandy but only when you live on a perfect sphere. We have hills nearby, large trees, there is weather happening and many many other factors. As soldar said, its not that easy sadly. Combining many factors would be nice but to be honest i wouldnt be sure how to do that in a predictable fashion. I could either use simple logig "when brighter than y and time after x .... open door" but in that case i could just go with the one real variable light and ditch the rest of it. It would need some "intelligent" calculating and predicting but i think thats a bit to much work to implement and especially verify for such a small project. You can see in the video posted last how simple other people go about it. Im pretty sure he didnt even think about light threshholds and hysteresis like me, he just used "a light switch" and put two building timers behind it. Seems to work.About sensors to monitor the animals im not sure how to do it and if its really possible. We have scratched that topic when talking about rfid. A time of flight sensor can only tell me if there is some animal standing in the doorway. How should it know in which direction it will hop? What about small birds flying in, what about two chicken in the doorway at the same time. It would need a tunnel barely enough to fit one of them so its possible to determine exactly whats going on. Same applies to having a scale in the ground besides the heavy dog and water + dirt. Sadly not a practical solution. Weighing the ladder they sit on would imply that they weigh the exact same every day. We have roughly 10 of them so it comes down to a weight change of 10%. Assuming one is sitting outside and the other 9 have eaten a lot in the day, one will be locked out. Assuming one is sitting in the nest on the eggs, the door might not close all night. Wifi and Bluetooth are cool but i really f***** hate IOT for security reasons. Our living room is right next to it and if i do need to check manually anyways i can just look at the door or have some led light up if there is a failure thats detectable. Also the Power management would be completely out of the window at that time.Sadly things are not as simple as just throwing sensors on the problems ^^I have thought about storing compressed air a lot actually I really like the idea. Problem is if i will use high pressure like the usual 8-10 atmospheres of an air compressor it will be empty very quickly through even small leaks and a refill will mean my mother needs to get the compressor set up and refill ist and then put all the stuff away again. No Problem but a hassle if the alternative would be changing AA batteries every few months. Though one thing possible would be to store low pressure from the small pumps over the course of a day and refill it just by solar with no batteries. Saaaadly the biggest consumer of electricity in the current setup are actually the selenoids. They are industrial 24V types and even though they are the smallest usual size they use 6W of power each. For comparison the Pump needs only 2W while operating the door like seen in the video. Thats the reason why i will soon kick them out and use a second pump, one for each side of the actuator. A Servo valve could be a solution though, It can be build relyable with common RC servos and a festo ball valve. But sadly its not that much of an advantage once i have to modify the thing anyways.

author: soldar
author_rank: Super Contributor
timestamp: January 20, 2019, 12:23:34 am
content: Making the guillotine door reliable is very easy. Just use metal or plastic or whatever. If the coop is not too far from the house you can lead a nylon thread to your bedside and close the door manually before you go to sleepYou can install an IR CCTV security cam so you can see and count the chickens before closing the gate.Calculating sunrise/sunset, altitude above horizon, etc is trivial for me knowing latitude and longitude but requires trig functions and you probably do not need such precision. Still an approximation is easy to implement and should be good enough. You can use only light but there is a small risk of it closing in the middle of the day if it gets very dark.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: January 20, 2019, 12:39:06 am
content: It looks like you're in a defending prosition and in a mood to reject any possible solution, instead of thinking a bit of how these general solutions can be used to fix your particular problem.For example, the sunset / sunrize algorithm is easily found on the web.If you're not content with a montly table for piece wise interpolation, use weekly piece wise interpolation.If you don't want to use WiFi for problem identification, use a bloody blinking led if you're nearby.Why would the guillotine door be prone to error? Yeah sure, if the mechanical part is executed poorly, (Wood that bends when it's wet etc), but when done properly it can easily be very reliable, and it is cheap to build. Problems with the string can also be compensated for in a multitude of ways. You can add an encoder to the motor, test wire tension or simply put the string in a loop so it can pull both ways.If you're even a half decent engineer you can make a shaky bit of hardware work reliably with some inventive thought.I'm glad for you your mechanical stuff works reliable, which is not much of a surprise when using industrial quaility air cylinders, but you probably had those lying around somewhere and they are probably too expensive to be a general solution for many other people.

author: Amper
author_rank: Frequent Contributor
timestamp: January 20, 2019, 01:41:47 am
content: Hi!My problem is very specific and i have put quite a lot of thinking into it. Im just not interested in solutions that will make the problem more difficult than it already is. So far it was literally a one day build with stuff i had laying around at my parents house. I like simple solutions much more than complicated mechanisms and tons of sensors just because its a simple problem that doesnt need them. Im Certainly able to do engineering better than you think i can, im in power electronics making kW sized bldc controllers, building small jet engines (not the tin can kind but actual working ones) and drones ("before it was cool" beginning in 2008 when there was no commertial parts availlable at all). Im very comfortable with both mechanical and electrical engineering but that doesnt mean that i like to over complicate things. The title of this thread ends on "(low power, simple)" and that is actually more difficult to achieve than you may think. I dont really see why i should start studying and statistically analyzing chicken behavior to train mm wave sensors, add wifi and webcams to close a stupid piece of wood that just needs to shut and open at two set times a day. If i wanted that i could just hang some raspberry with a webcan there, build an app and control it from the other side of the planet but thats just not what im looking for. The question also never was about mechanics so i just dont get why you had to start telling me how to fix something that is already working perfectly where id need to invest a day to rebuild the entire thing to get null benefit.Sorry to be rude but actually it was a bit offending to be assumed some noob just becuase i dont like overcomplicated solutions for simple problems. Your solutions surely would work but they are obvious and not new to me. Im looking for something better than my current ideas that will not make the thing more complex to operate and maintain, wont need a mechanical rebuild and doesnt draw any power requiring external sources especially grid power and a working router nearby.//endrant@soldarThe Problem is that i cant fit a guillotine there, the large door to the outside in which the small is fitted is not something im allowed to hack up or bolt much things to. A Slider would need to go up to one meter where there is other stuff in the way and no wood to fit pulleys and motors. If i had built an entire coop from scratch i probably would have gone that way. Also its already the basement of our house, so if i were home i would not even need a string to operate itIts just reeeeeally comfortable to stay in bed in the morning and have it open without waking up in 5. Also as sad before, the initial reason to build it was absence of anyone for a few days at a time or when my mother has to work in winter and its already dark for a few hours before shes home.

author: Ian.M
author_rank: Super Contributor
timestamp: January 20, 2019, 02:53:56 am
content: Wasting a whole air cylinder for the deadbolt does strike me as a bit excessive, but if that's what you've got, then why not? Its certainly better to have a well proven mechanism, and 16 months of successful operation qualifies. I would recommend adding some sort of 'trapped chicken' sensor on the edge of the door or doorway that stops and reverses the door if there's any obstruction while its closing before it reaches the fully closed position. A dowel mounted between the levers of two lever arm microswitches such that the vertical edge of the door just clears it when closing might be suitable, though as the door has a raised threshold, you should probably put a sensor for the bottom edge as well.As it isn't an outbuilding there's no point in trying to economise on power consumption past what's simple and easy. There's mains power available not too far away so simply float a SLA using a traditional linear supply for long life and reliability to power it all and concentrate on improving the algorithm for the door open/close times and the UI for adjusting it. Any electrical system with stored energy is a potential fire risk, but a suitably fused low voltage one is a minimal risk due to the low energies involved and the greatly reduced risk of insulation breakdown.On the UI side of things, why not move the Arduino down to a reasonably accessible position and fit it with a RTC module, a LCD shield and some buttons to emulate the operation of the mains timer that your users are already familiar with?None of the chicken sensor ideas appeal to me apart from individual RFID leg rings. That + two readers inside and outside of the door just far enough apart that they don't interfere with each other, so for any specific bird, if the inside sensor was the last to see the tag, you know that bird is in, and similarly for the outside sensor and out. However, as I mentioned earlier, doing anything except raising an alarm if one is missing at closing time is counter-productive. You still need to close the door to safeguard the other birds, and certainly don't want to open the door again during the night for a fox with the tag in its stomach.

author: Amper
author_rank: Frequent Contributor
timestamp: January 20, 2019, 01:54:56 pm
content: Yep, the second cylinder is excessive, i would not have done it if i dint have a dozend laying around with no use anyways. Im pretty lucky to have a good source of free "scrap" like that so it was no concern to overdoo it in that case. Also this way i didnt have to make any mechanics like deadbolts or latches, just put the cylinder there with a few more screws. It also made the controls simpler the sequence of locking and unlocking is done by a single pneumatic momentary switch on the door, when pressed the locking cylinder is activated, when not pressed (open door) only the moving cylinder is supplied so they can be operated like a single one. Also no cables and plugs that require soldering in the cold and dirty barn, polyurethane tube is cheap and is replaced, shortened or extended in a matter of a minute or two with no tools required, it will also survive being pinched in the large door or ripped out by accident. The trapped chicken sensor is not really necessary as i only supply roughly 500mBar wich translates to around 15N in the cylinders used. After having the geometry of the linkage there is no risk at all of hurting any animal. If i used high pressure supply id just add a pressure regulator (thanks scrapheap of my university) and limit the force that way.economizing power mostly is just a wish of mine, it just feels wrong to have something plugged in all day without doing anything. Also as said before im a bit paranoid about anything grid related. Cheap chinese switch mode supplies are actually the number one cause of house fires in my country and i didnt have good experience. I have Industrial 24V supplies but they are overkill and have quite a lot of standby power. The next socket is almost 10m away and i would have to run ducting over the wall and ceiling to reach it, so while its possible and im doing it that way at the moment im just not happy with this situation. A small cap bank of some few hundred joules to survive a few days with no sun would be ideal. Its low voltage contained in a housing, fused, cant leak, wont freeze and should last a few decades without degrading.One idea you just gave me by "simulating" the old UI is actually to go back to the simple way of using pots. The old one is mechanical, so its similar and thinking about it, it has incerements of 15 minutes. The atmega will have roughly 90s of resolution when i spread 24h over its entire range, so thats plenty fine enough for my application. Previously i thought for good resolution id need four pots, one for minutes and hours of each set point but i dint even bother estimating if one would be sufficient.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: January 20, 2019, 07:06:23 pm
content: Ok, so you want simple, got it. You could set your timer up to go for 12 hours then open the door or if solar panel sees sunlight. The start timer could be a simple limit switch when the door closes. The test is to see if there is sunlight on your solar panel (connect the panel with a schottky diode to the caps or battery), take your 'sunlight' voltaage reading on anode side of schottky, for reading from the solar panel when it starts charging. If it sees sunlight, open the door and reset the timer to start when door closes again when it is dark. You can adjust the 12 hour timer to whatever it is in your latitude for night time hours (or adjust twice a year).Hope this helps...

author: cdev
author_rank: Super Contributor
timestamp: January 20, 2019, 07:19:49 pm
content: You could use Raspberry Pi "deep learning" based object recognition software to identify and count the various animals,as well as keep track of the time, actual brightness, etc. You could use a body of photos of your actual chickens, as well as photos from Google Images of foxes, hawks, dogs, as well as permitted humans, and others, to train it.Then you might be able to use that data to decide when to close or open the door or raise an alarm, or even blink flash tubes. It could also send an SMS to you and other family members to tell them if any of your known chickens were missing from the coop, or if any recognized or unrecognized animals or humans, even, had been seen, along with photos of them.Note: as my post was originally making the same suggestions as had been suggested earlier, I edited it.

author: Amper
author_rank: Frequent Contributor
timestamp: January 20, 2019, 08:17:48 pm
content: Guys really, i appreciate you giving me advice but have you read even a bit of what has been written previously ?I really dont want to offend because you are all really nice and stuff but we have been talking about rtc, time calculating and light sensing all day long now and you suggest it to me like no one has ever thought about it before? i dont expect anyone to read through all of the posts but you could just go "CTRL-F" and search for "RTC" before posting if you havent read the old posts.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: January 21, 2019, 11:15:31 am
content: I haven't completely read the thread but I do notice...Accepted you don't have the geometry for a sliding door... however you seem to assume this needs lots of power... my Aluminium sliding door opens and closes every day and I only have to change the 4xAA batteries every two years or so.If you want a RTC.... A DS3231 module is hard to beat value wise... I actually buy them just for the parts which I transfer to my own PCBs. The 1Hz output can be used to wake from sleep if required. Like any clock there is an error... but it is small.... however you open up the can of worms that is setting the clock.

author: Amper
author_rank: Frequent Contributor
timestamp: January 21, 2019, 12:39:47 pm
content: Oh, im sure sliding doors take less power but its just mechanically not possible in the location im in. Also as i said the mechanical part is not a problem at all, its working perfectly fine with very little power. one AA battery contains roughly 10kJ and assuming ill use 4 and it takes 100J a day with my existing door a set will last around one year ignoring self discharge and disadvantages at low/ high temperatures. Though thats exactly what i said in my original post. My problem is not a power source, that was never an issue, just everyone thought it was. Also setting and operating the rtc never was an issue to me, just look at my picture of the data logger at the first page, i have done all of this before. My issue is only how to do manual setting of the opening and closing times without damaging my power consumption or making a lot of effort in programming easy to use UI with a lot of changes in power management to get my standby current below 10uA again.

author: spec
author_rank: Frequent Contributor
timestamp: January 21, 2019, 12:59:12 pm
content: Hi AmperWhat fun this thread is. We used to have four chickens and good layers they were. They were very much creatures of habit and would start getting anxious when the sun started going down and go into their coop for the night. And at sun-up they would be fussing to be free in the garden, especially as we spoilt them to hell with little treats. They were battery hens rather than mains and when their feathers grew, I taught two of them to fly a bit.I too have thought about a solution to Mr *&%#! fox and the best low-tech approach that I came up with, is to have a medium size, but aggressive dog living with the chickens to look after them. You would not need to worry about locking doors or anything else then.An alternative approach is to have the chickens unlock the door themselves- don't laugh...yetSo how does the chicken operated lock work:Chickens are not the brightest of birds, but they are not totally dumb either, especially when food is concerned. So what I table is two pads, one just outside the door and one just inside the door, which the chickens have to peck a number of times before the door opens. Of course, a new chicken would not know what to do, but it would not take long for them to learn, especially if their food is in the coop. I was going to try this approach out, but our chickens left for a posher neighborhood before I got around to it. But I did try out a few similar tasks for them to carry out before they got a treat, and they managed without any problem. They weren't very good with simultaneous equations though.The actual keypad could be made so that only a chickens beak could operate it, so that any smart-arse fox, even if he knew the code, would not be able to operate the lock with his paw or nose, but I think it is unlikely that a fox would figure out how to operate the lock anyway.I will get my coat now.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: January 21, 2019, 02:37:54 pm
content: In my other thread I devised, aided and abetted by Ian M et al., a device that extended my door gadget to allow manual override of the door opening times... it has two buttons, UP and DOWN (with LEDs in the buttons),,, allows.. UP (until next close), UP(always), DOWN(until next open), DOWN(always) by either a short or long press (and the ability to cancel a currently working override). Seems that such a combo could be extended to allow an UP to set the opening time everyday and the DOWN to set the closing time every day. So the user just needs to be present once at OPEN time and once at CLOSE time to set the system.https://www.eevblog.com/forum/projects/4-aa-cells-direct-to-pic/msg1219663/#msg1219663

author: Amper
author_rank: Frequent Contributor
timestamp: January 21, 2019, 03:43:29 pm
content: Thats actually a really sweet idea! Also it will work very nicely when some day the battery in the rtc fails because it wont care about the absolute time. ill consider this! Also it would make it really easy to write every "correction command" to an sd card so after a few months or even a year i could get a graph and know exactly which times will be suitable for closing.The chicken training method sounds fun as well, just im afraid they will sit at the door all day expecting foodAlso sadly we have a bunch of mice and sparrows round, they will likely learn it as well and roam the place at night.EDIT:Also a litte OT: There is a children's book in wich chicken are solen by a fox so they build a chicken from a pepper filled balloon attached to a bunch of fireworks:

author: Ian.M
author_rank: Super Contributor
timestamp: January 21, 2019, 04:49:41 pm
content: Yes, NivagSwerdna's learning by doing idea is probably the simplest. Just add a button to store the last action as the new opening or closing time so you can still use the other buttons for manual override as required.It will be a PITA setting the clock in the first place, which you need to do if you want auto-adjustment to track sunrise/sunset so you dont have to tweak its hours so often. Either make the RTC battery backed and removable so you can preset it before you plug the module in, or connect a laptop or tablet with a terminal program to the Arduino, and set it that way.

author: Amper
author_rank: Frequent Contributor
timestamp: January 21, 2019, 05:08:22 pm
content: I just do that by putting the example sketch on it wich sets it to the current time when it was compiled. Thats not accurate to the second but enough to me. Downside is i need to redo it when i replace the lithium battery but maybe for that purpose i can add a jumper that when set will put time and date to a known value so i have so reference. It should last around 10a, so its not something to worry about for now i guess.

author: nsrmagazin
author_rank: Regular Contributor
timestamp: January 22, 2019, 06:38:01 am
content: This became another thread with unnecessary complications.While you are on it, why don't you put a wifi module so you can check remotely and a chicken counter too.....Just put a solar cell or a light sensor to a comparator with a potentiometer on the other pin, and use your own system that you have now.

author: Amper
author_rank: Frequent Contributor
timestamp: January 22, 2019, 09:12:16 am
content: Please go somewhere else for trolling, i had enough of it in this thread.

author: nsrmagazin
author_rank: Regular Contributor
timestamp: January 22, 2019, 01:49:40 pm
content: Why am I trolling?

author: Ian.M
author_rank: Super Contributor
timestamp: January 22, 2019, 02:29:27 pm
content: You appear to be trolling because the O.P. has already considered and rejected wireless connectivity, tagging, counting and weighing chickens etc. If you are not trollng, then either you are too lazy to read the whole topic before commenting, or you lack reading comprehension and short term memory!One point that has not been considered by those who advocate a simple light sensor, is: Adult humans in developed countries typically set their daily routine by the clock. Its undesirable to open the coop too early before humans are up and about, even if its well after sunrise due to the risk of an over-bold fox!

author: Amper
author_rank: Frequent Contributor
timestamp: January 23, 2019, 12:36:22 am
content: My apologies, i misread your post after what happened here before...Your idea with the comparator and timer is nice and light sensing is still in the race. Though since i need the microcontroller anyways for coordinating pumps and valves i wont have to build it the old school way. Just throwing in one or two lines of code will be faster to me than building a new pcb, programming i can do in my college dorm or in the train and then just upload it when i arrive home.Using the solar cell as light sensor will propably be done as well since im interested in the power production anyways for other projects, so i will have a shunt in there and measure over the day.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: January 23, 2019, 03:15:16 am
content: Well, you said you were asking for random ideas in your first postAnd how would anyone know to search for "RTC" if they did not read the post history?

author: Amper
author_rank: Frequent Contributor
timestamp: January 23, 2019, 10:23:09 am
content: Well yes, i guess i asked like that. I dont expect anyone to read everything, thats obviously to much but even in the very first post i mention that im using an rtc for example. It just seems like people only read the title and then post what ever without considering at all that they are the 5th person by now suggesting the exact same thing that is also specifically excluded in my question.Im still very happy for all your suggestions just at some point i got a bit frustrated...

author: soldar
author_rank: Super Contributor
timestamp: January 23, 2019, 12:46:36 pm
content: Search youtube for "chicken training"and you will be amazed how chickens can be trained to do a lot of things, including come home when called.

author: soldar
author_rank: Super Contributor
timestamp: January 25, 2019, 09:47:05 am
content: You could combine the door opening and the lock actuators into one. Have it actuate on the door along a slot and a spring. In the drawing it is locked. Then the actuator starts moving back and unlocks. Finally it reaches the end of the slot and starts opening the door. For closing it is the same in reverse.

author: Amper
author_rank: Frequent Contributor
timestamp: January 25, 2019, 11:32:25 am
content: If i understand it correctly opening would work but on closing the latch would hit the ring because there is nothing to compress the spring. Its possible of cause to get rid of one cylinder by nice mechanisms but i really didnt have to because by connecting them in the right way and adding a pneumatic momentary switch i still only have one air line for opening and one for closing. The hardware was leftover scrap anyways and its nice not to have it sit in a box unused until some day ill throw it away.

author: Ian.M
author_rank: Super Contributor
timestamp: January 25, 2019, 12:57:10 pm
content: No, I think Soldar's drawing shows a bracket on the door retaining the spring. Therefore the spring force is available to close the door. However if the hinges get even a little stiff, the bolt will protrude before the door closes, stopping it locking. Also it needs a hinge joint where the piston rod connects to the bolt or it will jam on opening.As you've got a well proven mechanism and plenty of spare parts, much as it hurts my parsimonious nature, I am forced to agree that changing it is not worthwhile.When you do get done with this, please update the topic with schematic and code. Even if others will have to mod the design for different door openers, its still valuable.

author: Amper
author_rank: Frequent Contributor
timestamp: January 25, 2019, 02:54:13 pm
content: I will!

author: soldar
author_rank: Super Contributor
timestamp: January 25, 2019, 03:05:53 pm
content: Quote from: Ian.M on January 25, 2019, 12:57:10 pmYes, the bracket with the slot is attached to the door.Quote from: Ian.M on January 25, 2019, 12:57:10 pmYou can use a spring as stiff as you want so this should not be a problem. Plus hinges with a drop of oil should go smoothly for years. you could substitute a slip latch which can be closed without being pulled back. A more likely scenario is a stick or a pebble prevents closing.Quote from: Ian.M on January 25, 2019, 12:57:10 pmWell, yes, from the beginning this was a general discussion thread on the topic as it was clear the OP was satisfied with what he already had. So I think the discussion might be of interest to others pursuing similar solutions.

author: Amper
author_rank: Frequent Contributor
timestamp: January 25, 2019, 03:18:22 pm
content: Yep, suggestions and general ideas are welcome if not repeated a ton of timesWith the slip latch i agree it would work but with a simple spring loaded slider thespring has to hold the latch closed, so when closing the bold is already extended and will hit the hole from the outside. When the spring is loaded the other way pushing the latch open it will operate nicely closing and opening but when air pressure is relieved it will push the latch open.