Abstract:
A lamp adaptor with a photoelectric circuit that energizes a light bulb at dusk and keeps the bulb energized for a number of hours previously selected by suddenly blocking the light sensing element for a corresponding number of seconds. As an aid in counting the number of seconds that the sensor is blocked, the bulb is briefly energized each second.

Description:
BACKGROUND OF THE INVENTION 
     This invention relates to photoelectric controls with built-in timers used to energize lamps at a certain level of darkness for a predetermined amount of time. 
     Lamp adaptors with both a photoelectric control and a timer have been provided by others. Howe et al, U.S. Pat. No. 5,272,418, for example, describes a device that reacts to darkness by energizing a lamp and starting a fixed timer, which will de-energize the lamp when the time expires. typically in six hours. While the timer is counting down the photoelectric devices is disabled to prevent any flickering caused by reflected light. 
     Others products have been developed that operate similar to Howe&#39;s device except that the amount of operating time can be adjusted with some type of mechanical control which is a part of the product. The control is usually a variable resistor. 
     An object of the present invention is to provide a method of adjusting the operating time of such a product without the use of mechanical devices such as switches or variable resistors. 
     Another object is to energize and de-energize the lamp instantly, at full power, without disabling the photoelectric control. Light sensing could then continue while the lamp is energized in case the darkness that was reacted to was only temporary, as might occur during a mid-day storm. 
     SUMMARY OF THE INVENTION 
     Disclosed herein is a photoelectric light control that can be programmed by the user for any number of operating hours simply by suddenly blocking the ambient light at the photocell lens for some number of seconds. For each second the light is blocked the bulb of the lamp will be energized for one hour. The logic means, typically a microcontroller, constantly monitors the ambient light level reaching the photocell and is able to distinguish between a slowing changing light level and a rapidly changing light level. A slow rate of change might be associated with the daily setting of the sun, while a rapid rate of change would usually be the result of someone blocking the photocell with a finger. When the ambient light is thusly blocked, the microcontroller enters into a programming mode and starts a seconds counter. The number of seconds counted while the light is blocked will be converted into hours by applying a fixed ratio of 360 to 1 and then will be stored in the memory of the microcontroller as the operating timer for the normal mode, which will result in an hour of operating time, at the next observed dusk, for each second counted. 
     When the light is unblocked and the ambient light level is higher than the predetermined level of light at dusk, the microcontroller will exit the programming mode and start watching for a slowing changing light level that would indicate dusk. At dusk, the bulb of the lamp will be energized for the number of hours programmed earlier and then de-energized until the next dusk. 
     If the bulb turns off during the night hours, while the ambient light is very low, the microcontroller will not turn the bulb back on. This is because the microcontroller has been coded to not respond to darkness unless at least five minutes of daylight has been observed. Likewise, the programming mode will not be entered, even though the transition from light to dark was quite sudden, because the microprocessor has been coded to enter the programming mode only within a few seconds following power application to the lamp. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic diagram of a preferred embodiment of the present invention. 
    
    
     DESCRIPTION OF PREFERRED EMBODIMENTS 
     Referring to FIG. 1, the 120 Volt AC power applied between line L 1  and L 2  is converted to a lower DC voltage using D 1  as a half wave rectifier, resistor R 1  as a voltage dropping element, capacitor C 1  as a filter, and zenor diode D 2  as a voltage regulator, in an arrangement which is well known. The DC voltage, typically 5 volts, is coupled to the appropriate VDD and VSS power connections of microcontroller MC by lines L 1  and L 3 . 
     Photocell PC and capacitor C 2  together form a light sensing means that measures the ambient light reaching the photocell once each AC cycle and furnishes an input signal to MC 1 . This is accomplished by first holding output gate G 1  of MC at the same voltage level as line L 3  until time to make a light measurement. At that time, G 1  of MC is reconfigured as a high impedance input gate and a light level timer within MC is initialized. C 2  will begin to charge through PC while MC watches for G 1  to reach a voltage level that is considered to be a logic high. When this level is reached, G 1  will be configured again as a low-level output and the value of the light level timer will be recorded. This timer value will be the amount of time (measured in milliseconds) that was required for C 1  to charge from a low logic level to a high logic level. Since the time required to charge C 1  is directly related to the resistance of PC, and the resistance of PC is inversely related to the amount of light reaching PC, this recorded time is an indication of the ambient light level. 
     Resistor R 2  is coupled between L 2  and input gate G 2  of MC for the purpose of monitoring the rise and fall of the power line voltage. Resistor R 4  is used to assure the absence of voltage during zero crossing of the AC power cycle. Each time the voltage rises on G 2  a new loop through the coded instructions in MC is started. For the purpose of time keeping, each such loop constitutes one-sixty of a second. 
     Main terminals MT 1  and MT 2  of TRIAC TR are coupled between load B 1  (in this case a light bulb) and power line L 1 . The other side of the load is coupled directly to power line L 2 . The gate terminal G 4  of TR is coupled to output gate G 3  of MC through resistor R 3  such that a low logic level at G 3  will cause TR to conduct and the load to be energized. 
     In operation, the light level reaching PC is measured once each AC cycle by recording the time required to charge C 2  to a high logic level. Whenever the recorded time is greater than a prescribed signal value, indicating a light level corresponding to dusk, the output signal at G 3  of MC is changed from a high logic level to a low logic level. This causes TR to become conductive and the bulb to be energized. 
     At this time a calculation is performed by the coded instruction within MC to determine the most recent rate of change. In other words, the time to charge C 2  most recently is compared to the time required to charge C 2  one second earlier. 
     If this rate of change is less than a predetermined amount, the normal mode of operation is assumed and the bulb is energized for the number of hours set in the last programming mode. After the bulb has been energized for one second, the measured light level, which includes all reflected light, is recorded as a new reference light level that would have to be exceeded in order to de-energize the bulb before the set number of hours have elapsed. In some cases, the reference light level might have to be exceeded for some amount of time before the bulb is de-energized. 
     If the calculated rate of change is instead greater than a predetermined amount, MC directs the flow of coded instruction a first, programming mode. This means that the seconds timer is initialized and the bulb is energized briefly once each second to aid in counting seconds. When the time required to charge C 2  decreases to a level less than the aforedescribed reference time recorded one second after the programming began, the flashing of the bulb stops and the number of seconds recorded in the seconds timer is converted to hours of operation in a second, normal mode. 
     If the number of seconds in the programming mode exceeds a reasonable number of seconds, perhaps 12 to 15 seconds, the programming mode will be aborted and the most recently programmed number of seconds will continue to represent the hours of normal operations. 
     Also, if programming has not been successfully accomplished since the last time power was applied to the lamp, a default value, such as 6 hours, will be used in normal operation. 
     Clearly, many variations of the present invention may be accomplished by one skilled in the art of electronics. For example, in this preferred embodiment the value of C 1  may be as large as possible to provide a long memory retention if the power is temporarily disconnected. (MC can also be put into a sleep mode while the power is absent.) 
     MC is discussed herein as a microcontroller but the logic function could easily be accomplished with an Application Specific Intergrated Circuit (ASIC) design. And, of course, a standard analog to digital converter could be used as a part of the light sensing means. 
     Other improvements and variations may be accomplished by using the teachings of this disclosure without departing from the essence of the present invention.