automatic and manual dimming of leds with pwm

Thread Starter

toekietoekie

Joined Jan 22, 2022
13
hello,
I am building something for wich I need to control 156 leds in 26 strings of 6. I need to be able to dim them both automatically and manually. In automatic mode they should become brighter when there is more ambient light. To do this I am using a 555 timer circuit and a potentiometer/LDR.
I think I have made a working circuit but it would be nice if someone could check for any errors before I start ordering components.
For R1 I used 0,693 * 47.000Ω * 0,000.000.01F. this gives me a charging time of 0,0003257 seconds
For the discharging time I used the same formula with the potentiometer at 5kΩ and have gotten a maximum discharging time of 0,003465 seconds. This would mean the leds would only be on for about 10% of the time.
The ldr has a light resistance of 16kΩ and a dark resistance of 0,5MΩ, so it should give about the same result as with the potentiometer I think.
schema ledjes sterrenkaart 6.PNG
 

Alec_t

Joined Sep 17, 2013
12,815
With the 555 configured like that, the resistances of the pot and R32 each need to be less than ~half of R1 for oscillations to occur.
Edit:
The minimum duty-cycle with the above configuration is ~33%.
If you want a wider range of control you can provide timing cap charge and discharge paths via pin 3 and steering diodes, like this :-
AlternateConfig.jpg

Depending on the ambient light, you will probably find 500k for the pot is too high for easy adjustment, considering that the LDR resistance will be around the R1 value for a 50% duty cycle.
 
Last edited:

Thread Starter

toekietoekie

Joined Jan 22, 2022
13
sorry but i don't understand your circuit. As far as i can see you have used the output for the timing capacitor instead of the discharge? How does that work?
And why do the resistance of the pot and R32 need to be less then half that of R1? Sorry I'm rather new to electronics
 

Alec_t

Joined Sep 17, 2013
12,815
How does that work?
It works because the output pin 3 can pull down and up. Check the schematic in the 555 datasheet.
And why do the resistance of the pot and R32 need to be less then half that of R1?
Because the 555 has two comparators. The switching thresholds for these are Vcc/3 (Trig) and 2*Vcc/3 (Thrs) where Vcc is the supply voltage. The timing cap voltage at pin 2 (Trig) needs to go below Vcc/3 to start the oscillation.
 

sghioto

Joined Dec 31, 2017
3,288
Sorry I'm rather new to electronics
I tested your circuit and it does work. In the manual mode with the component values chosen the duty cycle was 0 to 100% but the resistance of the pot only needed to change from zero to 25K ohms so you would be using only 5% of the 500K pot
 
Last edited:

sghioto

Joined Dec 31, 2017
3,288
Here's a modification that allows appx a 5 to 99% duty cycle in the manual mode.
In the LDR mode the duty cycle measured from 5 to 60% with the specs given for the LDR.
1644268940438.png
 
Last edited:

Sensacell

Joined Jun 19, 2012
2,999
R4 can be removed, it does nothing.

Since the output never goes into high impedance mode (like an MCU IO pin on reset) the gate is always driven.
 

Thread Starter

toekietoekie

Joined Jan 22, 2022
13
Here's a modification that allows appx a 5 to 99% duty cycle in the manual mode.
In the LDR mode the duty cycle measured from 5 to 60% with the specs given for the LDR.
Thanks a lot! How should I choose a LDR that gives me a better range? I thought choosing one with about the same range of resistance as the pot would give the same result but apparantly this is not the case.

Check out this Circuit,
100% Linear PWM, with a ~4-Volt to 8-Volt control Voltage ............
wouldn't this be about the same as working with a 555 timer?

R4 can be removed, it does nothing.

Since the output never goes into high impedance mode (like an MCU IO pin on reset) the gate is always driven.
thanks, i'll remove R4
 

sghioto

Joined Dec 31, 2017
3,288
How should I choose a LDR that gives me a better range?
The problem with the LDR in the 555 circuit is the minimum resistance of 16K. You would need to find a LDR with the lowest resistance at some specified light level.
Something else that I'm curious about. If the ambient light is getting brighter why would the LED lights need to get brighter?
LowQCabs circuit looks promising. I think I can configure a voltage divider using the pot and the LDR to get similar results. I'll bench test it later this morning.
 

Ya’akov

Joined Jan 27, 2019
5,663
The problem with the LDR in the 555 circuit is the minimum resistance of 16K. You would need to find a LDR with the lowest resistance at some specified light level.
Something else that I'm curious about. If the ambient light is getting brighter why would the LED lights need to get brighter?
LowQCabs circuit looks promising. I think I can configure a voltage divider using the pot and the LDR to get similar results. I'll bench test it later this morning.
If the lights are a display, rather than illumination, they would need to be bright relative to the ambient light.
 

LowQCab

Joined Nov 6, 2012
2,054
The Op-Amp could be replaced with a Comparitor, probably cheaper too .........
Texas Instruments TLC3702IP
DigiKey p/n 296-10300-5-ND
~$1.53
.
.
.
 

LowQCab

Joined Nov 6, 2012
2,054
Instead of using a Switch, use 2 "Pull-Down" Diodes,
one Diode for LDR-Voltage, and one Diode for "default" or maximum-brightness.
This will require a ~100K "Pull-Up" Resistor at the Input of the Op-Amp, or Comparitor.

You could also use a "Summing-Amplifier" or a "Mixer-Pot" between the 2 Inputs.
.
.
.
 

Thread Starter

toekietoekie

Joined Jan 22, 2022
13
If the lights are a display, rather than illumination, they would need to be bright relative to the ambient light.
That's exactly what i'm trying to do, dim when it's dark so they don't blind you and bright when it's light so you can actually see them:D

The values listed worked really well with 0 to 100% PWM on both manual and auto modes.
View attachment 260149
Then would this be the final solution for what I'm trying to do?

The Op-Amp could be replaced with a Comparitor, probably cheaper too .........
Would this have any effect on the circuit or can I really just replace the opamp with the comparitor and it would work just as well?
 

Thread Starter

toekietoekie

Joined Jan 22, 2022
13
Instead of using a Switch, use 2 "Pull-Down" Diodes,
one Diode for LDR-Voltage, and one Diode for "default" or maximum-brightness.
This will require a ~100K "Pull-Up" Resistor at the Input of the Op-Amp, or Comparitor.

You could also use a "Summing-Amplifier" or a "Mixer-Pot" between the 2 Inputs.
.
.
.
How would this work? If I remove the switch how can I choose between manual dimming or automatic dimming?
 

LowQCab

Joined Nov 6, 2012
2,054
How would this work? If I remove the switch how can I choose between manual dimming or automatic dimming?
.
You would have 2 brightness "LIMITERS".
Which ever Input is lower would dictate the maximum brightness possible.

You could also flip the Diodes and have the operation be the opposite ............
which ever Input is Higher would dictate the maximum brightness,
( Flipping the Diodes would also require flipping the "Pull-Up" Resistor on
the Input, and making it a "Pull-Down" Resistor ).
.
.
.
 

Thread Starter

toekietoekie

Joined Jan 22, 2022
13
.
You would have 2 brightness "LIMITERS".
Which ever Input is lower would dictate the maximum brightness possible.

You could also flip the Diodes and have the operation be the opposite ............
which ever Input is Higher would dictate the maximum brightness,
( Flipping the Diodes would also require flipping the "Pull-Up" Resistor on
the Input, and making it a "Pull-Down" Resistor ).
So if I understand it correctly I would be setting 2 brightness levels that I could choose from?
 
Top