Patent attributes
System, methods, and apparatus, including devices and software, for providing self-adjusting light sources. In one aspect, a lighting unit includes one or more LEDs and an ambient light sensor. The light sensor measures ambient light in synchronization with intermittent off periods of light generated by the LEDs. For example, the LEDs in the lighting unit can be driven by a pulse width modulated signal that turns on and off the LEDs in an alternating manner, and the ambient light can be measured when the LEDs are turned off. In some implementations, a compact lighting unit, such as a light bulb, is provided that can be easily attached to standard light fixtures and can efficiently control its own brightness based on ambient light conditions.