Timer on light activated switch

Discussion in 'The Projects Forum' started by brentg098, Sep 3, 2013.

  1. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    I am using a light activated switch to close a relay and turn on a motor. The problem I am having is that the LDR will move out of the light in a very short time period from the motors movement. In turn the relay will always be opening and closing each time the LDR moves back into the sunlight as the angle of the LDR changes, and the angle of the sun does too. This will wear out my relays in no time and could be noisy. Essentially the LDR is following the sun but must go into the shade for a longer period of time, until the suns angle changes and reaches it again. I need to run the motor (keep the relay closed) for just a few seconds 4-8 seconds probably. This way the relay will only be activated every 10 minutes or so. I am hoping there is a timer circuit of some sort that will do this.
    This light activated circuit very similar to mine accept there is no D2 and R6, and the pot is next to the op-amp. http://www.electroschematics.com/wp-content/uploads/2010/07/light-activated-switch.jpg
    I was hoping that I could stay away from any signal type stuff that is necessary in a digital circuit. I haven't toyed with electronics this much for about 20 years, and the digital Arduino projects are well over my head.
    Thanks,
    Brentg
     
    Last edited: Sep 3, 2013
  2. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Welcome to AAC.

    So is this what you want to happen every time the LDR is tripped?

    1) Turn on motor for 4-8 seconds.

    2) Ignore LDR for 10 minutes and keep motor off.

    3) After 10 minutes, look at LDR. If tripped, repeat steps 1 and 2.

    If yes, you can do with with two 555 timer ICs in monostable mode.

    If not, please explain, step-by-step, what you want to happen.

    As an aside, you could replace the mechanical relay with either a solid state relay (more expensive) or a MOSFET if you want to eliminate the mechanical clicking from the relay.
     
  3. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    +1
    Use a MOSFET. Lighter, cheaper, quieter, easier to drive, etc.

    But you still need to switch it properly using either hysteresis or the timing already mentioned.
     
  4. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    Good to see some help coming through.
    First, I will not need a timing delay, especially if I can use something like a MOSFET that will allow more than a few 100K cycles. My motor is running a 9 volts and so is the light/dark circuit. Are you guys saying that the MOSFET will replace the relay? I neglected to mention that there are two circuits, one to turn the motor one direction out of the sunlight, and the other to turn it into partial sunlight such as when there are clouds in front of the sun. In other words the motor turns it out of the sunlight into full shade, and then turns it back into the "sunlight" when the sun is behind the clouds. I have the wiring set up with two DPDT relays so that only one circuit will be activated at any given time on the one single motor. My question is, can I also do this a fairly uncomplicated way with a MOSFET?
    Thanks again,
    brentg
     
    Last edited: Sep 6, 2013
  5. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I suppose that you would have posted a schematic of what you are currently using if you had a schematic, but that is what is needed. Very likely, one or more MOSFETs can be used to replace the relay(s), but in order to specificy how to do so, a schematic is required. Either you need to provide one, or someone here will ask enough questions and draw a schematic based on your answers. Do you have a schematic of the actual setup you are using?
     
  6. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    Ok,
    This is an oversimplified schematic without all my switches.
    [​IMG]

    Imagine that there are two light/dark circuits instead , one is light activated and the other is dark activated. The only difference is the LDR is switched with 100k resistor above it. Both attach to their coils on the relays. If this is not a good enough schematic, I will draw the whole thing up.
    brent
     
  7. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I still don't understand your setup, but anyway here is the way to use a MOSFET instead of a relay.
     
  8. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    Sorry, just hurried and put that together. I would have a circuit that is activated as light levels go past 15%, and on up to 100%. This would be the light activated circuit. The other circuit is a dark activated and would turn on when light levels dropped below 15%. The relay drawing was one relay for each circuit. They are wired so that both do not activate at the same time, something that could happen around the 15% level.
    Question 1: Where would be my output for my motor on the MOSFET?
    Question 2: Does the mosfet act like a relay and an the op-amp in my circuit?
    Question 3: how would I wire the mosfet so that it would work like have two relays that cannot run at the same time.
    I really appreciate your help. IF this does not make sense, it's ok. Maybe I'm to tired and not explaining myself very well.
    Thanks,
    Brent
     
  9. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Ah, I think what you want is a MOSFET H-Bridge which would require four MOSFETs. I can't say I've got any experience with those, but you can Google that to learn some more and hopefully someone here can offer some guidance.

    You can research H-bridges in general which can also use BJT transistors or special ICs.

    We may be able to offer some more guidance if you can post a complete schematic of your circuit. I just can't "see" how you've got your circuit set up by your description and the schematic posted thus far.
     
  10. trader007

    Active Member

    Feb 27, 2010
    222
    19
    this is the circuit i used for a similar situation

    [​IMG]
     
  11. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    This is a complete schematic. The diagram on the right is just a simplification of the relays without the coils connected on each circuit. The top circuit is the light activated circuit and the bottom is the dark activated circuit.
    [​IMG]
    I will to run a MOSFET or two if needed. Oh yea, this is 9 volts.
    Thanks
     
    Last edited: Sep 12, 2013
  12. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    I think I drew this up wrong. Wouldn't this need to be 3 different/separate power supplies, even if they are all running at 9 volts? One for the top circuit, one for the bottom, and one for the relays? I think I will make this circuit with the relays first. Actually I am all but wired up for that. Then I will do the MOSFETS later, once I figure that out.
    Thanks
     
    Last edited: Sep 14, 2013
  13. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    Ok, I am going to make this simpler. I used this circuit by JingleJoe http://forum.allaboutcircuits.com/showthread.php?p=396051
    And it works for the dark activated but when I switch the LDR and the 10k resistor for the light circuit, it starts to act funny. I also added an indicator LED to both circuits. When I first power it up the light circuit the relay works fine as well as the LED light. After a few minutes of switching back and forth from dark to light, the LED will switch on but the relay will not. If I don't apply power to it for at least 6 hours then apply power again it will work for about 10 minutes. I replaced the relay to no avail. Any help would be great
    Brent
     
    Last edited: Sep 19, 2013
  14. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    Measure your battery voltage when the circuit is not working right. Your using a 12V relay on 9V, which is likely sagging below 7V. It's hard to say what might be failing first but it sounds like the relay won't fire. The 741 will have trouble too as the supply voltage collapses.
     
  15. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    I'm, sorry I forgot say that it is a 9 volt relay. I checked the voltage at the battery and it is about 12.5 volts. I failed also to mention that I had the same problem earlier and tracked it down to the transistor. I replaced the transistor and it worked for a while. I just replaced the transistor and it worked. So, the transistor keeps burning up? One other thing, when I remove the light from the ldr, it takes about 3 seconds for the indicator light to turn off, not so with the dark sensor. I keep switching the transistor in and out and it works intermittently.
     
    Last edited: Sep 19, 2013
  16. brentg098

    Thread Starter New Member

    Sep 3, 2013
    9
    0
    Thanks everyone for your help so far. I have built the circuit with the relay, and it is working. However, I just need to know if the MOSFET's lifespan is much longer. If so I will build the circuit with the MOSFET. I just need a MOSFET circuit. I can not remember if we already talked about the MOSFET lifespan or if I am just hoping it would last longer.
    Brent
     
    Last edited: Oct 4, 2013
  17. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    The lifespan of a MOSFET is infinitely longer than a mechanical relay.

    If you need to reverse the motor you will need an H-bridge.

    You will also need a delay while you turn off the power to the motor before reversing the motor.
     
Loading...