Photoresistor as LED dimmer

Discussion in 'The Projects Forum' started by vincentkezel, Oct 11, 2011.

  1. vincentkezel

    Thread Starter New Member

    Aug 20, 2011
    7
    0
    Didn't see a post about this with the search tool, but found a similar but outdated thread that only touches the subject.

    I want to make an LED array get brighter when the photoresistor sees light, and turn off when there is no light. However, I'd like to have the LED's dim partially in partial light. So not an on/off circuit, but rather a linear dimming circuit for the LEDs that mimics the light seen by the photoresistor.

    The project goal: Make LED lighting behind my 55" flatscreen tv that is as bright the image on the screen. This lighting effect is supposed to reduce eye strain when watching movies in a completely dark room.

    There's a spot on the front corner of the TV stand that receives all the light of the tv screen that I think would be a great location for the photoresistor to get a representative sample of the current scene's brightness.

    A static setup would work, BUT in bright scenes the backlighting would be unseen, and in very dark scenes the backlighting would be too bright.

    I want to make something that uses about 20 white LEDs (3.3v 20mA) and on a completely black scene the LEDs are either full off or nearly off, and on a bright scene the LEDs are full on. And linear in-between of course.

    The tool here: http://led.linear1.org/led.wiz tells me that with 12V (i have a few spare wall warts) I can use pairs of LEDs in series with a 120ohm resistor, and 10 pairs of this grouping gives me the 20 LED array driven by 12V.

    Something tells me that supplying the array with 0V-12V is not equal to 0%-100% LED output, as least not in a linear fashion.... I figure LED's will drop off to darkness at about half their typical voltage. But figuring is figuring... I need to make this array and vary the voltage to see where the actual 0% LED output occurs.

    Before I do that, and while I gather supplies, I wanted to get help and input on this project. I think I have the physical and mechnicals thought out enough... I just can't figure out how to make the dimmer part that works with a photoresistor. I am mostly inexperienced with transistors, so I don't know if that is the answer. Can a transistor make a varied power output from a varied photoresistor input?!?? If not a transistor, please point me in the right direction.

    Until I get back with my measurements let's say I wanted complete darkness to supply 6V and complete brightness supply 12V. Any ideas??

    Thanks in advance for your help. I plan on posting images or videos of the linear backlighting in action if it works out well.
     
  2. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    Two 3.3V LEDs in series with 120Ω on 12V gives (12V-6.6V)/120Ω = 38mA; too much for 20mA devices. Use 270Ω or a bit more.

    Controlling LEDs to do this is not that hard in principle. Modern engineers would probably insist on PWM control, probably mediated by a micro-controller. This is certainly the way of getting the most consistent colour output from "white" LEDs, which can vary if operated at other than a specified current. Personally I would go for a transistor current driver, with an emitter (source if MOSFET) series resistor to monitor the drive current, and an op-amp to servo the emitter voltage according to the current from the LDR.

    Naturally, you need an end-stop to avoid the current exceeding a safe value, and anyway you need to get the LEDs to share well, so keep them in series pairs with resistors so turning the transistor on hard won't hurt. The transistor itself would need to be rated to deal at least 200mA and would get hottest when not quite fully on. Wall-wart outputs can rise with light loads so I'd be cautious and say 6V at 200mA: 1.2W or even allow a bit more.

    The sensing resistor in the emitter needs to give you say 0.5V all out, so maybe 2.5Ω for 200mA. You would need to find out what resistor to catch the current from the LDR into to get 0.5V at maximum brightness. NB that LDR itself has to be OK for your supply volts in the brightest possible light. An extra resistor in the top feed to the LDR will help avoid melt-down e.g. if the sun shines on it.

    Finally, if you find op-amps a bit daunting, you might get away with just a Darlington transistor as the pass element, with the base driven directly from the LDR load, provided the LDR is a reasonably low resistance type. The LDR load would need to be jacked up with a diode or two.
     
    Last edited: Oct 11, 2011
    vincentkezel likes this.
  3. iONic

    AAC Fanatic!

    Nov 16, 2007
    1,420
    68
    It would be neat to have the photo resistor be the current control all-in-one, but this may be the most difficult way to approach this.

    I like the project theory and will be following the progress...!
     
  4. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    Let me know where to buy one of those! Say a 1.5W / 200mA rating, resistance range say 20Ω to 500Ω. Failing such a Brobdingnagian device, a transistor is needed at least, I think.

    Here is a circuit I've tried on my toy simulator. Naturally, I can offer absolutely no guarantees that it would work in the real world. You would not need to use four little output transistors as I have for want of something suitable, if you could get a bigger device.

    I have tried to set this up so that with 1V LDR load volts you get 20mA in each LED. I have also tried to catch it with some diodes to stop it getting very much brighter. It's not precise though, and there is some risk of "turning it up to 11" with the values shown. You will see that I have LED series resistors close to the OPs original value, which I complained of as being too low. That's not a mistake, using the LEDs I'm simulating with and with a driver losing fully a volt.

    The first step is to characterise the LDR using a resistance meter, then choose a value for RLOAD so that the load voltage will just approach 1V with a bright picture. RLIMIT may be all right at 10kΩ unless the LDR resistance is quite small, in which case it and R1 may need revising. RGAIN is there to turn the minimum level down in case the lamp fails to get dim enough in dim light: less resistance is dimmer, but don't reduce it too far, stick with tens to hundreds of kΩ.

    The results plot is a DC sweep on supply volts, with the LDR resistance as a parameter. I assumed 200kΩ max, 25kΩ min, but of course I have no idea what resistance the OP may get.

    Edit: I see that Q1 could be rather stressed. Increasing R5 to 2.2k will do no harm, and R20 would be better 1k if we could trust the output transistor to have 20X gain. Note also that the poor little 2222s I have used for the output would get terribly hot on 18V supply. I do know better, but my other choice was the venerable 2N3055.
     
    Last edited: Oct 11, 2011
  5. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    OK then, using a proper power transistor.
     
  6. russpatterson

    Member

    Feb 1, 2010
    351
    16
    If it was me I'd go with the microcontroller and PWM the LED's. I'd use a phototransistor http://www.allelectronics.com/make-a-store/item/PTR-1/PHOTO-TRANSISTOR/1.html instead of the photo resistor. Once you get that running it would be easy to add an adjustment knob to set the amount of back light based on the amount of ambient light. More work up front but much easier to debug and extend later on.[​IMG]
     
  7. vincentkezel

    Thread Starter New Member

    Aug 20, 2011
    7
    0
    Wow, thanks for the thorough and quick responses!!

    Adjuster, I jumped right in and frankly the last paragraph of your first post sounds like the easiest and quickest way to go about it. I have a working test with one resistor+LED as the load, and an LDR and potentiometer making what I think is a voltage divider for the base of a Darlington.

    And first try I see something very promising!
    Observe: http://www.youtube.com/watch?v=2C2wUGX_Fzo

    It seems very touchy, or having a narrow zone between on and off. But this may be just right when it comes to a better test in front of the TV. I think using a different voltage supply will have an effect on that, or even running more LEDs seems like it would act different. Now I'm testing with a wall wart labeled as 12VDC 200mA that is actually putting out about 16V with no load. I realize some warts will drop to put out their labeled voltage when their amperage rating is approached. Maybe the range will be wider with a 7V supply.

    I only really watch movies in the evening, so I'll wait until then to get the full effect of a test without sunlight biasing the LDR or my eyes.

    In the mean time, I'll start making my array of 20 LEDs.

    I plan on putting in a "bypass" resistor to always feed a small current to the LEDs to have the LEDs always just barely lit in complete darkness. That way I don't have to worry too much about the darkness end that the potentiometer sets.
     
  8. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I wonder if this will work well. Not because of the control of the LEDs, but with a huge TV screen, you'll need a very good diffuser to get an even lighting effect. Otherwise, you'll get a patchwork of light and dim areas over the screen.
     
  9. vincentkezel

    Thread Starter New Member

    Aug 20, 2011
    7
    0
    I was wondering about exactly that, John.

    I wouldn't want just the bottom corner of the movie for example control the whole backlight. I think I can hack up a piece of glass or plastic that more or less focuses more area of the light coming from the TV on to a smaller space, and diffuse it on to the LDR to get an average. Maybe I can find something magic that does bothy at once. Another thing to try in tonight's test.
     
  10. iONic

    AAC Fanatic!

    Nov 16, 2007
    1,420
    68
    Does the LDR respond in a linear fashion? If not looking for a light sensitive device to replace it might be of some help. There is a small 6 pin IC I had bought that produces from 0V - 3V in a linear fashion to the light it senses, although you would have to control the LED brightness with the varying voltage. If I locate the IC I will get you the part number.
     
  11. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    I very much doubt that an LDR will be all that linear, but this is probably not a very demanding application in that respect (it depends how exactly we need the background light intensity to match that of the screen).

    A photo-transistor would be better, but the gold standard would probably be a photo-diode. These can be pretty linear* operated with a fairly big reverse bias, although the dark current may be noticeable if we are working to very low illumination levels. The output from a photo-diode may be rather low unless a largish area device is available.

    *In the sense of following a square-law (optical power to current) characteristic quite strictly.

    A photo-diode working with very strictly fixed bias, perhaps in a trans-impedance configuration may be better if really superb linearity is the aim. Some devices (but not all) can be used at exactly zero bias to minimise dark current. These would be valid techniques if the OP was trying to make a fibre-optic power meter, or a photographic exposure meter, but perhaps overkill in this case

    @ Ionic: A packaged linearised detector is a convenient way to go if a suitable device is available. I would be interested to see the datasheet.
     
    Last edited: Oct 12, 2011
  12. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    If you cover the screen with a thick enough glass or plastic sheet you might be able to sample the diffused light from the cross-section at the edges of the sheet.
    You could also make multiple sample points to "extend" the different light levels of the same image outwards towards the back wall.
     
  13. vincentkezel

    Thread Starter New Member

    Aug 20, 2011
    7
    0
    The LDR test circuit responds in a somewhat linear fashion. I think its good enough for this application. So far, I think guys who put a simple dim lamp behind their big TV will be blown away by my project.

    If the LDR absolutely doesn't work well in the full-scale TV test, for example makes only a full-on or full-off effect, then I'll move on to something better/different. The IC light sensor sounds neat. After a few minutes of searching I found this: http://www.rohm.com/products/lsi/sensor/ambient_light_sensor/selection/
     
  14. #12

    Expert

    Nov 30, 2010
    16,283
    6,795
    Your idea can be done, and done well. It only depends on how demanding you are. Don't get too picky and it can be done fairly simply.

    ps, don't even consider a cadmium sulphide photo cell. Way too slow.
     
  15. unox

    New Member

    Jul 16, 2012
    2
    0
    Hi Adjuster,

    can i have the component list for your circuit?
    Thanks in advance!
     
Loading...