Home     Contact     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
   
 Home      Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   

4 July 2009
Author: Giorgos Lazaridis
Ambient Light Level Equalizer


The circuit onoperation (LEDs cannot be on because the flash turns them off instantly). The left potentiometer will adjust the highest level of operation, and the right will adjust the highest LED brightness.

Ambient light level equalizer is a way to keep the light luminosity at a desired steady level. What this equalizer does, is reading the ambient light level, and according to it, it will increase or decrease the luminosity of light sources such as LEDs. The level is controlled with PWM pulses. There are several applications for such a circuit. It could for example control the light level in a greenhouse, keep your keyboard always steady illuminated, increase or decrease the intense of 7-segments or LCD baklits to have a better reading when dark or light and much more.



look at the following video demonstrating this circuit in operation:




The circuit

We are going to use the voltage controlled PWM generator described in previous article and all details and theory of operation can be found in this relative page. We will then make a circuit that will create a DC level signal according to the light luminosity taken from an LDR. this DC signal will be driven to the comparator. According to the light falling on the LDR, there will be PWM pulses that will change it's duty cycle. A mosfet will drive the LEDs and dim them accordingly.

An LDR is a variable resistor that changes it's resistance according to light level. The more the light on the surface of the LDR, the less it's resistance. As part of a voltage divider, this will result into voltage changes. We shall polarize the base of an NPN transistor with such a voltage divider, and from it, we will get the desired signal. This circuit would look like the following:





The above circuit will generate a voltage output from zero to Vcc (5V) according to the LDR's resistance. The 100K potentiometer will set the lowest point where the circuit will start operating. When this circuit is interfaced to the voltage controlled PWM generator, the 100 K resistor will actually control the highest light level that the LEDs will be still turned on. While light falls below this level, the LEDs will gradually become lighter and lighter.

We could interface the above circuits directly to each other with no problem at all. But i had a better idea. Suppose that at maximum darkness (minimum light), someone did not want to have the LEDs at full brightness. I added another potentiometer between those two, and this would control the maximum brightness of the LEDs. This potentiometer is a 5K performing a voltage divider between the two circuit. Therefore the driven voltage from the transistor to the comparator will depend on this potentiometer.

Putting it all together, this is how the final circuit looks like:






Adjusting the circuit

It's time for some adjustments. First, the 5K potentiometer (if you have added) should be somewhere in the middle. It does not really matter if it is not exactly there, just avoid the edges. Then, turn your lights on. Get the highest ambient light that you wish your LEDs to be still turned on, dimming like dead candle. At that point, turn the 100K potentiometer so that the LEDs are right at the off-edge. Afterwards, turn your lights off. The 5K potentiometer will control the full brightness of those LEDs. Do this and you are ready to go!





Relative pages
  • Basic transistor circuits
  • Learn how dimmers work
  • PWM signal theory
  • The voltage divider theory
  • How to make a light / dark activated switch - 3 different circuits under the microscope
  • Create PWM pulses with variable duty cycle controlled by a DC voltage input
  • Triangle wave generator
  • Op-Amp IC Pinouts





  • Comments

      Name

      Email (shall not be published)

      Website

    Notify me of new posts via email


    Write your comments below:
    BEFORE you post a comment:You are welcome to comment for corrections and suggestions on this page. But if you have questions please use the forum instead to post it. Thank you.


          

  • At 5 December 2012, 21:18:12 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Paul You will need some sort of a driver for this setup. The gate voltage must be greater than the voltage you try to control.
      (google high-side mosfet switch driver)


  • At 5 December 2012, 21:16:45 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Paul Try by inverting the LDR with the 100K potentiometer


  • At 5 December 2012, 17:09:30 user Paul wrote:   [reply @ Paul]
    • One other Q - does the circuit need any changes if the transistor is controlling the common anode side of the LED circuit, rather than the common cathode side?

      I need to use this arrangement, since the LEDs will be connected to an LM3914 bar-graph driver IC. Because the LED cathode leads are connected to the chip directly, and because I will be chaining two chips together, I can't simply use an LDR in the current-control circuit for the chip itself; thus my interest in your circuit. thanks for all the great info on this site.


  • At 4 December 2012, 23:32:42 user Paul wrote:   [reply @ Paul]
    • I'm looking for a way to invert the behaviour - I want the LEDs to get brighter in increasing ambient light. The goal is to create an automotive tachometer that's bright enough to read in daylight, but doesn't blind the driver at night.


  • At 14 October 2012, 17:53:15 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @karim ahmad nope, you will have to change the resistors as well if you do.


  • At 14 October 2012, 17:23:47 user karim ahmad wrote:   [reply @ karim ahmad]
    • @Giorgos Lazaridis can i replace bc547 by 2n2222?


  • At 10 June 2012, 13:28:05 user Mike wrote:   [reply @ Mike]
    • It would be nice to get this working in conjunction with the LED Array PWM Dimmer 555 and pulse it.


  • At 30 October 2009, 5:18:06 user Markus wrote:   [reply @ Markus]
    • Thank you friend!


  • At 15 August 2009, 16:43:15 user Kammenos wrote:   [reply @ Kammenos]
    • Well Stefan, yes you can have 12V, but you will need to change the resistors that polarizes the transistors. I would suggest better use 12V as mains, and then use a 5.1V zenner diode and get your 5Volts. Or an 7805.


  • At 12 August 2009, 10:18:00 user Stefan wrote:   [reply @ Stefan]
    • Very good work. And very good presentation.
      Can i have for all circuitry only one power supply, like 12V? You have also 5V in some cases. Can i power it with only 12 V?
      Thank you.



    delicious
    digg
    reddit this Reddit this
    Faves



     HOT in heaven!


    NEW in heaven!



    New Theory: AC electric motor working principle



     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS   

    Site design: Giorgos Lazaridis
    © Copyright 2008
    Please read the Terms of services and the Privacy policy