Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

light sensor with timing

Status
Not open for further replies.

know_none

New Member
i have this project.. we're to create a circuit and interface it to a PC (we use db25) a light (bulb) must be on during the day and off during the night. night and day are determined by darkness/brightness so i'll be using ldr for this. problem is, we have to dim the lights at midnight. i don't know how to dim the light bulb-don't know what components to use, what circuit... my program (in NASM) will check the time to see if it is midnight already, but how do i dim the lights? help PLEASE!
 
I dont know if you are speaking of AC (line powered) or DC lights such as you might find in a flashlight. In any case, for the AC lights, you would probably want to use a triac and have your software trigger the bulb at different parts of the sinusoid. The triac when triggered stays on until the zero crossing of the AC waveform. Then in the next 1/2 cycle you trigger it in the right place again. You can do this very easily with a micro or a comparator circuit to "square up" the sinusoid. Note that you want to drop the voltage down probably with a transformer for isolation and then maybe use optical coupling to get the pulse into your PCs parallel port (which I what I assumed by db25).

If the light is a lower voltage DC type, you can use pulse widith modulation. You would set up a timer that triggers perhaps every 20ms or so, then you can turn the bulb on and setup a turn off time, maybe 5ms from now. That would mean the bulb is on 5ms and off 15ms, you do this rapidly enough and the low pass filter effect of the bulb will not be noticable. You would need to use the pin to drive some power handling parts for the bulb.
 
I don't think PWM will work well on a lightbulb... There just to slow in reaction time...

I would make a D/A converter, driven by the printer port, that allowed me to change the voltage applied to the bulb, and dim it that way...
 
dc lights

:shock: ok,m sorry, we're using dc lights, not a 220 V AC lght bulb but an ordnary LED... we tried using a summing amplifier (741 op-amp) wth 2 inputs (1-1 for brght,0-0 for off and 1-0 for dim) but the op-amp didn't seem to sum up the inputs in that the output voltage for 1-0 and 1-1 nputs seemed the same. we also tried connecting a potentiometer in series with the led becAuse the offset voltage of the op-amp caused an output voltage greater that 1.5 volts (the led's min voltage requirement)

while this worked, out problem really is that there was no dstinction between 1-1 and 1-0 input :(

if you have any suggestions, even other than the summing amplifier, please reply.. thanksn :wink:
 
Hello,

Your summing junction should work. If you post your circuit we could help you debug it.

PWM will work to dim lightbulbs and LED's. For LED's the frequency should be above 60Hz so you don't see flicker. The problem is that Windows is terrible at generating constant frequencies because your program can be interrupted by windows at any time. You might be able to make it work well enough though.

Brent
 
Please post your circuit and let us take a look. I agree the summer should work correctly. In addition, windows is not great at generating consistent frequency/pulse width, but a regular bulb acts like a low pass filter, so if its a little off it seems to work ok. Presumably over several cycles, the rms voltage probably does not vary much. LEDs are a different story, some that I have used have bandwidth in the linear region of close to 100MHz.
 
I agree that the op amp summer should work, but it's overkill. Think two common-emitter transistors controlled by your two bits, and whose collectors go to resistors which are summed into the LED.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top