# LDR Circuit Diagram

This LDR circuit diagram shows how you can make a light detector. An LDR or “Light Dependent Resistor” is a resistor where the resistance decreases with the strength of the light.

Here is the schematic for the circuit:

## Light Dependent Resistors

Light Dependent Resistors (LDR) are also called photoresistors. They are made of high resistance semiconductor material. When light hits the device, the photons give electrons energy. This makes them jump into the conductive band and thereby conduct electricity.

Check out Wikipedia for the physics stuff ;)

## How The LDR Circuit Diagram Works

The LDR circuit diagram works like this:

When it’s dark, the LDR has high resistance. This makes the voltage at the base of the transistor too low to turn the transistor ON.

Therefore, no current will go from the collector to the emitter of the transistor. All the current will instead pass through the LDR and the potentiometer.

When it’s light, the LDR has low resistance. This makes the voltage at the base of the transistor higher. High enough to turn the transistor ON.

Because the transistor is turned on, current flows through the transistor. It flows from the positive battery terminal, through R1, the LED, and the transistor down to the negative battery terminal.

This makes the LED light up.

## The Components Used In The Light Detector Circuit

The resistor R1 controls the amount of current going through the LED. It’s simple to calculate. I have written an article on how to calculate the resistor value for an LED.

If you are using an LED with 2V voltage drop, you will have a 7V voltage drop over the resistor when the transistor is ON. By using Ohm’s law we can find the current:

And 18 mA is usually a good current value for common LEDs.

What if you want to power the circuit with something other than a 9V battery? Then you need to change the resistor value to get the right amount of current flowing through the LED.

The variable resistor R2 is used to change the trigger point for the LED. That is, how much light that is needed for the LED to turn ON and OFF.

You can probably get away with a 10k potentiometer. It depends on the resistance of your LDR. But with a 100k potentiometer you will have room for a wider range of LDR values.

## Making The LED Turn ON When it’s Dark

You can also make the LED turn ON when it is dark instead of when it is light. To do this, replace the NPN transistor with a PNP transistor like this:

## Build It Yourself

Now it’s time for you to build this circuit. It’s very important to build stuff, not just read about it. So get yourself the components you need and build it!

Get the required components from an online electronics shop.

## More Circuits & Projects Tutorials

### 309 thoughts on “LDR Circuit Diagram”

1. Hi,
Really cool, thanks a million.
I am thinking of making a flashing light for my bike, and maybe this could turn them on automatically, but would have to function in reverse… Any ideas on how to make the led light up when it gets dark!?
Thanks again Oyvind

• Hey Brian! Thanks for your comment. I added a circuit with the reverse function at the end of the article =)

Cheers!
Oyvind

2. Simple, fun and effective way of explaining how stuff works. I think the video, even though its simple, still adds great value to the post as it triggers my maker-soul and crave to build something similar my self after watching it.

As a side note to improve the posts even further: I think additional value could be added by relating the experiment to something what you actually can use it to? How is this particular function useful in our everyday life? E.g relate it to product that turn on the light in the evening when its getting dark outside (would have you to reverse the design, causing the led to be lit when the the LDR is covered).

Just my \$0.02

Keep up the good work!

/Tom

• Thanks for your comment Tom!

I updated the article with a circuit with the reverse function at the end =)

Cheers!
Oyvind

• Why didn’t you just swap LDR&R2 instead of using PNP in the place of NPN transistor?

• HI! Why you will swap the LDR & R2 when you will use NPN transistor?

• Well, if you want to use NPN transistor as in the 1st shematics but you want the LED to turn ON when it is dark (as in the 2nd schematics), you could just exchange the LDR and R2. When it is dark, the LDR’s resistance would be large compared to the R2 so the NPN transistor would be ON.

• Dude! the exact same thing you said about swapping the LDR with R2 would end up turning the led ON in dark; I’ve seen the exact thing in another video and i’ve been confused about it since days, how is it possible? Could you elaborate how more resistance in the ldr would result in increasing the current flow into the transistor? I’d really appreciate your reply :)

• That’s true. The LDR and the potentiometer make up a voltage divider:

https://www.build-electronic-circuits.com/voltage-divider/

If the LDR is at the bottom, it means that the higher resistance it gets, the higher will the voltage drop across it be.

The voltage across the LDR is the same as the voltage from base to emitter of the transistor.

And the transistor turns on (and lets current flow) when the voltage is around 0.7V.

• Is there a way to combine both circuits?
Maybe like that:
With light > Red led ON – Green led OFF
Without light> Green led ON – Red led OFF

• You can use two transistors to accomplish it

3. I have 12v led lamp and I’m planning to use 12v adaptor to make dark sensor led lamp. Can you help me find the materials that I need? Also the diagram? Thank you

• You could replace the LED and resistor with a relay that you connect your lamp through.

I am in big trouble.
i have to make project for my student. I want get 24V DC from LDR to my PLC. Please sir give me or provideme the circuit diagram to how to get 24V DC to my PLC from LDR

• i want to know the output waveform.but im getting noise when i use the same circuit as above.distortion are more than the actual output.can you tell me how to overcome this

4. thanx buddie.I like this one

5. Hi. Thanks for this. Wanna find out if this is also possible for a bulb.

• Hi, yes it is! If your bulb is 9V and works with around 100mA you can just replace the diode and resistor with the bulb.

If you need more current, then you can replace the transistor with a transistor that has higher Collector-Emitter current rating.

Or you can use a 9V relay instead of the LED+resistor and connect your bulb through there.

Many options =)

Oyvind

• Why is relay when 9 v bulb there To glow

• Good one, Oyvind :-)

6. thank you.can i know about what is the stuff in mobile phones screen display lighiting.

7. Hi there ,
I am interested if You have an idea how to make a simple device ho can worn me when voltage battery (from a RC submarine ) drops below a desire value by making very LOUD SOUNDS . Being in the watter all the time You can’t see the Submarine !!! and the sounds can be heard .Is A VERY IMPORTANT DEVICE because if You can’t bring on surface the model is a DISASTER .

THANK YOU

MARIUS

8. how can we use a voltage divider with a transistor?

• What do you want to do?

9. I’m very interesting with this topic I also have a quick question i want to make a motion sensor for alarm,and I need your assistance of ideals.
Thanks for the wonderful work

• Hey Patricien! Then you should look into PIR sensors ;)

Oyvind

10. Nice article, great info.. You really make it very easy to understand..

• Thanks Nayan =)

Oyvind

11. why do we need ‘R2’ in the adove circuit. Pls explain the work done by it.

• The variable resistor R2 is used to change the trigger point for the LED. That is, how much light that is needed for the LED to turn ON and OFF.

Cheers!
Oyvind

12. Great information!

It would be helpful to have more specifics about the components used. Jameco has many different photocells (assume that’s same as LDR) and potentiometers. I am currently too ignorant to make an informed choice.

Thanks!

• Hey Ron, finally you made it through! ;)

The potentiometer used is a linear 100k potentiometer. Any linear 100k potentiometer would work.

The photocell/photoresistor/LDR I just found laying around, so i am not sure which exact one it is. But I had a look at the ones at Jameco, and it looks like all of them will work.

Cheers!
Oyvind

13. I’m using a dark detector ckt , I want to glow the led when it is slightly dark but in my experiment model the led is glowing when it is complety dark .I have used two transistors & two 1.2 k ohms & one 10 kilo ohms pls reply fast pls reply

• Hey
If you have built the circuit according to the schematics, you will have a potentiometer that you can adjust to make it glow when it is slightly dark.

But you mention two transistors, so I don’t know which circuit you are using….

Cheers!
Oyvind

• sir plz answer me..for fire alaram using thermistor and with out use of any IC …

• Use an opamp and you can set the sensetivity to what ever ambient light level you want it to turn on at.

14. what would happen if you took the transistor out?

15. can you send me the circuit of firealram using bc 548 and themistor…i tired but cant succes plzz send me suggetion or circuit on my email id..thank you sir ..

• haha wow man you get alot of the same questions haha. Not sure why some of them dont understand. Guys im very new to electronics. That is the simplest diagram that you will get on this topic. Try making that and if you succeed play around with the same one just diffrent parts like one that uses noise or all that.

16. Hi
Can you please give a short idea how using the NPN transistor made the LED light up, when the LDR had high resistance?

Thanks.

17. Rattling nice pattern and good subject matter, hardly anything else we need D. ddaekbeffecaaddd

18. heyyy m really very thankful that I got my answe here . actually I was confused n really banging my head on the wall that how to make my led glow when it is dark.. actually iny circuit it was glowing when it was coming in wid contact of light.. now I got to knw the fact of npn and pnp transistors. …
thanks a lottt

• Great to hear! =)

Oyvind

19. Which gives the best battery life, LED on all the time or using this circuit to switch on the LED only when dark?
Thanks.

• Hey David,
It will use less power if you use the circuit to only have it on when it’s dark.

Oyvind

20. Hey!

Nice video. I’m just wondering, how exactly does changing the potentiometer values change the trigger point of the led? The potentiometer is connected to the power source and photo resistor so how would it change when the transistor is on?

Thanks!

• Hey!

The transistor turns on when the voltage on the base is around 1.6 volt.

The values of the potentiometer and the photoresistor determines the voltage at the base. Read about the voltage divider here, and you might see how it works: https://www.build-electronic-circuits.com/voltage-divider/

Cheers!
Oyvind

21. Thanks and it is very easy to understand.

22. Great site. Your explanations are very clear and presented in a very concise manner that is not dry or boring. Thanks!

23. nice ckt. simple but cool.it works perfectly fine

24. just a suggest. the dark ckt dosnt drive the relay ,it needs to be followed by a current amplifier{using bc547} to drive the relay,since the current is less for bc557.

25. hello sir ! your circuit is great . I have a question …..

can I replace LED and resistor with a motor to make light follower robot.

• You have to make sure the transistor can provide enough power for your motor (you’ll find this info in the datasheet of your transistor)

Cheers!
Oyvind

• Hello sir
Can we use this LDR SENSOR with 15 watt AC(220) voltage led bulb? if yes then pls give the details

26. Hello Oyvind! I have followed your circuit and it is working nicely. Thank you for such a simple but interesting project. Also I would like to know if it is possible to replace the led with a 12v led strip i.e. if it is possible to get an out put of 12v or at least 9v from this circuit. If so how should I proceed?

Thanks,
Somesh

• Hi, yes you can replace the LED+resistor with whatever you want. You just have to make sure that you have a battery that gives you enough voltage and that the transistor can handle the amount of current that goes through your LED-strip.

Cheers!
Oyvind

• Hi Oyvind! First of all I am a newbie at this! What I have figured is that the BC557 transistor is a low current (max 100ma) low voltage (max 65V) transistor, and the max output from your circuit is about 9V and 5mA.
Now I can still power up a LED strip of 400mA but with very low brightness due to the low current output. I was thinking what if I replace the BC557 with a BC807 which is a high current (max 1A) low voltage (max 45V) transistor, would it be possible? If so what else do we need to change in the circuit?
Thank again for the project.

Best
Somesh

• Hi Somesh,

I am really happy to see that you did the research and found a transistor that handles more current.

If your LED strip has a current limiting resistor inside itself (it probably has), then you can just replace the led+resistor with your led strip and use a 12V source instead of 9v source, and you should be good to go.

Oyvind

• Hi! Do you mean that I should replace the BC557 with the BC807 and then use the 12V power source or that just the 12V would be sufficient without the BC807? Please clarify.
Thanks a million for your support.

Best,
Somesh

• Yes that is right Somesh.

You need to use the transistor that can handle the 400mA of your led strip.

Cheers!
Oyvind

27. Hi! Oyvind! First thank you for taking the time to help me with this project. Also keep up the good work. I will work with the BC807 transistor and get back to you with the conclusions.
Have a great day!

Cheers!!!

28. thnx for the great info sir, I’m a newbie, What ratings of resistor should I use to apply your circuit using a 220volts, I want to apply in my house, thanks so much

• Hi,

You need to calculate how much power the resistor will dissipate, then get a resistor that can handle more than this. I don’t have any posts on calculating that at the momentm but I’m sure Google can help you out.

That said, I don’t recommend messing with the 220V if you don’t know what you are doing. You can hurt yourself and you can potentially craete a fire hazard if you choose wrong components.

Oyvind

• Sir Oyvind, Ive searched on how to compute the power a resistor will dissipate and I’ve come up on using a 20w resistor, will it work? or do I need to add more components so that I can use the circuit uisng 220v? tnx in advance.. I’m really a newbie, :)

• That’s impossible for me to say since I have no idea what you are trying to achieve… =)

Oyvind

• Just contact me so we can talk08098704583

• Hi Oyvind,
Thanks a Million for sharing about electronic circuits.

Thanks
Murugan

29. Hi! Thank you for the very simple yet clear info. I’m just wondering because from what i read from other books about the flow of electrons in a circuit, the flow would be from negative to positive. Is that correct sir? Thanks in advance.

30. Hello ,
How are you? I have a good question. The question is that I never see a dependent current or dependent voltage source in any schematic for TV, radio , or computer why teaching them in college course. Please help me understand what they use them for in electronic industry, thank you for your answer and God bless you.

• Hi Jean,

Thanks fo your question. I don’t remember exactly, but I think these are used to model the behaviour of for example a transistor. So it’s not a real component, it’s a tool for doing calculations.

Cheers!
Oyvind

31. Hello Oyvind! Once again thank you for this project! After working with it for quite some time now I am able to light entire LED strips with dark sensors and also I have designed a circuit with three BC547 transistors which when added to a LED 5050 strip powered by 12v supply changes color according to the light! If you’ld like I can share the circuit with you!

Cheers!
Somesh

• Cool =)
Yes, I would love to see it.

Oyvind

32. hi,
I am a new learner i want make motion led circuit to use home current how to make it please suggest me.

33. Sir,I wan to use an alarm of 3v and 600mAh instead of LED in darkness sensor.
Thanks.

34. What difference does it make when we reverse the position of ldr with r2.?

35. got use of it

36. Hi Oyvind,

Really happy to find this tutorial. Great website and tutorials, it has been very helpful to me.
I am trying to build a sound installation based on a DIY 808 bassdrum from Erich Archer (http://www.ericarcher.net/wp-content/uploads/2014/07/tr-808-bass-drum-diy-project.pdf)

I want to trigger the bass with a LDR. The idea would be that if you hold your hand in front of the LDR the bass is triggered. I have no idea where on the scheme/circuit I would have to install your LDR circuit and what kind of values for resistor etc. I will need to trigger the whole. And if this is even possible.

The 808bass circuit has to be triggered with a logic signal. So tie ACCENT to +12V (+15V) and connect the logic signal to trigger. The trigger pulse has to be short (like 5ms).

This is the schematic I built: http://nathanaelreuling.nl/bodil/Kick808-2.jpg

I would be very greatful if you could help me on this.

Cheers,

I.

37. Can I use the BC547 to make the circuit sense dark instead of light, or will I have to replace the transistor?

38. I want to use this circuit on a input voltage of 6v and the led at 5v. What do i need to change ?

39. thank you! it worked fine for me

40. Do I need additional circuitry to add a photocell (LDR) to a 6V DC battery powered strobe light, or can I just tie in. If I need circuitry, can I use the photocell and circuitry from a 110V AC night light?

41. I have 2 questions. The first one is with the set up you have for the light turning on when its dark. Would you still have a power draw with the led off. My project is that i live on a sailboat and my anchor light is at the top of the mast. I want to try and save power and have the light turn on at the right time of im away from the boat. My second question is could i just hook the photocell to a relay when the sun is shining the photocell tells the relay to tuen the light off but when the sun sets the photocell loses power and lets the relay turn the bulb on. Im working with 12v. Its been awile since i have messed around with this stuff so im very rusty

42. how do i get a good multimeter that measure parameters like; voltage, current, resistance, frequency, signals, wave, and other measurable parameters as may be required in electrical/ electronics engineering profession?

I also books that can guide/ teach me how to build and design different circuits

• Hi,

here are some book recommendations: https://www.build-electronic-circuits.com/electronics-books/

I have never used a multimeter that can do all those things. I use a simple multimeter for simple measurements like voltage, current, resistance, etc. And an oscilloscope for more advanced measurements like frequency, etc.

Cheers!
Oyvind

43. Ok! but how do i get this books? i want to place an order so i can get them. If so then which adress?

44. i just want tom know how to connect the potentiometer if it has
3 pins?

All potentiometers have 3 pins. And you can see how to connect it in the circuit diagram in this article.

Cheers!
Oyvind

45. Really like the site. I’m trying to build a circuit where the LED brightness is dependant on the light level over the LDR. so instead of just being 100% on or 100% off, it varies based on the amount of light over the LDR. How do you alter the circuit to make this possible??

• Hi Paul,

Thanks:)
The LED brightness is actually dependant on the light level with this circuit. When I demonstrate in the video, I use my finger to make it really bright or really dark on the LDR, that’s why the LED is 100% on or off. But if you gradually change the light-level detected by the LDR, you will see the LED gradually getting more and more bright.

Cheers!
Oyvind

46. I need this type of circuit for a bug zapper that I want to turn on after dark. Using a solar rechargeable battery/cells for power. Is there a problem here? It looks to me that during the day, when the photoresister is conducting, that the battery is draining through it and the resister. It’s not powering the LED but it’s still using battery power that I’m trying to replace during the day. Am I reading this right? This circuit seems to choose the path for the electric current either through the LED or through the LDR depending on ambient light but the drain on the battery is there in both cases.
Thank you!
Grant

• Hey Grant,

Yes there will be some current in the circuit all the time. The amount of current will depend on your LDR and potentiometer values. Without having done the proper calculations, I think the amount of current when the transistor is off will be very low. Maybe 1mA or less. But I think you should do some measurements of your own to be sure.

Best Regards,
Oyvind

47. Can plz give a LDR circuit diagram that will make the out put to rotate a Simple toy motor

• Hey,

Just replace the LED and resistor with the motor. Just make sure your motor can handle the battery voltage you use.

Cheers!
Oyvind

48. Good day sir, it’s my first time getting to know yr site.im very much interested in building the sound amplifier module for speakers for my pc.i Have a few concern regarding the the cct. I need yr expertise advise.looking at the pcb layout.im a bit confuse how the input is connected as there is A 1 and B1 that connected to the potentiometer. Then A 2n B2. Connected to the ic. Please assist me in explaining how do I connect the input positive n negative wiring.n also the negative supply voltage.connection.as I can’t seem to open tHe the attachment file.as I want to see the
Layout.iall the ground connected together etc.please I may be asking u silly question as I’m just finding my way in this field.thnk you

49. Hi,
I’ve been looking at your ‘dark sensor’ circuit and wondered if it would work with a lower voltage battery….such as 1.5v ? What would you suggest for this.
I think I’m going to need your e-book !!

• Hey Tony,

1.5V will be enough to turn in the transistor, but it’s too low to turn on the LED.

Best Regards,
Oyvind

50. i like this circuit and i try bt136 triac whith on and of light automatically in evening and of in morning in series of lamp

51. hello admin, can i ask a favor? can you make a circuit design for the reverse one using proteus? it is for my project., and what is the code for this… please… thanks….

• Can I use a 100 k resistor instead of potentiometer?

52. Hi Oyvind, your site has been really helpful to me. thanks alot. You are doing a great job.

• Thanks Niola =)

Oyvind

53. Can i use this to turn on when dark, with the same components for the reverse process ? Is it possible with swapping any?

• Hey Anand,

At the end of the article I show how to do that.

Best,
Oyvind

54. can you give me a circuit of 4 leds, controlled by ldr. no led will light if there’s bright light, and 2 leds will light if the light is dim, and all the 4 leds will light, if its totally dark. help me in my project please.

55. Isnt there any logic gates involved like NE555?

• In this circuit, no.

Cheers!
Oyvind

56. is it possible that instead of led, id use a dc motor? and how? tnx a lot.

• Hey,

Yes that’s possible. But then you need a transistor that can handle the amount of current your motor needs.

Check the max current of you motor, and make sure the max collector current of your transistor is more than this. Maybe the TIP120 transistor can work for you…

Cheers!
Oyvind

57. will battery get consumed up on leaving it in dark?

• Hey, yes there will be some current going through the circuit even when it’s dark.

Best,
Oyvind

58. Dear sir, I am 8th grade student, I am making project of Automatic Railway gate for opening and closing by using LDR and with 9V battery. Kindly give me circuit diagram please. Its very urgent

• Hey,
Sorry I don’t have that.
Oyvind

59. hey! Transistors are of types,codes printed on their bodie and also different voltages, but no specific type is mentioned above to be used,pliz.

• Hey,

Any general purpose transistor should work. For the npn type you can use for example bc546 or 2n3904

60. Hi, i have been trying to make an electric generator using an alternator but, the problem is that an alternator is said to generate 300Volts and 600 Volts, how can i reduce it to generate 220-230 volts. The question is how can i make it & what methods can i use. Thank for all your working. Am always ready to make something that can make someone smile.

61. Thanks for the information. In my case I would like the LDR to activate a 12V solenoid when light is detected, instead of the LED Pleasecould you tell me what changes would have to be made to the components of this circuit diagram.
Many thanks
Wayne

• Hey,
You can replace the R1 and the LED with your solenoid.

Best,
Oyvind

62. sir
can we use operational amplifier in the place of transistor.If we use what will happen?

63. I’m running a solar system charging a 3.7 volt lithium which power 3.to 4 leds in parallel. Can you suggest a suitable day night circuit for this without reducing the intensity of the leds since the system is low power.

64. Please for the dark detecting circuit, can I replace the BC557 with BC558?

• Yes that should work.
Oyvind

• hlw , em confused why we use potentiometer in dark sensor , plz explain the working of this potentiometer plz

• The potentiometer is there to adjust when the light should go on/of (how much light is needed).

• thanks

• this site is very helping can you plx tell me the working of potentiometer in dark sensor project

65. if i use a 12v battery and 12v led what materials do i need to build this proj?

66. hello
i have a doubt(maybe silly).
how will the current pass through the ldr when it is dark though tbe ldr has very high resistance when it is dark.

• It won’t. Or at least very little. And that’s why the transistor does not turn on.

Oyvind

67. Can you please explain how a schmatic drawing is installed on a breadboard .
As a beginner at 55 years old this is not clear to me . THank you.

68. Oyvind
Can you also explain how you plot out step by step off a schmatic drawing to the breadboard .
I don’t understand how the schmatic components start and finish on the b-board .

• Hi Tony,
I’m not able to do that in a comment. But I’ll write it down as a suggestion for a future article. But I would advice you to try to connect a very simple circuit such as an LED and a resistor on a breadboard to get the feeling for it.

Best,
Oyvind

69. i am making a smoke detector using your circuit which activates when light goes off the only prob is that i want to put buzzer insted of an led so what changes should i make with resiatance 1 and power suply

• Hey,

If your bizzer works with 9V, just replace the LED+resistor on the right side with your buzzer. It has to be an active buzzer though (that doesn not need an external oscillator).

Best,
Oyvind

70. If you could do the terminations before inserting them in the breadsheet board it would be much much easier

71. sir how if the 100k resistor out.what will happen?

• You should try it and see for yourself ;)

72. Can we make a LDR circuit to turn ON the street light automatically of 700 volts ??

• Yes, with modifications that is possible. Instead of the LED+resistor, you can insert a relay that is rated for the voltage and current you need, and connect the street light through that.

But, I wouldn’t try it out in real life as it’s very dangerous.

73. hey! i would like to get that book,**getting started with electronics**, how can i get it?

74. sir, how the pnp transistor work? And at last of the article please explain the circuit how it works?

75. I have used 470 ohm as current limiting resistor and 2K ohm for the base. Now when I apply 5V, the circuit works fine. But if 9V is given, LED keeps ON irrespective of lights. Even if we remove the base connection wire, the transistor still conducts and LED remain ON. Can’t figure out why it is?

• Sounds like you have the pins mixed up… Or maybe you are using a pnp instead of an npn?

76. please and please I need to no how to differentiate a pnp and npn transistor with a multimeter..Please send it to my email

77. Hey. I recently bought some 12v led strip and set in mu room roof. Now I like to make a circuit to turn them when the dark. I want to make them brighter when the dark is getting high. I think you can understand me. When the darkness is getting high the led strip will be light up slowly. Can you help me to make a circuit for that. The led strip is 12v and 6A . Can you please draw me a circuit. .

78. please I have a small solar panel that produces 9v, so I try to use it to charge my phone. Each time I plug the phone, I firstly connect a multimeter to no if it reduces. So when i plugged the phone to that solar source, it came back to 4v which would not charge my phone but spoil the battery. So please what components can i add to amplify both the current and the voltage. I have tried a transistor, instead it to it back to 2.3v…….thanks

79. Hey i want to make a mini project for my submission so can U please help me in deciding what should i make????
Related to electronics & communication

80. am doing a mini speed breaker ( roller mechanism)… i have got a 12 v generator dynamo and nokia phone battery 3.6 v and a ldr sensor and four LED … how to design a ldr circuit for this and what type of transistor to use … the generator will be connected to the battery and the electrical energy saved there … then at night or in darkness the ldr will make the LED lights up … can you plz send me a circuit for this …thank you in advance

81. Thanx a lot sir for all the vidios…..

82. sir you are the best……..

83. Sir tell me one thing that when you are used the dark condition in LDR ckt
the resistance become high and voltage become low as u said in vidio.
But sir i have a doubt when resistance become high than current become low.
And in this condition the transistor is operated.
Because u said in your previous vidio that when the small base current flow from base to Emitter the transistor will operate.

• Hi, if you are talking about the first circuit in this article, you are right: In the dark, the resistance is high, the current is low, and the transistor does not turn on.

84. And when the Transistor is operated than the collector to Emitter current flow….
Then Led will glow….
I am confused….

85. Sir how to we make street light lDR

• Exchange the LED+resistor with a relay that can control the street light.

Best,
Oyvind

86. I don’t have a Resistor and transistor, is that fine ?

• Not really… This circuit requires all the parts. But you can always have some fun with LDR and an LED anyway.

87. Hello, I have had fun creating the first LDR circuit, thank you for your explanations and teaching.
I have tried creating the second LDR circuit and my LED wont turn on and cant tell what is wrong with my circuit. Do you have any trouble shooting tips?

• Hi,
First of all, check that you’re able to turn the LED on and off by turning the potentiometer all the way to one side, the all the way to the other side.

If not, there’s an error on how your circuit is connected. Maybe you misplaced the transistor legs. Note that this is a PNP transistor and not NPN as in the first example.

Best,
Oyvind

88. How can i use this automatic light detector with 100W electronic bulb?

89. Thank u sir i tried the second one and it worked…..
it was like oh!!
I shined before my classmates..
thank u once again…

• That’s great to hear =)

Best,
Oyvind

91. I see that the collector and emitter terminals are interchanged in case of pnp and npn circuits. Is it that the collector should always be conected to the load? Can you please tell me why these are interchanged?
And great going sir. You break down the most difficult topics into very simple stuff so that we can understand easily.Keep it up sir.

• Hi,

There’s no rule saying that you have to connect the load like this. But in the way I’ve connected the load, it’s much easier to calculate voltages to find the correct resistor values.

Best,
Oyvind

92. Great article!
I have been searching the net for a way to build a 12vdc circuit with an LDR to operate a fan when the lights go out. If the source is 12vdc and the load is 12vdc it seems no resistor would be required other than on the base of a transistor, is that correct? I have only found diagrams for circuits using 9vdc or less and operating an LED. I will admit I am a novice when it comes to building circuits so any help you could provide would be great.

• Hey,

To operate the fan, you could in theory just replace the LED+resistor on the right side with your fan. But – the transistor here, BC547, it can only handle about 100mA (I think) and fans usually requires much more. So you would need a transistor that can handle more current. For example the PN2222

Best,
Oyvind

• Thanks Oyvind, for the reply and assistance!

93. In regards to the video of the ldr circuit, isn’t it the case that the ldr resistance is high when finger is placed on it to eliminate light which then implies that the led turns on (when its dark)? As oppose to what was illustrated in the video which makes the ldr useless if you think about it.

• There’s a circuit at the end of this article that shows how to turn the LED on when it’s dark.

94. Hey cool post!

I am trying to build something similar, hope you would help me.

I have a series LED circuit (14leds) and I wish to ON them when the LDR is in dark.
How can i modify the your given circuit according to my requirement?

Best,
Oyvind

95. Hi.. I am from Venezuela. Nice to meet you! I have a device which works like that but it use 220 volts, can you tell me what kind of LDR I have to use? Thanks!

• Hi, That depends on how your circuit looks. If you already have the device, the easiest would be to just find a replacement part for it.

Best,
Oyvind

we tried the circuit (glow light when bright &off when dark) and it was working perfectly ,but the reverse one did not worked even after we followed ur circuit diagram plz reply asap we are working on this since one week

• Are you sure you used a PNP transistor (not NPN) and placed the legs correctly?

Best,
Oyvind

• Can i ask what is the value of LDR used?

• I think it was one that is around 10k for light and 1M for dark.

Best,
Oyvind

97. Can u plz tell me where a buzzer if I want it to go off when the led is on? And also what value of variable resistor should I buy?

• Just replace the LED and resistor with the buzzer. No need for a resistor as long as the buzzer can handle 9V.

• tried and is working :) but for the dark sensor the led is always on :( and also can i give both light and dark indicator in the same circuit?

• Then you might need a higher resistance than 100k for the dark-sensor.

Not sure what you mean about using both light and dark. If you want the buzzer/LED to be on both in light and dark, just connect it directly to the battery ;)

98. I want to use 3 leds instead of buzzer and use a 10ohm resistor with those……is it possible ?any changes required? Also where should i place the emf ?

• Hi,

There’s no buzzer in this circuit. But you can place three LEDs in parallel instead of just the one. Just reduce the value of R1 to around 100 ohms to get some more current running through the LEDs.

99. Hi Oyvind,

Why is the cariable resistor connected after and not before current feeds into the transistor base?

Many thanks for the great posts,

Victor

100. I build a ldr circuit as shown above but…. The ldr plays does not play an role in the circuit.
Even if light is not provided,the bulb glows

• Try turning your potentiometer all the way to each side. If you’re not able to turn the LED on and off with the potentiometer, you need a larger resistance value for your potentiometer.

Best,
Oyvind

101. Hai sir, iam just confused becuouse when dark its high resistance and light ,low Resistance current flow its k but I think this is automatic light on and off day and night is it OK but here dark when its high resistance no current flow ist k lights will not on but we want day and night on and off plz clarify sir but I don’t know u understand or not clarify sir

• Hi Shivu,

Best,
Oyvind

102. Sir day time high resistance but led is off and no current flow clctr to emmittet but in your video high resistance is dark how its sir

• Daytime is light. Light gives low resistance. Dark high resistance.

103. thanks buddy

it was the exact content that i was in need of

keep it up!!!

104. i want to use MOSFET instead of BJT… will it work?
my source is 12v , 30+Aamps

• Yeah, should work. just adjust the resistor for the LED to a bit higher value to take into account the increased supply voltage.

Best,
Oyvind

105. What is the photoresistor dark resistance for the one used in the experiment ?
If I want to use the circuit to cut the power to a motor instead of the led when there is no light reaching the ldr, how should I modify it?

• I think it was 1M in dark.
To use motor instead of LED, replace LED+resistor with motor. Make sure the transistor you use can handle the amount of current your motor needs.

Best,
Oyvind

• How do I also incorporate an LED which will shine on the LDR, so when I cover the LED, the motor would stop working? Also do I have to use a MOSFET in this case?

• You have to do something to make sure the light in the room doesn’t hit your LDR, only the LED.

You can use MOSFET if you want yes, but it’s not a requirement.

• Thanks! Also, where do I place the LED in the circuit?

• Hey Katastrophy,

It’s type 2.

Best,
Oyvind

• Last Question Oyvind…So lets say I want the motor to work while there is no light shining on the LDR and then to stop working when the light strikes the LDR, then should I just switch the positions of the LDR and 100k potentiometer?

Thank you so much for the help! You have been of great help!

• Great =)

You’ll find how to do that under “Making The LED Turn ON When it’s Dark” in this article ;)

Best,
Oyvind

106. Hello sir,
Please help, I want to create a detector or sensor that operates in 12 volts and that use on some of these devices (Thyristor, SCR, SCS or UJT)

107. can i add both buzzer and led

108. Hi Øyvind

Thanks for the very informative articles on your site. I have a basic question on this article: why use a transistor at all? If we build the circuit without the transistor, and without R2, and we place the LDR in series with R1 and the LED, how would this not achieve the same outcome?

• LDRs often have a resistance of 1k to 10k or more in light. So, the current to the LED would be too small for it to light up.

Best,
Oyvind

• Thanks, that makes sense

109. hi! may i know if the circuit can be connected with GSM module? For example if the LED turns on it will connected to the GSM module. Is it possible? Thanks a lot! :)

• Sure! Everything is possible =) But exactly how to do it depends on your GSM module.

Best,
Oyvind

110. it really good project and i’m trying for more calliber circuits.. thank you

111. can i replace the LED withb a speaker

• Hi,
There’s no sound signal to drive the speaker in this circuit.

Oyvind

• hello sir
what is the important of this project and what is the daily uses of this project

112. Sir i m newbie. How to connect a preset resistor in the circuit

113. How can the circuit can run 110v power supply? thank

114. Three Questions:
1) Can I use a 9 volt AC adapter plugged into a 220 Volt Outlet here?
2) I don’t really want a Variable Resistor here. What’s a good value that won’t fry anything in this circuit? Will 10 KilloOhms work?
3) Though the 2N4401 has previously been mentioned as an acceptable substitute for the BC557, will the changes implied by 1) and 2) change this?

• 1) Yes, as long as the output is DC
2) That depends on your LDR. You can try different values from 1k and up to see what works.
3) No

Best,
Oyvind

115. Hi,
I am looking to design this:
1- Minimum DC voltage required 8V
2- Maximum DC voltage 18V
3- Operation temperature -40F to 120F
4- Dry contact sensor (Digital output)
5- At least 30 seconds safety time delay or adjustable time delay
I know that for the delay I can add a RC circuit to it. I am not sure how to do it. Can you please help me wit that?

116. HI..
please How can I use LDR to sense Red Color?

• It cant’t… You need a color sensor.

117. Hi,

I want to make the circuit for a school project which turns the LED ON when there is no light.

But is it possible to modify the diagram to:
1) use an NPN transistor (PN2222) instead of the PNP (BC557)
2) use 10k potentiometer instead of 100k

HOW DID YOU COME UP WITH THE RESISTANCE VALUE YOU USED FOR THIS CIRCUIT?

• It depends on the LDR you are using. But test it and see =)

118. Hi Øyvind Nydal Dahl! And thanks for the article. I have modified your circuit (night detector circuit) and I want some help, cause I’m a beginner. I’ve modified the following parts:

1) Power Source at 5V.
2) My led is 1W and it has forward voltage 3.2-3.4V and forward current at 300mA.
3) I’ve replaced the resistor with one at 6.8 Ohms.

My question is this: When I turn on the circuit, the transistor gets hot too much (and after few seconds it breaks) and the LDR doesn’t work. My led stays on all the time (full light). I’ve read on forums that I have to replace the transistor maybe. Can you help me and tell me what to do?
Thank you so much!

119. Interesting site.Looking to power a Garmin Edge 1000 gps unit during a long (18-hour-non-stop) bicycle ride – any advice as to features / capacity I should be looking for?Thanks

120. heyyyyyy
are u crackkkkkk

121. Hi bro…
I want to make Lesar security system for my farm . For that I want that this LDR work just reverse….
What will be the circuit now
Plz help

122. Hi,

I would like to use an LED and a 10k pot to vary the resistance of the LDR. How might I do that?

Thanks,
Chris

123. I will immediately grab your rss feed as I can not find your email subscription link or enewsletter service. Do you have any? Kindly let me know so that I could subscribe. Thanks.

124. Can I usw transistor 547

125. Hi,
I made an Ldr smoke detector for my project but but it works in reverse as in when there is light the buzzer goes on and when it is dark it is off, what could be the problem?

• Hi, the first circuit works like that yes. The second one works in the opposite way.

Best,
Oyvind

126. Can you clarify me that arrow just bellow R2?.Otherwise it is very simple diagram.

127. Please tell me what that arrow means in the 2nd circuit diagram bellow the R2. Pls reply fast pls pls.

• It’s a potentiometer, not a standard resistor. The arrow is the middle pin/wiper.

128. If you have not done so you should explain that current only flows from positive to negative with circuit designers and engineers. In real life it flows from negative to positive. I discovered 70 years ago, when I was sixteen,that the symbol showing the direction of current flow through a diode is reversed.

129. Very nice. It’s very easy to understand your demonstrations with theoretical concept. I loved it alot. I just wanna design a new LDR circuit. So just working upon it! So let’s see how the stuff will make out! Thanks for your videos and very helpful website. Thanks to the team!

130. Hi, I have made the circuit with the LDR and the PNP transistor where the LED turns on when it is dark. I have a couple question, just to make sure:

1) Does the voltage (potential difference) across the LRD become close to zero when the LDR is exposed to light and the transistor is turned off (no current passing through the LED)? The LDR resistance is not exactly zero when there is light but the voltage drop is so small and much less than 0.7C that can the transistor cannot be turned on.

2) When it is dark, the current passing through the LDR and the resistor R2 is extremely small because the LDR has a very large resistance. Nonetheless, that small current produces a voltage drop across the LDR of about 0.7V which turn the transistor on and consequently the LED on too.

Thank you!
Øyvind

• Hi,
Great! it seems like you have understood it correctly.

Best,
Oyvind

131. hii,
actually i have made this circuit but i am facing one difficulty. the difficulty is this ..
The distance between my leds and ldr is much nearly 5-6 cm because of which when a laser beam strikes the ldr the led turns onn but asa lazer beam is switched off led also switches off .. i want that when ldr is triggered once and led is turned on then untill an unless we remove the battery led continues to light .
plss sugest me some ways .
thank you.

132. How to make ldr ckt. O/P is one when light is off? Please reply fast

133. Oyvind, Thank you for all the great info.
If I add a second photoresistor in parallel will either one trigger the LED?
Thanks, Frank

• Hey Frank,
Yes, that should work.

Best,
Oyvind

134. Good day! Would you mind if I share your blog with my facebook group?
There’s a lot of people that I think would really enjoy

• Sure! Feel free to share it!

135. Can you explain why changing the position of LDR and resistor 2 reverses the function of LDR?

136. Sir I Wanted To Ask That Is LDR A Open Switch, And Gate, Or Gate Or Off Switch.
I Would Be Very Thankful To You.
Thanks!

137. Can we use more than one Led’s??

• Yes, but make sure you choose a resistor size that sets the correct current for the amount of LEDs you want to use.

138. What if we dont use a resistor??

• Then you’ll most likely break you LED.

139. nice work bro. thanks alot.

140. Thanks for this. I have been surfing the internet for circuit that run on two LDR working alongside one another. Each LDR trap their own light, if one of the LDR is having higher impedance, pinA becomes high and pinB; low, otherwise pinB becomes high and pinA; low. But if they happen to be in the same impedance, pinA and pinB becomes low

141. I need to know what is the resistance of the r1 and r2 that need to be applied in circuit. And also i need to know whether r2 is a varible resistor. Can’t we use a normal resistor for r2

142. I used a buzzer. It worked, but the transistor got very hot??

• Sounds like you are running too much current through the transistor. Try adding a resistor in series with the buzzer.

143. what the r1 360 indicate

144. I want some important questions for this matter

145. There is something in this circuit I do get: Why do we want the wiper of R2 grounded, instead of connecting the base of the transistor to R2’s wiper and not between LDR and R2 ?

I mean, it is basically equally functional, is it not ? R2 still serves the function of setting a resistance “floor” in LDR+R2.

Sorry if this is dumb, I think I understand how the circuit works as described, I’m just unsure as to why it’s made like this and not as I thought.

Thanks !

• You’re absolutely right. You only need the wiper plus one of the sides. No need to connect it like I did. Often the third pin is connected like this, just to not leave it hanging. But no need to.

Best,
Oyvind

146. What is the resistance of your ldr ( they come in a variety of values)?

• I think I used a light-dependent resistor (photoresistor) with around 5 to 10 kΩ resistance in light and 200 kΩ or more in dark.

Best,
Oyvind

147. I still don’t understand, why is the potentiometer there? Why won’t the circuit work without the potentiometer? Please, Please someone explain

• It needs to be a resistor there. It makes up a voltage divide with the LDR. With a potentiometer, you have can adjust the resistance and thereby adjust the light-sensitivity.

148. Hey not be very judgy but your grammer needs work.
but some of the points you mentioned are not correct and you interchanged some things which is not correct. the led glows only when no light falls on the ldr not when there is light. please correct this as there might be someone else who needs this document but will just blindly copy instead of going through.
just a concern.

149. What would be the effect if R1 is not used?

• Then you don’t control the current to the LED anymore and your LED will burn up pretty soon.

150. Never use a 10 turn pot. You don’t know where the wiper is and you don’t know which way the wiper is going when you turn it clockwise.

Colin Mitchell
TALKING ELECTRONICS.com

151. “Making The LED Turn ON When it’s Dark”

Thank you,
I needed this to “turn off” a blinking led circuit during the daytime.

152. Thank you so much. It worked for me.

153. Hi! You explained that when it’s dark, the LDR has high resistance, making the voltage at the base of the transistor too low to turn the transistor ON. How exactly does high resistance make the voltage low? Not sure if I’m missing something, but it just didn’t make sense to me. Let me know!

154. This does not make sense. An ohm meter will tell you all you need to know about a 10 turn pot. Having said that, there is no good reason to use a 10 turn pot here.

155. Hi, I’m making a solar alarm where you use a potentiometer and this LDR circuit to set the relative time at which it will go off, just wondering what potentiometer to use and where to put it.

156. Why we use relay.. When there are 9 v bulb there… In place of resistor and led

157. Thank you for the explanation. Very simple and you’ve made it easy understand.

158. T here’s no thing as “Photons”. Light is RADIO your eyes are RADIO RECIEVERS like little satellite dishes!

159. An LDR typically has a resistance of 100 Ohms when brightly illuminated. Since the LDR is the only resistance between +12V and the base of the transistor, a current of (12 / 100 =) 0.12A (120mA) will flow into the base.

Bye, bye transistor.

160. Is it possible to make the LED flash on and off with light intensity

• Yes, but you need a more complex circuit.