Chicken Coop Lighting System

Posted by:

Chicken Coop Lighting | Arduino Automated Chicken Coop Lighting | Chicken Coop Interior Lights (star lights)

David Naves

About the Author:

Hi, I'm David Naves. I'm a daddy, hubby and currently live in Auburn California with (1) wife, (2) children, (1) dog, (1) cat, and (6) chickens. I play drums, am an avid fly fisherman a proud chicken nerd, as well as an Arduino enthusiast. I also enjoy using my general contractors license from time to time... even if just to over-build my Arduino Automated Chicken Coop As far as name-dropping and shameless self-promotion, I have over 20 years experience in the web industry and have helped build out Ticketmaster.com, Guess.com, Citysearch.com and DisneyChannel.com to name a few. I've co-founded an Emmy Award Winning Music Editing Firm in Los Angeles (Milky Music) and I hold a Bachelors of Science Degree in Business Administration. I'm passionate about getting Small Business America in to the "Big Game" of SEO and ecommerce, so I founded LocalMarketplace.com™ to do just that. My favorite web host is Acenet, love my Chromebook, and am passionate about learning via Lynda.com. You can typically find me making noise out on Google+, Twitter and Facebook

Comments

  1. Mark Ashcraft  December 27, 2015

    Ok, I will adjust the code…. as it is written on your page should I always have voltage from pin 45, or should the voltage be cut once the photocell picks up light?

    reply
    • David Naves
      David Naves  January 28, 2016

      Hi Mark,

      If you look carefully at the code, the relay will turn on when the door is still open and the light level is between 4 and 120 (dusk) (my relay is set to “normally closed,” so I used “digitalWrite (relayInteriorLight, LOW);”) and the relay will turn off, simply when the door is closed (bottomSwitchPinVal == 0)

      Make sense?

      Hope that helps,
      //D

      reply
  2. Mark Ashcraft  December 23, 2015

    Do you have a part list for this? just for some bench testing I used an LED to pin 5 but no matter if it’s dark or door open or closed the LED is always on? Could you clear this up? Thanks

    reply
    • David Naves
      David Naves  December 23, 2015

      Hi Mark,

      Thanks for the questions.

      Parts list: all parts are listed on the main controller page:
      http://davenaves.com/blog/interests-projects/chickens/arduino-chicken-coop-controller/

      As far as the LEDs, there are 3 states: door open (red led on) | door closed (green led on) door stuck (red led blinks)
      i.e: There’s always an LED on. =)

      Cheers!

      reply
      • Mark Ashcraft  December 24, 2015

        I guess I should have clarified.. Im talking about the interior lighting… you mentioned in the code pin 45 for the interior light relay.. so to simulate an “interior” light I connected an LED to pin 45 but no matter the light level / door status I cannot get the LED to shut off leaving the interior light always on.

        reply
        • David Naves
          David Naves  December 24, 2015

          Ah, the interior lights… thanks for clarifying.

          Hmmm… my first thought (if you’ve done/pinned everything I have is that your relay may be normally closed instead of open) If so, try switching the digitalWrite (relayInteriorLight, LOW); to HIGH and vice versa… see if that works. If not, let me know exactly what you’re doing to test. i.e., it’s difficult to test this function, in that the light should only goe on when the light levels read > 4 & < 120 and close when the bottom door switch is closed. Keep me posted. =) Cheers! Here's an article on NO/NC: http://hydrosystemsco.com/wp-content/uploads/2014/06/triton-relays-normally-open-vs-normally-closed.pdf For those reading that want to see what Mark is asking: // turn on interior lights at dusk and turn off after door shuts void doCoopInteriorLightDusk() { if ((unsigned long)(millis() - lastTwilightTime) > TwilightDelay) { // delay 5 mins

          lastTwilightTime = millis();

          doReadPhotoCell();
          bottomSwitchPinVal = digitalRead(bottomSwitchPin);
          if (bottomSwitchPinVal == 1) { // if bottom reed switch circuit is open (door is open)
          if (photocellReading >= 4) { // if it’s twilight
          if (photocellReading <= 120) { digitalWrite (relayInteriorLight, LOW); // turn on interior light relay if (SerialDisplay) { Serial.println(” Interior Light: On”); } } } } else if (bottomSwitchPinVal == 0) { // if bottom reed switch circuit is closed (door is closed) digitalWrite (relayInteriorLight, HIGH); // turn on interior light relay if (SerialDisplay) { Serial.println(” Interior Light: Off”); } } } }

          reply

Add a Comment