Home     Contact     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
   
 Home      Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   

14 June 2009
Author: Giorgos Lazaridis
Light / Dark Activated Relay

A Light / Dark activated switch is a circuit that will somehow measure the light level and will turn on or off a relay accordingly. We will use an LDR (Light Depended Resistor) to measure the light level. Also, we will not demonstrate only one circuit but instead, three circuit will be put under the microscope. Each one will have different characteristics but the operation will be the same.






The first circuit - The blind man's sensor

The circuit assembled on a breadboard

The circuit is is a simple transistor switch with the base of the transistor connected to a voltage divider. The voltage divider has two resistors. The first is the 100K potentiometer plus the protective 1K resistor. the second resistor is the LDR. This is the schematic of the circuit:





As light falls on the surface of the LDR, the LDR changes it's resistance. The more the light, the less the resistance of the LDR, the less the resistance, the less the voltage drop across it. The less the light, the more the resistance and thus the more the voltage drop across it.

As the voltage drop increases, so does the VB of the 2N2222 transistor and therefore the ICE increases accordingly, until the time that the current is enough to actuate the relay.

The amount of light needed to actuate the relay can be changed by changing the 100K potentiometer. Basically, any change to the potentiometer will have an effect to the voltage drop of the LDR, as they are both members of the voltage divider described above.

The 1N4001 diode is used to eliminate any back voltage when the relay is disarmed. It is very important to have this diode because without it, the transistor may be damaged.




The second circuit - Increased sensitivity

This has a better sensitivity than the previous

The above circuit works fine as far as the activation is concerned. There will be no problem to detect dark or light and actuate the relay, but there will be a problem when the relay needs to be released back again. At this point, the circuit has a big hysteresis. therefore, we need to further amplify the signal before we apply it to the switching transistor.

We will use the BC517 NPN Darlington pair transistor. We will put it between the 2N2222 and the LDR, as the following circuit indicates:





With this addition, the sensitivity of the circuit is further increased. The hysteresis window is significantly decreased, although there is still a region that when the relay is activated, it will not be deactivated with the same amount of light that existed just before it's activation.




Selecting different parts

The above circuits may work with different voltage and/or parts. For example, you may change the voltage to 5 volts, but you should then consider changing the 1K resistor into 560 Ohms, the potentiometer into 10K and the relay of course must have the appropriate coil voltage.

You may use any kind of NPN transistor for switching the relay, as long as it is capable to work under your selected voltage and also be able to provide enough current (ICB) for the relay.




Adjusting the circuits

Only one adjustment needs to be made and that would be (of course) the potentiometer. Your goal is to make the circuit actuate the relay when you have equal or less light to the pre-defined value. The easiest way to do this is as follows:

Let the LDR be lighted with the amount of light you want. Keep the potentiometer into it's highest value. Then start slowly turning the potentiometer and reducing it's resistance. When you hear the 'click' of the relay, you have found your set point. From then on, every time the light is less or equal (or more if the circuit is configured as "light activated") to the light that you made this pre-setting, the relay shall be activated.




Convert into light detectors

The above circuits operate as dark detectors. This means that when the light level falls under a preselected value (read previous paragraph), the relay is actuated. In case you want a light detector that will actuate the relay when the light level is increased above the preselected value, just remove the protective 1K resistor and switch places between the LDR and the potentiometer, readjust and that's it.




The third circuit - Sensitivity to higher levels!!!

The next circuit has nothing to do with the above. It uses a 741 op-amp to achieve maximum sensitivity. This circuit can sense very slight light changes and can be really fine adjusted. Let's take a look at the circuit:






This circuit has so much sensitivity and so low reaction time, that is sometimes improper to be used

As you may have notice, the 741 is connected as a voltage comparator. Two voltage dividers are easy to be found: The first one is the LDR and the 100K resistor. The second one is composed by the two 470 Ohms resistors and the potentiometer. Both the outputs of the dividers are connected as inputs to the voltage comparator.



The second voltage divider will settle the reference voltage. The first voltage comparator that contains the LDR, will change it's voltage according to the light level. When the voltage across the negative input of the comparator is less than the voltage to the positive input of the comparator, the output is held low. When the voltage on the negative input rises, there will be a time that it becomes greater than or equal to the positive (pre-selected) voltage, and then the output becomes high and the relay through the 2N2222 is actuated.




Selecting different values

As long as the transistor is concerned, any NPN switching transistor capable to drive your relay will do. As for the LDR, you need to make sure that it pairs with the 100K resistor. This means that the mid-value of the LDR is almost the same as this resistor. Any pair will work theoretically, but i have not test others than this pair. If you have problems please let me know.

The circuit is designed to work with 12V, but it can operate in lower voltages as well, as long as you make sure you select the right relay for the occasion.




Convert into light detector

This circuit, just like the previous two circuit, operate as dark activated switch. If you want to change the functionality of this circuit, simply exchange places between the 100K resistor and the LDR.




Which one to use?

This section could also be named "advantages and disadvantages". But i chose this name as my goal is to help you find the proper circuit for each occasion. Also, it would be unfair for a circuit to name advantages or disadvantages in it's name, as there are actually none! Instead, there is proper and improper use and/or application for each one of them.

Starting with circuit #1. This is a very easy and cheap circuit. Excluding the relay, it would cost about a Euro or less. This circuit is proper for detecting large light changes. I would use it for example if i wanted to detect the light in my room or in a hall if it works or not. Small changes like shadows and staff does not affect this circuit and thus it gives a straight answer to the question: - Is the light turned on? Is my car's rear stop light working?

The second circuit on the other hand is much more sensitive to changes. The Darlington pair transistor will significantly increase the slight current changes from the LDR. Still there is a big window between activation and deactivation of the relay. This makes it ideal for outdoor uses to detect if there is ambient light. It could be perfect for example to control your automatic lights. It will not be affected by shadows from a bird flying against the sun or a cat is passing near by the sensor trying to catch this bird. Or even the human with larger shadow area, that tries to save the bird from the cat. Nevertheless, it will be accurate as far as the light level detection is concerned. The automatic lights shall indeed be turned off when the sun start shining the day.

The third and last circuit is the most accurate and the most sensitive. If for example a shadow falls and covers the 2/5 of the LDR it may not actuate the relay, but if the shadow covers the 3/5 it may actuate it. Small light changes may result into relay state change. This makes it completely inappropriate for the pre-mentioned applications. It would be very good in human detection from light level changes. For other applications, you should consider adding a delay circuit at the output of the 741. If the light level is very close to the preselected value, the relay will flicker due to the almost zero light level window that with this circuit is accomplished. It would also work very well as light signal receiver.





Relative pages
  • Basic transistor circuits
  • The transistor theory of operation
  • The voltage divider theory
  • Dr.Calculus: Op-Amp inverting amplifier calculator
  • Dr.Calculus: Op-Amp non-inverting amplifier calculator
  • Dr.Calculus: Voltage divider calculator
  • Op-Amp IC Pinouts





  • Comments

      Name

      Email (shall not be published)

      Website

    Notify me of new posts via email


    Write your comments below:
    BEFORE you post a comment: Long comments or comments of general interest are NOT to be posted here. Please use the forum instead. You will receive a reply much faster.


          

  • At 14 August 2014, 22:34:11 user sampaths wrote:   [reply @ sampaths]
    • Hi, I build the second circuit. But the relay does not releases back when the light come on the LDR. So I connected a series of LEDs in place of the relay and I see LED's turning off when light falls. So I assume that 2N2222 doesn't cut off when the light is on or it doesn't go below than the hold current of relay coil. In this case, what should I change ? Will increasing 1.5K work ? please let me know.

      thanks.


  • At 23 June 2014, 23:39:06 user shazrul wrote:   [reply @ shazrul]
    • i have to doit lift moni project for 5 floor the lift will up.. but i dont know how to give the motor strong for get up the load...


  • At 25 April 2014, 16:46:23 user Hafiz wrote:   [reply @ Hafiz]
    • Hi , I Want to Make Solar Street light system and it operate automatically so I found photo sensor operated 12v DC relay circuit wiring diagram and it's detail.


  • At 13 April 2014, 21:02:55 user Gord wrote:   [reply @ Gord]
    • Hi Mr. Lazaridis:

      I've built circuits 1 and 2 and they work great. Thanks. I'm having some problems with a computer interface to which I've connected the circuit.

      I've posted the details at the forum.

      http://www.pcbheaven.net/forum/index.php?topic=1796.0

      If you wouldn't mind checking out the description and letting me know if you have any suggestions, I'd really appreciate you help.

      I'm a high school computer studies teacher and I'm trying to build a project for my students to work on.

      Thanks kindly.
      Gord


  • At 22 March 2014, 9:09:51 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Autumn Try different values for the 100K feedback resistor of the 741. If this does not work you need different LDR or different resistor value for the LDR voltage divider performed with the other 100K resistor.


  • At 7 March 2014, 5:28:40 user Autumn wrote:   [reply @ Autumn]
    • Hi, I was built the third circuit but I'm using a 9V battery. It able to activated the relay but failed to turn it off when vary the light. I found that the voltage across relay is around 6.7V and it only drop to 6.5 when cover the LDR. The voltage at transistor also around 1V only. It is transistor and relay problem or battery not suitable?


  • At 26 October 2013, 0:54:48 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Joakim i connect it on the NO contact of the relay


  • At 23 October 2013, 13:17:26 user Joakim wrote:   [reply @ Joakim]
    • In the third circuit, how/where would you place a LED to illustrate that the relay if off and one where the relay is on ?

      I plan on useing the relay for activating a motorized pencil sharpener, for a robotic arm that draws pictures fom g-code.


  • At 12 October 2013, 2:02:00 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Kumud Kumar Definitely wrong relay contact connection


  • At 4 October 2013, 12:02:26 user Kumud Kumar wrote:   [reply @ Kumud Kumar]
    • sir, i have designed the third circuit without pot and used a transformer for 12 v supply. on supply relay is producing a click sound but led is not responding what could be the problem/


  • At 2 October 2013, 20:55:14 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Kumud Kumar For example, the relay may be armed at above 3 volts and disarm at below 2.5. The difference between 3 an 2.5 is the hysteresis (0.5V)


  • At 2 October 2013, 13:22:33 user Kumud Kumar wrote:   [reply @ Kumud Kumar]
    • what is hysteresis and how it is affecting the sensitivity in the above circuit?


  • At 16 September 2013, 19:25:15 user brent wrote:   [reply @ brent]
    • Giorgos,
      I made the circuit 3-4 times and even made it twice at the same time and this is my result: [URL=http://s1054.photobucket.com/user/bgoody32/media/DSC02259_zpsb8c6fea9.jpg.html][IMG]http://i1054.photobucket.com/albums/s489/bgoody32/DSC02259_zpsb8c6fea9.jpg[/IMG][/URL]

      The pink represents the components and wires that were hooked up which caused the coil/relay to close. When I hook up everything else, or, remove everything else, it makes no difference. I also used 2 different op-amps and tested my transistor on another circuit.
      Thanks


  • At 16 September 2013, 8:39:08 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Jugo Keep it same


  • At 16 September 2013, 8:11:46 user Jugo wrote:   [reply @ Jugo]
    • If I use a 9V battery, what would be the best value of R1 pot?


  • At 3 September 2013, 4:36:34 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Brent If you use the circuit with the opamp, you do not need to change the LDR. I think i got what you mean with the resistors. In that case, you only need different LDR if you plan to draw lot of current through it, something that does not happen with op-amps, so its ok...


  • At 31 August 2013, 9:28:29 user Brent wrote:   [reply @ Brent]
    • Giorgos,
      I can use high value resistors, I just thought with my working range of 800 to 1050 Ohms it might be different. It sounds like about 500K is good. I will experiment on that.
      My LDRs are rated from 10k to 1meg Ohm. However, with my set up, the resistance is only 800-1500 ohms when the motor is activated. These are the values of the LDRs in this amount of light. In other words the switching in both circuits occurs when the light about 15%(arbitrary value), such as when a cloud goes in front of the sun. My blinds will not allow direct sunlight into a room, only values such as 800-1500 ohms, such as when the sun is behind a cloud. My dark circuit will open the blinds and the light circuit will close them.
      Could you point me in the right direction if you still think I need different LDRs?
      Thanks again for your help!
      Brent


  • At 31 August 2013, 0:13:20 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Brent oh I see. Here is what: if you use such a high value off with these resistors, then you miss the precision. That being said, I suggest that you use a different ldr. May I ask. why can't you use biger resistors???
      The 100k resistor is the one under the op-amp (AKA feedback resistor)


  • At 30 August 2013, 19:08:08 user Brent wrote:   [reply @ Brent]
    • Giorgos,
      First, I want to thank you for your help. This is a big project for me since my knowledge of circuits is very limited; hence your help is greatly appreciated.. Second, I did not explain myself very well last time. I am doing two circuits on the same motor, a dark activated circuit and a light activated circuit. The relays in both circuits will be wired together so only one will work at any given time so that the motor will not short out. When it is completely dark, and up to about 15 percent light, the motor will turn one direction. When it is brighter than this, the motor will turn the other direction. The resistance values of the LDR that I will be working with are only from about 800 ohms to 1050 ohms. Anything above this or below this range will not be utilized in my project. My question is this; will I still want the 100k(500K if that was the mid-range of the LDR) resistor that is above the LDR, or should I give it a different value, a value closer to the range I am working with? Question 2, When you said in your last post to change the 100k resistor to 22k to help with flicker, you meant the 100k resistor under the op-amp?
      Thanks again,
      Brent


  • At 30 August 2013, 9:41:28 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Cristian google for "snubber circuits" and "power line filtering". Use also some TVS


  • At 30 August 2013, 9:35:10 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Brent 500K if the ldr is linear of course.
      As for your second question, you can adjust the flicker with the hysteresis by altering the 100K resistor. use a smaller one, 22K or smaller. Run some tests.


  • At 18 August 2013, 6:23:34 user Cristian wrote:   [reply @ Cristian]
    • i have made first and second circuit both works like a charm but:

      -i wanted to use it for fluorescent bulbs, the relay wont stay put ,it goes intermitent . I know the reason but i don't know how to fix it, fluorescent bulbs have high voltage discharges when its lighten up and that parazite oscilation is affecting the relay coil.
      how can i fix this?


  • At 14 August 2013, 12:56:45 user Brent wrote:   [reply @ Brent]
    • Giorgos,
      If you don't mind a few questions for you. First, if the ldr is 10K to 1M Ohm, would the mid range for the accompanying resistor be 500K ohms?
      Second, lets just say I wanted to turn the relay on when the light was 15% of total sunlight, like an overcast day. Would circuit 3 be good? Would I get too much flicker from the relay. What I am trying to do is get blinds to close when the light is about 15-20% and open when it goes below this range.
      Thanks again,
      Brent


  • At 24 July 2013, 1:02:10 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Brent A relay will always make noise. You can go with a solid state solution (IGBT, optocoupler/triac, mosfet...).


  • At 17 July 2013, 16:33:19 user Brent wrote:   [reply @ Brent]
    • Hello,
      I enjoyed your website. Is the relay loud? What relay could you use that was really quiet? Could you use multiple LDR's with a similar circuit as 2 and 3? Such as in parallel?
      Thanks
      Brent


  • At 27 June 2013, 6:39:00 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Shubham Dutta I'm sorry i do not suggest changes for the circuits.


  • At 25 June 2013, 7:20:36 user Shubham Dutta wrote:   [reply @ Shubham Dutta]
    • Sir, please suggest me the changes i'll have to make and the components in the 3rd circuit to operate it on 220 volts to light a bulb of maybe 15 watts.
      Thank you!


  • At 21 April 2013, 4:37:00 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Chris Yes, with some changes to the circuit (the 100K mainly)


  • At 15 April 2013, 20:03:55 user Chris wrote:   [reply @ Chris]
    • Would it be possible to use this circut to control a fuel pump relay?
      Using the singnal from a fuel tank sender (0 ohm full 120 ohm empty) instead of an LDR?


  • At 25 March 2013, 17:25:05 user Pete Wells wrote:   [reply @ Pete Wells]
    • I made some changes based upon your suggestion that I reverse the ldr and take out the fixed resistor. It worked using a 9 volt battery. However I need to use a 12 volt battery, and the ldr that I was using with the 9 volt would not work, but I happen to have an ldr with a higher resistance using the reverse design, it seems to work. My goal is to turn off a camera at night and on at daylight. I also had to increase the ohms of the variable resistor. Once I have a going circut, I will probably change to a fix resistor. Incidently the ldr that I was originally using had 5k-100k as called for.


  • At 24 March 2013, 15:43:57 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Pete Wells The LDR is wrong. You should try different (probably higher) potentiometer


  • At 24 March 2013, 12:10:30 user Pete Wells wrote:   [reply @ Pete Wells]
    • I built circuit #1 using a NTE184. The relay will latch if I change the variable risistance, but covering or uncovering the LDR does not cause it to unlatch or latch. Where have I gone wrong?


  • At 5 March 2013, 12:09:36 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Ron The relay is only necessary if you want to drive high current loads. You may want to go only with a transistor.


  • At 3 March 2013, 8:38:54 user Ron wrote:   [reply @ Ron]
    • Your circuit may be of use for my mini solar project. I want the circuit to start allowing voltage through as soon as it reaches 11 volts (and not before 11 volts). Is a relay necessary or are there any other options? Thank you.


  • At 26 February 2013, 13:05:03 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Tigran Ohanyan Basically you need to change the 100K resistor to match your ldr


  • At 22 February 2013, 15:24:02 user Tigran Ohanyan wrote:   [reply @ Tigran Ohanyan]
    • Hi there,
      Is this the one from PDV-P7002-ND (Digi-Key number) that you use in your circuit?

      I did everything like shown above, but my LDR is 20kOhms - 20MOhms

      Can I change some resistors to let this one to work?

      regards


  • At 16 February 2013, 10:24:26 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @chaithanya yes


  • At 16 February 2013, 8:44:43 user chaithanya wrote:   [reply @ chaithanya]
    • does the same circuit can be used in case of PCB?


  • At 15 February 2013, 15:11:55 user Daniel A. Christopher wrote:   [reply @ Daniel A. Christopher]
    • legit, thanks


  • At 26 September 2012, 16:34:39 user kody wrote:   [reply @ kody]
    • man....i rily need 2 do this project...


  • At 13 April 2012, 13:15:48 user virender wrote:   [reply @ virender]
    • Dear sir, I want such a circuit which can send Webcam live video to pc or can turn my webcam into wireless. Any reply shall be very very appreciated. With thanx!


  • At 2 March 2012, 10:08:22 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Gahn relays are ok for the lamp. the diode also can be used to avoid bad power connection.


  • At 1 March 2012, 0:48:43 user Gahn wrote:   [reply @ Gahn]
    • @Giorgos Lazaridis @Giorgos Lazaridis

      the relays am using are:-
      1. OMRON G2R-1-E 12VDC,16A 250VAC, 16A 30VDC

      http://www.omron.com/ecb/products/pry/121/g2r_1_e.html#Ratings

      This is after stopping to use

      2. SRD-12VDC-SL-C 10A 250VAC, 10A 30VDC.

      http://www.ebay.com/itm/10PCS-12V-DC-SONGLE-Power-Relay-SRD-12VDC-SL-C-PCB-Type-SPDT-/150749613127?pt=LH_DefaultDomain_0&hash=item2319608c47

      please advice whether the above relays both can support a lamp 30Watts lighting for 12hours everyday.

      Qn: is it in-order if i place a diode before the 12V in order to protect the circuit from destruction if one interchanges the wires for positive and negative.


  • At 28 February 2012, 0:50:07 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @makae lazaro i'm sorry i do not do circuits on demand, especially @220v


  • At 27 February 2012, 23:45:37 user makae lazaro wrote:   [reply @ makae lazaro]
    • i would like to do my project in this way; use LDR,diac and triac,3 capacitors and a coil, my supply this time is 230v ac.

      could you plz help a friend out!


  • At 27 February 2012, 11:29:16 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @gahn at first,try the first circuit instead. it has less sensitivity so when the light is at the point where the circuit is on and off, it will not flicker. as for the relay, i suggest you post some image or photo in the forum to understand.


  • At 27 February 2012, 7:03:00 user gahn wrote:   [reply @ gahn]
    • @Giorgos Lazaridis

      the relays i am using are OMRON G2R-1-E 12VDC,16A 250VAC, 16A 30VDC.This is after stopping to use SRD-12VDC-SL-C 10A 250VAC, 10A 30VDC. both have 5 legs. i have connected the (-ve)Negative of the circuit with the COM for relay. then the (-ve)Negative of lamp to NO of relay. The ( ve)positive of circuit connected with ( ve)positive of lamp then to ( ve)positive of battery. please advice on any error being committed.


  • At 27 February 2012, 6:43:48 user john wrote:   [reply @ john]
    • @Giorgos Lazaridis
      thank you for quick reply
      Circuit no.2 operates as outdoor switch for our home security light. the light is 50 watts DC Voltage.
      the relay works well for 3-4 days then it starts hissing then the lamp flickers on and off... any suggestions on improving on stability of the circuits.


  • At 27 February 2012, 5:31:57 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Gahn most probably the 2n2222 is dead, but get also a bc517. As for the load, get a 5 amperes relay, it can handle some 1000 watts of load easily. Also a 1 ampere relay is enough, but the price difference is ridiculous.


  • At 27 February 2012, 4:25:59 user Gahn wrote:   [reply @ Gahn]
    • kammenos: Quick qns.

      1. i made circuit no.2 it works well.
      but while testing my friend interchanged the power supply terminals.. the circuit doesn't work. tell me which parts are fried and which parts good.

      2. if my load is a 50watts dc lamp that lights all night (11 Hours per day for 365 days a year ) do i require to modify circuit no 2. if so please advice.


  • At 23 February 2012, 10:24:59 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @keith i had found them on ebay many years ago. you can use other type of ldr instead as long as you replace the 100K potentiometer with bigger or smaller (depends on the LDR you have)


  • At 23 February 2012, 5:40:27 user keith wrote:   [reply @ keith]
    • i am having a hard time finding a 5-500K LDR
      any ideas where i can find it
      Thanks3
      Keith


  • At 15 January 2012, 7:55:35 user yolxqblvwd wrote:   [reply @ yolxqblvwd]
    • XCh0rW , [url=http://kfhuzlryutdm.com/]kfhuzlryutdm[/url], [link=http://rvpobedcswuq.com/]rvpobedcswuq[/link], http://yobfwemzzrdw.com/


  • At 9 January 2012, 12:31:03 user Kammenos wrote:   [reply @ Kammenos]
    • @jene most probably you got the + and - inputs of the opamp reverse.


  • At 8 January 2012, 23:48:17 user jene wrote:   [reply @ jene]
    • hello..!
      i've used the 3rd circuit,and used all the components yet it works as a light activated circuit, what would be the problem?


  • At 4 December 2011, 1:44:33 user mr triac wrote:   [reply @ mr triac]
    • No wonder that(quote): "This circuit has so much sensitivity and so low reaction time, that is sometimes improper to be used"

      To overcome this drawback, employ some positive feedback and everything will be back to normal.


  • At 4 December 2011, 1:32:47 user mr triac wrote:   [reply @ mr triac]
    • There is a (big) mistake in diagram no.3 (The third circuit - Sensitivity to higher levels!!!).

      Feedback resistor(100KΩ) should be tied to noninverting input(+) so it can add some hystersis to the comparator[positive feedback].

      Adding hysteresis to the comparator helps the relay to be activate/deactivate firmly, without chatter.


  • At 17 July 2011, 7:04:39 user Tony Atkins wrote:   [reply @ Tony Atkins]
    • I want to trigger the first circuit with a pulse of 12 volts and keep it on for 30 seconds after the 12 volts is removed. The relay would be supplied with its own supply. What other circuit mods would have to be made to make this work.
      Thanks in advance for any information
      Tony Atkins


  • At 17 June 2011, 12:56:06 user Kammenos wrote:   [reply @ Kammenos]
    • @benson send some images in the forum [http://pcbheaven.com/forum/] with the potentiometer and the relay. also send more details about the relay (whats writing on it).


  • At 16 June 2011, 13:31:49 user benson wrote:   [reply @ benson]
    • My 100K linear potentiometer have 5 legs (pins)
      Which pin should i connect to 1K and LDR. Also My 12v delay has 8 pins and i connected as suggest by Kammenos but the leds not lighted. Please advise. Thanks


  • At 18 May 2011, 6:51:14 user Kammenos wrote:   [reply @ Kammenos]
    • @toni675 you need to get a relay capable to handle the current of the lamps. If for example each lamp is 60 watts, I=P/V => I=0.27 amperes. Two of these lamps makes about 0.6 amperes, so you need a relay capable to handle contact 220 volts 1 ampere at least, with coil 12 volts (this is how you ask it). As a matter of fact, almost all relays can handle at least 1 ampere, so this is simple to get. I suggest you get 5 amperes relay. The pinout is subject to the relay you will get. Usually the pinout is on the shell of the relay painted.


  • At 14 May 2011, 14:22:38 user toni675 wrote:   [reply @ toni675]
    • Excellent work guys.The circuits are very explanatory even for the amateurs like us. I'd like to control two 220vac loads(ex. lamps) with the activated relay. Can you suggest me the appropriate relay?If yes can you provide with the correct connection(NO, common)?Tanks anyway.


  • At 14 May 2011, 14:10:56 user toni675 wrote:   [reply @ toni675]
    • Ãéá áñ÷ç, êáôáðëçêôéêç äïõëåéá ðáéäéá. Ôá êõêëùìáôá óáò åéíáé ðïëõ åðåîçãçìáôéêá ðïõ áêïìá êáé åìåéò ïé áñ÷áñéïé ôá êáôáëáâáéíïõí. Ãéá ôï óõãêåêñéìåíï êýêëùìá, èá çèåëá ï ñåëåò üôáí åíåñãïðïéçèåé, íá êëåéíåé äýï 220vAC öïñôéá(ð.÷ ëáìðåò).Ìðïñåéôå íá ìïõ ðñïôåéíåôå åíá ôåôïéï ñåëå êáé áí íáé ðïéá èá çôáí ç óõíäåóìïëïãéá ôïõ.åõ÷áñéóôù.


  • At 16 April 2011, 0:31:20 user neeraj wrote:   [reply @ neeraj]
    • how to calculate voltage drop across relay & Ic & Ib ?????????


  • At 21 March 2011, 5:05:24 user Kammenos wrote:   [reply @ Kammenos]
    • @ken, you can connect ONLY THE SECONDARY of the relay to the 220 volts, as long as the relay permits it. Be very careful with 220. Of course, the circuit cannot be connected to 220. You can ONLY control 220 load with the relay.


  • At 21 March 2011, 4:57:22 user ken.... wrote:   [reply @ ken....]
    • how can i use the circuit to my 220 ac light?


  • At 21 March 2011, 4:53:26 user kenny wrote:   [reply @ kenny]
    • ahm..
      Can i use the 1st circuit to a 220 ac light?


  • At 20 March 2011, 10:36:52 user ymk wrote:   [reply @ ymk]
    • Kammenos, can u send me the complete diagram for the circuit 2 and 3 together with the LED, i having problem on connecting the LED with the relay, i try to connect the NC leg of the relay on a power source and a resistor in series with LED and my CM is connected to ground but there is no response on the LED


  • At 1 March 2011, 14:02:52 user Kammenos wrote:   [reply @ Kammenos]
    • You can use 3V without the relay, but only the 2 first circuits, not the one with the 741


  • At 1 March 2011, 12:23:32 user PrashM wrote:   [reply @ PrashM]
    • hi,
      Is it possible to make this project without using 12V supply, relay. can i just use 3V supply and LED.


  • At 25 February 2011, 5:30:12 user Kammenos wrote:   [reply @ Kammenos]
    • vincent they are made for 12 volts, so you can use them with no change. As far as the battery is concerned, use any battery that can handle your load (for example car battery, or motorcycle, or 8x AA batteries...).


  • At 25 February 2011, 3:47:39 user vincent wrote:   [reply @ vincent]
    • the circuit above mentioned are really good. will it work for a 12 battery? if yes what type of battery could it be? tnx


  • At 26 October 2010, 1:32:38 user Akpan monday wrote:   [reply @ Akpan monday]
    • Please, i appreciate on your view toward the circuit though that my building on light activated i used a circuit resemble the third circuit viewed, but im still supriase who made this recovery because even now i ve not gotten the review on this write up so can you shared the literature review on my topic mentioned above. Thanks.


  • At 3 October 2010, 9:18:52 user Kammenos wrote:   [reply @ Kammenos]
    • Yes Jorge, that is correct. This is how the circuit works.


  • At 3 October 2010, 8:36:47 user Jorge Gutierrez wrote:   [reply @ Jorge Gutierrez]
    • Hello, how can I combine two circuits?
      I mean, the LED turns on in the dark, turns off when there's poor lighting and turns on again with the proper lighting?

      Thank you so much in advanced.


  • At 18 August 2010, 0:39:41 user Kammenos wrote:   [reply @ Kammenos]
    • Hi George,
      try connecting a 220K or a 100K resistor between the LDR and the ground.


  • At 17 August 2010, 21:43:35 user George Rent wrote:   [reply @ George Rent]
    • I built circuit #2. I could get the relay to activate when adjusting the potentiometer. However, the relay stays activated even if I shine light on the LDR or adjust the potentiometer. I am using a 12V relay, it activates at about 8.5 volts and I could get it down to 6 volts, but the relay will still stay activated. The LDR I'm using is 3-200 K ohms. pls help.


  • At 1 August 2010, 21:04:50 user manu_alld wrote:   [reply @ manu_alld]
    • Komal, you should use 9v relay if you are using 9v power supply.
      and use 6volt input when you use 6v relay.

      Kammenos can put his expert comment about above.


  • At 4 July 2010, 9:08:44 user Kammenos wrote:   [reply @ Kammenos]
    • The circuit detects the light. The shadow is absence of light. You can use multiple LDRs to have an average from many positions, but on a big shadow, the circuit will just detect absence of light.


  • At 3 July 2010, 23:42:24 user KOMAL wrote:   [reply @ KOMAL]
    • i used transistor 2N2222 for the dark activated switch but that does not work.m using the bc 109 transistor now.the circuit works but it is affected by shadows.how do i make my circuit unaffected by shadows??
      plz help
      my circuit consists of

      a 6volt activated relay
      protective diode 1n4001
      transistor BC 109
      ldr
      potentiometer
      input of 9v


  • At 25 June 2010, 8:33:35 user Kammenos wrote:   [reply @ Kammenos]
    • There are 3 circuits. which one you mean? All the schematics and connections are here. I do not understand what you mean.


  • At 25 June 2010, 5:26:57 user neelima wrote:   [reply @ neelima]
    • i want to do this project please can u give a brief idea ,cost,applications,circuit connection of this project.


  • At 13 May 2010, 21:36:02 user Kammenos wrote:   [reply @ Kammenos]
    • An LED is a diode. If you connect it without a limiting resistor, then the current will flow within uncontrollable. At 12 volts, you need an LED around 300 Ohms 1/2 Watts (http://pcbheaven.com/wikipages/LEDs/). You will connect the resistor in series with the LED, and all this parallel to the relay.


  • At 13 May 2010, 15:05:40 user manu_alld wrote:   [reply @ manu_alld]
    • hi,
      excellent work, but i fail to understand one thing
      If i connected a L.E.D. accross the relay along with the diode already used, the 2n2222 blows up instantly.

      i burnt 2 transistors now, and was not having 2222 so used a BC109, works perfectly but had to remove the L.E.D.

      Is there any way to use a L.E.D. and the Relay along so the circuit can show that its activated.

      Thanks for the nice details.


  • At 1 February 2010, 10:19:43 user Dukuletz wrote:   [reply @ Dukuletz]
    • I did what you told me, and came up with the circuit below. When the LDR detects light, it triggers the monostable multivibrator circuit and light the LED for 60 sec (R1=500K, C1=100uF)

      http://img203.imageshack.us/img203/5110/darkdetectorwith555.jpg


  • At 1 February 2010, 5:05:35 user Kammenos wrote:   [reply @ Kammenos]
    • Hello Dukuletz,

      You remove the 2n2222 and the 1n4001 and the relay completely. Then, you connect a monostable multivibrator circuit. You can select to make it either with transistors (http://pcbheaven.com/wikipages/Transistor_Circuits/ circuit #6) or with a 555 timer (http://pcbheaven.com/wikipages/555_Circuits/ circuit #8).


  • At 1 February 2010, 4:47:31 user Dukuletz wrote:   [reply @ Dukuletz]
    • Thanks you for your reply Kammenos! Its perfectly clear for me now :)
      A have another question. How can i modify the 2nd circuit to light the LED for a specific amount of time? For example, when the LDR detect dark it turns the led on for 1 minute and then turn off.

      Please send me the modified circuit on my email if you can. Thanks!!!
      My email: hacket_t (-at-) yahoo(.)com


  • At 14 January 2010, 5:57:11 user Kammenos wrote:   [reply @ Kammenos]
    • Hello Dukuletz,

      the LED is conencted at the output of the relay, just for demonstration reasons for the video. When you provide yourself a relay and yo make the circuit, you will connect the LED to a Normal OPEN contact of the relay. For example, in my schematics, on the right side of the relay there are 3 contacts that are not connected anywhere. The LED should be connected to the middle and bottom contacts. If this is not quite clear to you, i will send you by email a draft schematic.


  • At 13 January 2010, 22:57:39 user Dukuletz wrote:   [reply @ Dukuletz]
    • Hello, im a starter and can't figure out where to wire the LED to the second circuit. Can you ppl put a circuit with the led connected?


  • At 24 December 2009, 3:40:17 user james wrote:   [reply @ james]
    • Hi!

      May i know the value of resistor connected to the led for circuit 2


  • At 22 December 2009, 6:30:02 user Tasoti wrote:   [reply @ Tasoti]
    • Just use a resistor value between 1kohm to 1k5 (1,5 kohm) for 12volt. If 5 or 6 volts is the operating voltage of your circuit 330 or 470 ohm should be fine.Not so critical. Something i forgot to write about the LDR: The one i found in the market had a resistance around 6 to 8 kohm in natural daylight room conditions. When cutting the light from the surface, value increased to 20kohm and above. In my situation a potensiometer of 33k or 47 k (instead of 100k) should give more accurate sensitivity on adjust.


  • At 21 December 2009, 18:22:36 user yunami wrote:   [reply @ yunami]
    • can i use the 280 ohm resistor to the led?

      Cos i use the led calculator, but i change the voltage in as 12v and it give me this value. So is it okay to use this value.

      Tks


  • At 21 December 2009, 7:10:23 user Tasoti wrote:   [reply @ Tasoti]
    • I've build the 3rd circuit and it works quite good. From the first trial i can say that the trigger point is easy to set and the "dead" window must be small. Easy and simple schematic also.


  • At 20 December 2009, 7:13:54 user spic0m wrote:   [reply @ spic0m]
    • http://pcbheaven.com/drcalculus/index.php?calc=leds


  • At 20 December 2009, 2:28:19 user yunami wrote:   [reply @ yunami]
    • So the resistor to the led, what is the value of the resistor?


  • At 20 December 2009, 0:06:20 user Kammenos wrote:   [reply @ Kammenos]
    • You really need very very basic knowledge of electronics that you lack of, before altering circuits.


  • At 19 December 2009, 23:59:38 user yunami wrote:   [reply @ yunami]
    • The relay is 12v rite. So the resistor to the led, what is the value of the led?


  • At 15 December 2009, 8:06:57 user spic0m wrote:   [reply @ spic0m]
    • For starters you can hear the relay whether is activated or not.
      From the NO of the relay you connect a resistor and the positive wire of the led to it. You put the negative led to ground and you're good to go.


  • At 15 December 2009, 5:46:46 user yunami wrote:   [reply @ yunami]
    • Hi!

      Checking with u, can u pls tell me how to connect a resistor and a led to the relay to test whether the circuit is working or not.

      Tks


  • At 7 December 2009, 7:15:42 user Kammenos wrote:   [reply @ Kammenos]
    • You cannot calculate it. You'd better use another circuit, not this one. Maybe a timer can do the job. The lighting is never the same every day at 6:00.


  • At 6 December 2009, 17:06:12 user yunami wrote:   [reply @ yunami]
    • may i know how to calculate the resistance for the variable resistor so that i can set the lightings to on when the surrounding darkness is around 6pm


  • At 3 December 2009, 7:42:21 user Spic0m wrote:   [reply @ Spic0m]
    • Led's operate in DC voltage, no need for AC. Be carefull, AC can easily hurt you.
      Eitherways the contacts of the relay since you plan to use outside power source don't affect the other circuit which powers up only the coil of the relay.


  • At 3 December 2009, 7:29:38 user yunami wrote:   [reply @ yunami]
    • put the 230v AC into the relay(COM) and output from the relay(NO)


  • At 3 December 2009, 7:04:38 user Spic0m wrote:   [reply @ Spic0m]
    • Where you use 230v AC??????


  • At 3 December 2009, 6:46:23 user yunami wrote:   [reply @ yunami]
    • But can i input a DC voltage in rather than a AC 230V?

      will it affect the overall circuit?


  • At 3 December 2009, 5:38:28 user Spic0m wrote:   [reply @ Spic0m]
    • You first calculate the resistor you need for the leds here:
      http://pcbheaven.com/drcalculus/index.php?calc=leds

      Then you put the desired voltage in one contact of the relay and in the other end the resistor with the leds.


  • At 3 December 2009, 0:59:39 user yunami wrote:   [reply @ yunami]
    • Hi!

      Can u advise me how to connect a few led to the relay with external input DC voltage in from the relay and out


  • At 1 December 2009, 22:30:39 user yunami wrote:   [reply @ yunami]
    • Hi!

      Can u advise me how to connect a few led to the relay with external input DC voltage in from the relay and out


  • At 1 December 2009, 4:52:24 user Kammenos wrote:   [reply @ Kammenos]
    • Yes it is


  • At 30 November 2009, 22:58:52 user yunami wrote:   [reply @ yunami]
    • is 2N2222 the same as 2N2222A?


  • At 30 November 2009, 21:41:45 user Kammenos wrote:   [reply @ Kammenos]
    • The LDR is the photoresistor (LDR=Light Dependent Resistor). It should work, but this is something that you need to test.


  • At 30 November 2009, 21:12:30 user yunami wrote:   [reply @ yunami]
    • Thanks for the previous feedback!

      I went to the component store, but could not get the 5-500k photoresistor. Only manage to get a normal LDR will it work too?
      I\'m using the circuit 2 to detect the darkness in a shelter that is placed outdoors


  • At 30 November 2009, 8:44:54 user Kammenos wrote:   [reply @ Kammenos]
    • Hi Yumani,
      i checked the datasheet of this relay. It will operate with no problem. Good luck ;)


  • At 30 November 2009, 6:03:09 user yunami wrote:   [reply @ yunami]
    • Hi,

      I'm using the takamisawa RY12W-K RELAY

      Is this relay okay? Cos I\\\'m not sure whether it is a dip relay or not


  • At 29 November 2009, 21:38:31 user Kammenos wrote:   [reply @ Kammenos]
    • Hello Yunami,

      What really matters for the relay is the coil voltage. That must be 12V. The contacts can be 1A, or 2A, or 3A, or whatever. This is not a problem. As long as this is a DIP relay it will work.

      As for the potentiometer, the linear variable resistor is exactly the same thing. So the answer is yes, you can use the 100K linear variable resistor.


  • At 29 November 2009, 18:20:26 user yunami wrote:   [reply @ yunami]
    • the 12v dip relay, can u specify if it is a 3A or more.

      And is it ok to use the Resistor variable linear 100K ohm 0.25w rather than the 100K linear potentiometer

      Thanks.


  • At 29 November 2009, 8:09:28 user Kammenos wrote:   [reply @ Kammenos]
    • Bill Of Materials for the 2nd circuit:
      1 x 1 KOhm resistor 1/4 Watt
      1 x 1.5 KOhm resistor 1/4 Watt
      1 x 10 KOhm resistor 1/4 Watt
      1 x 100K linear potentiometer
      1 x BC517 NPN Transistor
      1 x 2N2222 NPN Transistor
      1 x 1N4001 General purpose diode
      1 X 5-500K Photoresistor
      1 x 12V DIP relay

      The relay you mentioned bellow is ok and should work.

      Please do not spam. Subscribe to the comments board so that you can edit your own messages instead. Thank you for understanding.


  • At 29 November 2009, 6:42:57 user Anonymous wrote:   [reply @ Anonymous]
    • hi!

      Can you pls provide the component list for circuit 2?

      Tks


  • At 29 November 2009, 5:18:04 user Anonymous wrote:   [reply @ Anonymous]
    • 2 POLES—1 to 2 A (FOR SIGNAL SWITCHING) relay is it okay ?


  • At 29 November 2009, 3:29:25 user Kammenos wrote:   [reply @ Kammenos]
    • The switching capability of the relay is irrelevant. You can use whatever 12V relay you may. The coil is that matters. I use a 16mA coil (720 Ohm). Any value near is ok. I believe that any dip relay at 12V coil is OK.


  • At 29 November 2009, 3:16:09 user Anonymous wrote:   [reply @ Anonymous]
    • is it ok if i use a 12v relay that is 3A


  • At 26 November 2009, 0:50:13 user Kammenos wrote:   [reply @ Kammenos]
    • This is a DPDT 1A 12VDC PCB mounted yes?
      As you look it with the pin on top,there are 2 pins on one side (left) and 6 on the other (right). The two pins on the left are the coil. You connect those across the 1N4001 protective diode.

      The other pins are 2 sets of contacts to use. You can use the top 3 pins for example. From left to right, those pins are:
      COMMON - NC - NO

      This means that if you want your load to light when the relay is actuated, you will use the COMMON and the NO contact. If you want your load to turn OFF when relay is actuated, you will use the COMMON nd the NC pins.


  • At 25 November 2009, 22:47:37 user Anonymous wrote:   [reply @ Anonymous]
    • Hi! I'm using the RY-12W-K relay, but i'm not sure hoe to connect the pins for it.


  • At 25 November 2009, 5:54:55 user Kammenos wrote:   [reply @ Kammenos]
    • Yunami, this resistor value depends on the type of LDR you will use. I use a 5-500K LDR. This means that my LDR has 5K resistance in light and increases to 500K resistance in dark. If you choose one close to this (10-1000K or 20-2000K), then it should work. If you use something far beyond these values, then you MAY need to change it. I have not try this though. Test it with the 100K resistor. It is 95% success.


  • At 25 November 2009, 5:27:52 user yunami wrote:   [reply @ yunami]
    • Can i know the value for the resistor for the 2nd circuit is it 100k?


  • At 7 November 2009, 0:43:56 user Kammenos wrote:   [reply @ Kammenos]
    • Hello Simon.
      You see, i'm planning to make a database with the parts and the manuals together, that you can download a bill of material + the manuals for every part. This requires some time, because i have to make a BillOfMaterial script that will cooperate with the database. That is why i have to no circuit a BOM. The parts are of course all at the schematics. I know this is frustrating, but please be patient.


  • At 6 November 2009, 15:27:10 user Simon wrote:   [reply @ Simon]
    • This is a nice simple introduction for an electronic noob like me so thanks for that, but I'm a bit confused when it come to purchasing components. Can you provide a parts list with links to the items in an online store? I'm sure you could use a referral scheme to make some money too :)


  • At 15 July 2009, 10:03:15 user kammenos wrote:   [reply @ kammenos]
    • Hi ken,
      Although i have not test it with 6V relay, i am sure it should work if you reduce the 10K resistor at the base of the transistor. Give it a try using a 4.7K instead. If you keep having this problem, please inform me and i will run a test with the circuit for you.


  • At 15 July 2009, 5:29:11 user ken wrote:   [reply @ ken]
    • Thanks for the circuit. I have build the third circuit and i have change the relay to 6v relay. The problem that i got now is my relay cannot be trigger.i supply my circuit with 7v. when i measure the output voltage using voltmeter across the diode (without the relay)the voltage do varied from 0 - 7v when i play with the LDR. But when i put the relay my voltage drop until 3.5v and when i play with the LDR the voltage drop within 3.5 - 3.4v only. So i decided to increase my supply to 10v and my relay do trigger but the problem after the the relay cant be turn off. Pls help.





    delicious
    digg
    reddit this Reddit this
    Faves



     HOT in heaven!


    NEW in heaven!



    New Project: Lab Power Supply 0-20V 10mA-2A



     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS   

    Site design: Giorgos Lazaridis
    © Copyright 2008
    Please read the Terms of services and the Privacy policy