Javascript required
Skip to content Skip to sidebar Skip to footer

Chicken Coop Door Arduino Int Photopin = A0 Error Code

Components and supplies

Necessary tools and machines

Apps and online services

Ide web

About this project

Introduction

If you like fresh eggs for your morning omelettes or your bakery projects, owning chickens is really the thing to do! On top of the good company, they provide top-quality eggs and are of very little effort to take care of.

As you might expect while living in the countryside though, all type of animals from the food chain can be found, and so are foxes. These guys love chicken-based dish and it can literally be a disaster if one manages to get inside your chicken coop.

To prevent foxes from making a mess in your chicken coop, one must be able to close safely the door overnight to protect the chicken from the ferocious predators!

The chickens are free to go out during the day and enjoy fresh air and grass (despite what the above pic shows), but must really go inside to go through a safe night sleep. They are doing it by themselves already, but the door needs to be opened/closed manually every morning/evening.

If you forget only once to close the door overnight, you are very likely to find your chicken eaten by predators the next day.

The project

After being self-initiated with Arduino during Covid-19 lockdown using the "beginner kit", I was looking for a first project to practice on these new skills. This door seemed like a good case to be automated... it was really annoying doing in manually every morning/night and there was of course a risk of forgetting it and therefore endanger the chickens.

The idea was very basic: being able to automatically pilot the chicken coop door :

  • open the door in early morning so the chickens can get out enjoy the fresh air
  • close the door as soon as it gets dark so the chicken can rest safely overnight

How it works

Once plugged to the battery, the door will initiate by opening. By pressing the switch, it will either open/close depending on its state. As soon as the light is too high or too low (threshold defined in the code), and this for a certain amount of time (threshold "hysteresis" defined in the code), the DC motor will start and proceed with the opening or closing.

Most of the hardware used can be found below:

  • Battery 12V
  • DC motor
  • LDR + switch button
  • 2x limit switches
  • Arduino Uno
  • Arduino motor shield rev3

In work

A bit of DIY was also used to implement the mechanism:

  • Old drawer sliding guide for the door
  • Fishing line to pull up the door

Slowly but safely!

Video of the manual losing + opening as it was bright enough outside

In the video, we see a manual closing by pressing the switch, for demo purpose. After 10 sec, as enough light reaches the LDR sensor outside, the door reopens and will remain so until dark.

Conclusion & next steps

This project is technically very simple, but surely has practical benefits:

  • It prevents from waking up early morning to open manually the door to the chicken
  • It ensures that as soon as it gets dark, the chicken can rest safely in the housing
  • When nobody is around for the week-end... the chicken can stay by themselves without a risk for a few days!

A lesson learnt for those who would like to reproduce the project:

Due to slow opening of the door, the chickens tend to force there way out in the morning... in this way they push on the lower part of the door and the upper limit switch can somehow be bypassed. As a result, the motor keeps pulling the cable indefinitely. Few hints to prevent issues:

  • Using a fishing line as cable is a good way to secure the motor in case the top sensor has a defect or is bypassed: the cable will break first and not the motor or the door mechanism
  • Make sure the guiding slide is long and rigid enough so it wont be pushed away from its trajectory toward the sensor by a chicken
  • Increase the opening speed eventually

As for any engineering project... improvement is always needed! Potential for next step:

  • Integrate food & water supply to this Arduino board for more autonomy
  • Alert when egg is available (using weight change?)
  • Any idea... please feel free to propose!

Code

Schematics

Schematics

Porte automatique poulailler bb rux9wabqqt

Schematics_Fritzinig

Chicken Coop Door Arduino Int Photopin = A0 Error Code

Source: https://create.arduino.cc/projecthub/Quelud/automated-door-for-chicken-house-55709c