# switch the brightness of an LED

Discussion in 'Electronic Design' started by [email protected], May 22, 2007.

1. ### Guest

I want to use LEDs in a motor vehicle, but they must be dimmed to
about 10% of their daytime brightness at night to avoid blinding the
driver. I need a simple, cheap circuit to do this.

My thinking was to use a light dependent resistor (ldr) to switch a
transistor (tr) that then added a resistor (R2) in parallel with the
LED. This resistor would reduce the current in the existing resistor
R1 (as it is in series with it) thereby dropping the current available
to the LED. But would it also change the voltage substantially at the
resistor/LED junction so that the LED no longer lights?

+V--\-----------------\
| |
ldr R1
| |
| --R2--+
| / |
+---Tr\ LED
| \ |
| | |
0V---/-------/--------/

Remember this is in a motor vehicle so there is plenty of spare power
and heat sinking available.

thanx, bye.

2. ### DJ DelorieGuest

If you're using a uC to turn the LEDs on and off, can you just use PWM
at 10% duty cycle? Hook the photocell to one of the uC's ADC inputs.

3. ### Guest

Already run out of I/Os (and code space)

bye.

4. ### D from BCGuest

Maybe try a phototransistor..
D from BC

5. ### MooseFETGuest

Buy a bigger micro.

6. ### JeffMGuest

The *bigger uC* idea sounds apt.

Alternately:

7. ### linnixGuest

I have 1 ADC input and 1 LED output (PWMed) in less than 2K (out of a
16K AVR). I can't find any reasonable uC with less than 8K. How
small can you get?

8. ### linnixGuest

I have 1 ADC input and 1 LED output (PWMed) in less than 2K (out of a
16K AVR). I can't find any reasonable uC with less than 8K. How
small can you get?

9. ### John BGuest

This would work better.

Set RA for minimum LED current and RA//RB for maximum LED current.

-o-----o-------o----o----
| | | |
.-. .-. .-. .-.
LDR | | | | RB | | | | RA
| | | | | | | |
'-' '-' '-' '-'
| | | |
| o--+ | |
| | | | |
| |/ | |< |
o---| +--| |
| |> |\ |
| | | |
.-. .-. +----o
| | | | |
| | | | V LED
'-' '-' -
| | |
--o-----o------------o----

(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

10. ### feeboGuest

forget resistors to do this stuff... use PWM to make them *appear* to
be dim... your LDR idea is not the way to go - you have lights on,use
this to signal to a PIC or similar to switch them

11. ### MarraGuest

Why not hook into the lights circuit?
Thats way you will know if it is dark without a sensor !
PWM an LED from a simple micro.

12. ### Boris MoharGuest

How about paralleling a CDs cell across R1? Set the R1 value for night time
luminosity.

Regards,

Boris Mohar

Got Knock? - see:
Viatrack Printed Circuit Designs (among other things) http://www.viatrack.ca

void _-void-_ in the obvious place

13. ### JasenGuest

here's another way.

// LED
input ---------->|----.
|
park lights ----[R1]--+
|
0V ----[R2]--'

that may look screwy on your screen, use a fixed pitch font.

I've never seen a LED damaged by being reverse biased at a low voltage
(as may be possible with this circuit) but if you're worried add a
diode in series with the LED.

Bye.
Jasen