Looking for help with programming my chicken coop

First I would like to thank you for taking your time out to read about the project I am trying to complete. I know it is a long post, which I do apologize, but I wanted to give as much detail to what I am trying to accomplish. Also with all the information I am providing I will have to post this into several parts.

I have been trying to write a sketch for my arduino chicken coop project with no luck. I decided to see if this would help since my schedule is hectic being a paramedic. Plus I want to take some of the burden off my wife. I plan on also implementing a system to control my aquaponics as well as my garden. I really have become very interested since anyone can do almost anything they can think of with arduino.

Anyways enough rambling. I am here to see if anyone would be willing to help write the sketch for me. I have seen a guy with a automated coop using the arduino online. Since I am not using all the items like he is I need the code different. I also am wanting to do other controls than he did. You can see his setup and code here.

Here is the list of parts used for the project:
(Click on part to see actual part if needed)

My goals:

  • open/close coop door depending on light sensor
  • open/close windows (x2) depending on temperature
  • turning on ceiling fans depending on temperature
    -only one on at a time
    -switch between 2 ceiling fans
  • turn on/off heat relay
  • turn on/off water heater relay
  • turning on computer fans
  • controlling leds depending on coop doors and faults
  • display items on lcd
  • turn on/off interior light
  • turn on/off electric fence
  • motion sensors with strobes that are used at night for predators (future)
  • web interface with sensor information, fault codes, and the ability to turn items on/off (future)
  • web interface cameras (future)

More details about the programing:

  • At certain light level (dawn) I would like the coop motor to open the coop door. Then at another level (twilight) have the interior light come on. Then at the dark level have the coop door close and 2 minutes later have the door open back up for 2 minutes. Then the door would close again. Then have the interior light turn off after 10 minutes of the door closing as well as turning on the electric fence.

  • Light levels (which I would adjust until correct for my area):

  • dawn: > 120

  • twilight: 4 - 120

  • dark: < 3

  • Have the electric fence turn off prior to the coop motor opening the coop door.

  • Have 3 temp/humidity sensors:

  • 1 in the control box (ControlBoxTemp)

  • 1 in the coop (CoopTemp)

  • 1 in the run (RunTemp)

  • Would like to have the temperature in Fahrenheit and if possible display it as like 97.1° F and the humidity like 30.5%.

  • Have the ControlBoxTemp control the 2 computer fans. At 85 degree F CBfan1 would come on for an hour. After the hour it turns off and CBfan2 comes on for an hour. The fans would turn on/off until the temp reaches 83 degrees F.

  • Have the CoopTemp control the 2 ceiling fans. At 85 degree F Cfan1 would come on for and hour and then turn off. Then Cfan2 would come on for an hour and turn off. This would continue until the temp reaches 83 degree F.

  • Have the CoopTemp control the windows. At 80 degree F the left and right windows would open. At 70 degree F the windows would close.

  • Have the CoopTemp control the heat relay. At 35 degree F the heat relay would come on. Then it would turn off at 40 degree F.

  • Have the CoopTemp and RunTemp control the water heater. When either of the temps hits 35 degree F then the water heater is turned on. When the temp reaches 40 degree F the water heater is turned off.

  • Have a green and red led light. When the coop door is closed the green light is on. If the coop door becomes stuck either when the door is being opened/closed the red led would flash showing a fault. Also when the main door, run door, or one of the Nesting box doors is opened for longer than 10 seconds the red light would flash until closed or fault is fixed.

  • Have the lcd backlight controlled by a button. When the button is hit then the back light comes on for 3 minutes.

-On the display I would like it to show each of the following for 5 seconds and repeat:

  • Control Box (fan status, temp, humidity)
  • Coop (fan status, temp, humidity)
  • Run (temp, humidity),
  • Coop Door (open/closed status)
  • Windows (Left window: open/closed, Right window open/closed)
  • Nesting Box Door (Left Door: locked/unlocked, Right Door: locked/unlocked)
  • Electric fence (on/off)
  • System Status (Good or fault code)
    -fault codes include left/right door unlocked or Coop door stuck

EXAMPLE:
Control Box
Fan: (On/Off status)
Temp: ##.# F
Humidity: ##.#%

Future implements:

  • I would like to be able to control the different items and have the information shown on a web interface with the arduino but I am unsure of what all is needed as well as how to program and implement that.

  • I would like to be able to use motion sensors at night and if a predator approaches the coop then the led strobes would go off for 5 seconds.

  • I would like to have cameras (1-2 in the coop and 1 in the run) which I could view in the web interface.

-Would like to have the unit email/text me when ever a door is opened/closed, any faults, or when the motion sensor goes off. I am not sure what all is needed or has to be done to have that if it is connected to the internet with a wireless device.

If wanting to add programing for future implements at time of program I would not mind at all.

Here is a list of the pins used on the arduino for programming at this time:
(Part -- program name -- Pin number)

-Photocell -- PhotoCell --Pin A0

-Control box temp/humidity sensor -- ControlBoxTemp -- Pin 22

-Coop temp/humidity sensor -- CoopTemp -- Pin 23

-Run temp/humidity sensor -- RunTemp -- Pin 24

-Control box fan 1 -- CBFan1 -- Pin 25

-Control box fan 2 -- CBFan2 -- Pin 26

-Heater -- HVAC -- Pin 27

-Water Heater -- WHeater -- Pin 28

-Ceiling Fan 1 -- CFan1 -- Pin 29

-Ceiling Fan 2 -- CFan2 -- Pin 30

-Coop Door Motor
-Enable -- CDMotorEnable -- Pin 2
-Direction Close -- CDCloseMotor -- Pin 31
-Direction Open -- CDOpenMotor -- Pin 32

-Coop open switch -- CDOpenSwitch -- Pin 33

-Coop closed switch -- CDCloseSwitch -- Pin 34

-Coop Green LED -- GLed -- Pin 35

-Coop Red LED -- RLed -- Pin 36

-Coop interior light -- CLight -- Pin 37

-Nesting Box Left switch -- NBoxLeft -- Pin 38

-Nesting Box Right switch -- NBoxRight -- Pin 39

-Left Window Motor
-Enable -- LWMotorEnable -- Pin 3
-Direction Close -- LWCloseMotor -- Pin 40
-Direction Open -- LWOpenMotor -- Pin 41

-Right Window Motor
-Enable -- Pin 4
-Direction Close -- RWCloseMotor -- Pin 42
-Direction Open -- RWOpenMotor -- Pin 43

-Electric fence -- EFence -- Pin 44

-LCD backlight button -- LcdButton -- Pin 45

-Main door switch -- MainDoor -- Pin 46

-Run door switch -- RunDoor -- Pin 47

-Real time clock (if needed) -- RTC -- Pin 20/21

-LCD display
-SDA/SCL -- Pin 20/21

-Future implements

  • Pin Analog A1-A15
  • Pin PWM 5-12
  • Pin Comm 14-19
  • Pin Digital 48-53

Equipment Setup:

The power will come from a deep cycle battery that will be charged with a solar panel. From the battery it will go to both voltage regulators. One regulator will be set at 7v and the other one will be set at 12v.

  • From the 5v regulator it will be connected to a fuse and then to a power bus. From that the arduino board, DHT11’s and any other lower voltage part will be connected.

  • From the 12v regulator it will be connected to a fuse and then to a power bus. Then the 12v relay board, motor contollers, and any other parts would be connected to the power bus.

All the electronics will be placed into an enclosed box for protection. The battery will also have its own enclosure.

I know with an experienced person that has wrote code for arduino it would probably be easy. For me it has been a hard process and I keep getting confused. I hope someone is around willing to help a guy like myself. I hope I am not asking to much out of anyone. I also would like to hear any ideas that would make this a better setup. Just let me know if any questions arise. Thank you for your time in advance.

Curtis

Good day!
How much time do you give to the project?
What budget?
StudioGippopotam@gmail.com

Hello, I'm working my way through an Aquaponics project myself, I believe I can help.

email to tyhuffman@mac.com