Auto AC Night Light

Discussion in 'The Projects Forum' started by tracecom, Oct 10, 2014.

  1. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I want a light inside my chicken coop that comes on at dusk, and stays on long enough for the chickens to get on the roost, and then goes off and stays off until the next evening. Does this circuit look like it will do that? Thanks.

    Auto AC Night Light.PNG
     
  2. alfacliff

    Well-Known Member

    Dec 13, 2013
    2,449
    428
    I do not see any connection between the light detector and the 555 timer, other than the +12 volt supply. how do you plan to trigger the 555?
     
  3. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,791
    1,103
    A number of points:
    1) There is no mains isolation. The circuit could be LETHAL.
    2) The 12V input should go to Q2's collector, not emitter.
    3) You may have difficulty getting that long a delay (or at least a consistent delay). Unless C3 has extremely low leakage current the current through R3 may not be enough to charge it. Leakage current will be temperature-dependent.
    4) A CMOS version of the 555 should be used.
    5) You will probably need to introduce some hysteresis to the light-level sensing.
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,036
    Something's wrong on the lefthand side. The LDR has no effect on the trigger voltage.

    Oops, got beaten again.

    FWIW, I have outdoor light sockets that have adjustable light sensitivity and adjustable turn-off times. They do this function exactly and are less than $10, I think.

    I use these to turn off my "gaslights". They used to be on all night long and that seemed like a waste to me.
     
  5. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I just got home from Home Depot and could not find these. Do you have a link or more info? Thanks.
     
  6. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,036
    See the links I posted here. I had trouble finding it, so I hope you have more luck.
     
  7. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Thanks to all for the input.
    Here's a revision that addresses some of the earlier comments. Additional input is welcome.

    Auto Night Light Schematic.PNG

    I added an optocoupler for isolation.

    I corrected the connection of the 12 vdc.

    Regarding the delay, it's not critical; about 30 minutes give or take 10 minutes would suffice.

    I have some CMOS 555s, but I don't see what advantage they offer here.

    I am not sure that hysteresis is required.
     
  8. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I did find one for about $10, but the minimum on time was longer than I wanted.
     
  9. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Looking good to me. Without hysteresis I'd be worried about the light going on and off if some one (or some chicken) went across the sensor or varying levels of sunlight at sunset. I'd suggest keeping the 555 powered and just connect the LDR portion to the trigger. In this way, once triggered, the light will stay on. I don't know whether an edge-trigger would make a difference (having a hard time picturing various scenarios right now).
     
  10. #12

    Expert

    Nov 30, 2010
    16,277
    6,788
    At 1000uf, you are walking near the edge of too much leakage current for the capacitor voltage to ever get high enough. The CMOS version contributes less to the leakage problem. Theoretically, you can't do this because the advertised leakage of the capacitor will make it fail, but try it and see if you get lucky. Electrolytics usually don't leak anywhere near what the guaranteed limit is. (And use a 1000@25 volts for better leakage performance at 12 volts.)

    I also think you're a little stingy with R1. You might run out of current if the 2N3904 doesn't have good gain.

    You can connect pin 3 (output) as feedback for a latching effect.

    Cadmium Sulphide cells go high resistance when it's dark. I think you have the input backwards.

    Then there is the idea of switching the sensor section in less than 1 Vbe...

    Consider this:
     
  11. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I have attempted to build the circuit you posted, as reflected in the schematic below. In order to make testing of my breadboard easier, I replaced C3 with a 10uF electrolytic, and added an LED/resistor to the output of U1; I have not built the optocoupler/triac portion of the circuit.

    When LDR1 is dark, U1, pin 3 is high, but as soon as LDR is illuminated U1-3 goes low. Maybe I misunderstood your schematic, or maybe I built the circuit wrong?

    Thanks.
     
  12. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,791
    1,103
    As expected. Isn't that what you wanted? You need to screen the LDR so that it's not illuminated by the night-light.
     
    Last edited: Oct 13, 2014
  13. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    No, that's not what I wanted. See post 1.
     
  14. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,791
    1,103
    Post #1:
    At dusk, LDR1 goes dark, so U1 is switched on by Q1 and will start timing. Pin 3 goes high immediately and the night-light gets switched on via the opto-coupler. You said "When LDR1 is dark, U1, pin 3 is high". So far, so good. But you must ensure that the light doesn't shine on LDR1 otherwise, as you said, "as soon as LDR is illuminated U1-3 goes low."
    When U1 times out, pin 3 goes low and the light goes off. So far, so good.
    At dawn, LDR1 goes light. This causes Q1 and U1 to switch off. The light was already off at the end of the timed period.
     
  15. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    There is no light that comes on with my breadboard. All that comes on now is one 5mm LED to indicate that U1-3 is high. The only time U1-3 is high is when the LDR is dark. In other words, the one-shot isn't working.
     
  16. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I decided to try a different approach using an op-amp. See the attached schematic. It seems to do what I want, but with one problem.

    If I block the light to the LDR quickly, the circuit works fine, i.e., the red LED comes on and stays on as long as the light is blocked. The blue LED comes on and stays on for the time period determined by R1 and C1. But, if I block the light to the LDR slowly, the red LED comes on and stays on as long as the light is blocked, and the blue LED never comes on. I think it has to do with the negative going pulse to U1 pin 2, but I don't know how to fix it.

    Thanks.
     
  17. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,036
    Why not remove the coupling capacitor C4 and directly couple? I think a slow swing at the op-amp (which you might overcome using a comparator instead) causes R2 to hold the trigger high. The coupled pulse across C4 never pulls the trigger low enough to start the timer.
     
    tracecom likes this.
  18. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    That actually crossed my mind, but I didn't try it until you suggested it. It works!! and reduces the part count by 2. As you can see from the posts in this thread, I have been struggling with this for quite a while. Thanks much.

    ETA: As it turns out, if I remove the coupling cap, the one-shot doesn't reset, so I am back to the same old problem. :(
     
    Last edited: Oct 13, 2014
  19. #12

    Expert

    Nov 30, 2010
    16,277
    6,788
    We seem to be having a discussion about what happens to the resistance of the sensor when, "dark" happens. Did I get it backwards?

    So, reverse the positions of the sensor and the pot, or reverse the inputs of the op-amp. Hint: The two transistors I drew are a simple op-amp! You can make a feedback circuit to either input of the differential pair if you put some resistance between the voltage reference and the base. Then about ten times as much resistance from something that goes high or low when the proper output happens. Am I going right over your head? Maybe I should shut up because you have a working circuit. :oops:
     
  20. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    At one point, I had a rudimentary understanding of op-amps; alas, that (like a lot of other things) has slipped away from me.

    The resistance of the LDR increases as the light on it decreases, which is the situation in which my circuit needs to work, i.e., sunset. I want to turn on a light inside my chicken coop as the sunlight fades to dusk and then to night. This is because chickens don't see very well in low light, and when evening falls, they naturally want to go "to roost" inside the coop. But my coop has small windows, and is darker inside than the dusk light is outside. Thus, the chickens start into the coop, but, because it's darker inside than out, they balk and go back to the run. Then, when the sunlight is completely gone, they can't get into the coop because of their very poor night vision. Soooooo, I want a circuit that senses the decrease in outside light as the sun sets, and turns on a light inside the coop for, say, 30 minutes, and then the light goes off and stays off until the next evening. This will entice the chickens to enter the coop (because it's lighter inside than outside) and climb to the roost pole, where they will remain until the sun is well up the next morning, and they can see to get off the roost pole, and exit the coop.

    The problem that seems to plague every circuit is that I can't get a reliable trigger signal to the one-shot while capacitively coupling the signal, and if I don't capacitively couple the signal, the output from the one-shot stays high as long as the trigger signal is low.

    I actually think I can do what I want with a micro-controller, but it should be possible without one...maybe.

    Anyway, I appreciate your help and the help from others.



    ETA: My brain functions better in the AM, so I am going to "roost" now.
     
Loading...