Connect with us

controlling a dimmer with a photocell/photoresistor? total newbie here...

Discussion in 'Electronic Basics' started by mike, Sep 1, 2004.

Scroll to continue with content
  1. mike

    mike Guest

    Ak! Please don't hate me for what might be a simple question, but I
    have an interesting project in mind that I need some basic guidance

    I live in a basement... meaning, no windows and no natural light.
    Which means I sleep in til 2 or 3 most days-- great on the weekends,
    but the bosses aren't too happy with my "natural clock". I want to
    create artificial lighting inside as close as possible to the lighting

    I was figuring to do this I'd connect full spectrum flourecent bulbs
    to a dimmable ballast, and control the dimmer on the ballast with a
    circuit consisting of a photocell or photresistor placed outside,
    hence the dimmer/circuit would control the light levels inside to
    match those the cell sees outside.

    I've already got the dimmable ballasts. The dimmer operates on a 0 to
    12v signal in.

    My question is, well... 2 questions:
    (1) what's the difference between a photocell, phototransistor, and a
    (2) does anyone have recommendations on what the circuit would look
    like? Will I need an AC to DC converter? And I imagine a trimmer in
    line somewhere to adjust levels? I'm hoping I wont need to get a
    microcontroller into the mix.

    Again, terribly sorry I'm so new to this, but I'm really excited about
    this project, and I think it can be done fairly easy with some
    guidance from the old pro's lurking around here.

    Thanks a ton,
  2. Rich Grise

    Rich Grise Guest

    You'd have to look up photocell - I think that one's kind of vague. A
    phototransistor responds to light as if it were a signal to amplify,
    and a photoresistor, or LDR, is like a resistor that changes value
    depending on the light input.

    The simplest thing of all would be just an LDR in a voltage divider,
    but it probably wouldn't track well.

    Next would be the LDR or PHT or even a photodiode and some circuitry
    to make it track the dawn.

    A third option would just be a ramp generator, that gives a very slow
    ramp, say 1-2 hours, from 0 to 12 v. That's more or less the effect
    you want anyway, right? Just set it for local dawn, give or take.

    I know they already have these things off the shelf, that will slowly
    dim the lights - single guys buy them for seduction purposes. ;-)

    Good Luck!
  3. Here is a somewhat wacky idea, and I have no idea whether it'll work.

    If you can get two CdS light dependent resistors (LDR) that are about
    equal, you might be able to set things up so that at a particular spot
    in the room, the inside light intensity, as measured by the LDR, is
    equal to the outside light intensity.

    If you have a 12V source, you can create a voltage divider where the
    current flows out to the outside LDR, through it (the amount depending
    on the ambient lighting) and back; into a resistor, then to ground.
    The voltage across the resistor will then be an indication of how
    bright it is outside.

    Unfortunately, that won't give you any way to track the light outside,
    unless you use another identical LDR which is INSIDE, at a point in
    the room (maybe near your bed? :) that you want to track the outside
    lighting. The wire again goes from 12V to the LDR, back to an
    identical resistor, and to ground.

    If the voltage across the second resistor is identical with the
    voltage across the first, then your light is the same outside and
    inside, at least at the point where the LDRs are.

    Fortunately, you can arrange this by using a device called an "opamp",
    whose main purpose is to compare voltages, and try to set the output
    so that the input voltages are equal. Thus, the output of the opamp
    controls that dimmable ballast somehow (the details escape me, because
    I don't know what the input is expecting. You need to post the device
    specifications for more detailed advice.) When the outside LDR
    changes, the opamp resets the ballast so that the inside ambient light
    creates the same conditions at the inside LDR. Since in this
    configuration, where the LDR is first in the chain of resistances from
    12V to 0V, the voltage across the resistance will increase as it gets
    brighter outside, you want to hook up the + input of the opamp to the
    outside resistor, and the - input of the opamp to the inside resistor.
    The opamp is powered from the same 12V supply. You then hook up the
    output of the opamp to the ballast control, assuming increasing
    voltage makes it brighter.

    Here is a web page for info for CdS LDRs:

    You should also get a coupld of medium sized (maybe 1uF) capacitors,
    and put them in parallel across those resistors that are connected to
    ground. That will keep stray electromagnetic radiation from causing
    your lights to flash (well, maybe it will).

    Another issue is that equal LDRs are difficult to get (those packs at
    RadioShack don't have good matching ones, anyway) Maybe if you order
    them from DigiKey or Mouser you can get ones that will be similar; I
    don't really know.

    The other issue, which I'm sure others will comment on, is the
    possibility of oscillations with this circuit. If the response of the
    ballast is slow, it might allow oscillations to happen, where the
    lights flicker constantly, or possibly cause problems of other kinds.
    There are ways to get around this, by using whats called a PID
    controller, but that may be overkill, I don't know. They are fairly
    expensive, and difficult to tune (what happens is that the PID
    controller, in essence, predicts whats going to happen in a bit as the
    voltages change, and tries to compensate for that. You have to tune
    the prediction using pots.)

    Anyway, it sounds like a fun Saturday afternoon project. You can get
    LDRs, resistors, and opamps from RadioShack or whereever finer cheapo
    electronics are sold. A 12V wall wart and some wire are also required.

    NOTE: If you can't get CDS LDRs that are equal, you may be able to
    compensate by using a variable resistor (potentiometer) instead of a
    resistor for one of the resistors. Get one that is twice the value of
    the resistor, and hook its wiper (the center pin) to ground. Then,
    adjust the wiper so that the light is about right using the screw
    control. You can get these at radio shack as well.

    View with courier font:

    | ___
    o------ OUTSIDE LDR --o--------|___|--,
    | | ___ |
    '------ INSIDE LDR --|---o----|___|--o
    | | A |
    | | | |
    | | '----o
    /| | | |
    to /+|--' | |
    variable -< | | |
    ballast \-|------' |
    ctl \| |
    opamp (LM324?)

    created by Andy´s ASCII-Circuit v1.24.140803 Beta

    For unused inputs on the LM324, tie + to 12V, - to GND, and leave
    outputs unconnected.

    Measure the LDR using a multimeter at a medium light intensity, and
    use a similarly valued resistor, or a pot that is twice the measured

    A goes to the + input on the opamp, B goes to the - input. The output
    of the opamp goes to the variable ballast input. The pinouts are on
    the back of the package you get from RS.

    more info on LDRs

    Bob Monsen

    PS: The other option would be an alarm clock, or a light that turns on
    on a timer...
  4. Active8

    Active8 Guest

    On Thu, 02 Sep 2004 03:53:34 GMT, Robert C Monsen wrote:

    whew! :) Uh, Radio Sh*t, IMO is *not* a place to get cheap parts,
    but it is cheapo. Can't let the OP get the wrong idea.

    It does sound like a cute project, but do they still make those
    alarm clock thingies? ;)
    While he's at it, he can google12V VVVVVVVVVVVVVVVVVVVVVVVV Wheatstone Bridge
    o------ OUTSIDE LDR --o--------|___|--, <
    | | ___ | <
    '------ INSIDE LDR --|---o----|___|--o <
    So they *do* still make them :)
    What, to see how many daylight hours he's wasted sleeping?

    What about a timer that turns on a light? I have a few. One turns on
    the soldering station - if I can predict when I need it. One turns
    off the work light - in case I leave the bench and crash in front of
    the TV. The other is for future use. They work good for xmas lights,
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day