# dimming led with photoresistor

I want to dim a led in a circuit if there's less light. However, the Photoresistor I'm working with reduces the resistance when there's more light. How can I achieve the opposite effect on resistance ?

• I=U/R, smaller the resistance of photoresistor (brighter the light source) bigger the current thru it and bigger the resistance (dimmer the light source) smaller the current thru it. The photoresistor is already doing what you want. Although for LEDs the dimming is usually done with PWM as it is a lot more controlable and more efficent I belive. Commented Aug 8, 2015 at 14:19
• The LDR is working just like it's supposed to, so to get what you want will take some circuitry. Can you post the LDR's data sheet or a link to it or a part number? Commented Aug 8, 2015 at 15:29

I believe this method using a transistor should work well for you.

http://electronicsclub.info/transistorcircuits.htm#sensors

• This show schematic turns and off the led. It doesn't dim it Commented Aug 8, 2015 at 9:00
• @Mellowcandle: That'll depend on on the resistance change of the LDR, the resistance of the pot, and the current gain of the transistor. More important, though, is that the sense of the circuit is right since the brighter the light falling on the LDR, the brighter the LED will be. Commented Aug 8, 2015 at 15:24
• If the function of this circuit is not smooth enough, just add a emitter resistor. Commented Dec 25, 2016 at 19:50

simulate this circuit – Schematic created using CircuitLab

As someone specified in the comments,your LDR increases resistance in low light and decreases it when there is more light,this is what you need.However,it doesn't dim the LED.

The schematic illustrates the concept of dimming a LED using PWM(Pulse Width Modulation) with the help of a 555 timer working as an astable mulivibrator. Diodes $D_1$ and $D_2$ are there to make sure that the duty cycle can be varied between 0% and 100%,which means you have more control on how much will the LED be dimmed.

$R_1$ , $R_3$ depend on your LED and LDR specifications.Keep in mind that the duty cycle controls the brightness,while a high frequency makes sure that the eye does not feel uncomfortable seeing the flickering.Try setting it to somewhere above 100 Hz.Also,the 555 outputs a voltage approximately equal to the supply voltage and a current of a few 10s of mA,so remember these when you select a value for $R_3$ and when you decide upon a power supply(battery).

D(duty cycle)=$\frac{R_1}{R_1+LDR_1}$

f(frequency)=$\frac{1,44}{(R_1+LDR_1)C_2}$

The included schematic is a variation on this one:image
Source of information:site

• This is not only a unnecessarily convoluted schematic, the circuit wasteful, but it gets the overall function bacwards! The OP wants the LED to get brighter with more light onto the photoresistor. This circuit works oppositely. Commented Dec 25, 2016 at 19:52
• @Olin Lathrop the circuit is indeed wasteful,but the OP did not specify if it should be so or not.I'm not sure why you said the schematic is convoluted.Perhaps you were talking about "y ohms" and "n ohms"?What's more,when light reaches the LDR, Q1 and Q2 conduct and Q3 acts as an inverter,Olin.That's what makes the circuit work as intended. Commented Dec 27, 2016 at 12:24
• The schematic is hard to follow with transistors sideways, paths snaking about, not nice horizontal power rails sorted by descending voltage down the page, etc. Yes, this circuit inverts, which is opposite of what the OP wants. He want more LED output with more light onto the LDR. Commented Dec 27, 2016 at 12:29
• @Olin Lathrop Now I understand the convoluted part,my fault,I'll fix it.I figured out the rest,too.I thought of the regular LDR.I will take care of it,many thanks.Do you mind if I ping you after I'm finished to check it again? Commented Dec 27, 2016 at 12:39
• @Olin It's done Commented Dec 27, 2016 at 14:40

From a purely theoretical standpoint, you should just be able to put the photoresistor in series with your led. That way, when there's less light, the resistance across the photoresistor is high, increasing the voltage drop across the photoresistor and limiting the current through the led. This would not be very reliable though, as CdS photoresistors can be slightly unpredictable at times.

• While this works in theory, it's not useful in practise unless you have a very unusual photoresistor. Most photoresistors have way too much resistance to be able support reasonable LED current within their dissipation limits. Commented Dec 25, 2016 at 19:55