A photocell is a light-sensitive semiconducting diode that works something like a switch: When enough light falls on it, it allows current to flow, activating whatever circuit it controls—in this case, a night-light.
Lights in Motion
As you can see, it’s possible to arrange two night-lights so that they control one another. The light from one can cause the other to turn off, and vice versa.
Reflecting the Light
Using the mirror, you can see how a single night-light can affect its own behavior. Light reflected to the photocell causes the incandescent bulb to turn off. Then, when the light is no longer reflected, the bulb turns back on. There is a small but noticeable time delay in the cooling and heating of the filament in the bulb, so you see this rapid on-off-on-off sequence as flickering. An LED doesn't show the flickering because an LED has almost no delay time and is therefore perceived as always on.
This on-off cycle is an example of a feedback loop, which occurs whenever the output of a device is fed back into the device as input. If the feedback increases the output of the device, it’s called positive feedback; if it decreases the output, it’s called negative feedback.
Your flickering night-light is an example of negative feedback: When the output is positive (on) it causes a negative result (the light going off). Some other devices that use negative feedback are the cruise control on a car, the thermostat on a heating system, and a weather vane. A well-known example of positive feedback is the loud screech heard when sound from the speakers in an auditorium gets fed back into the microphone.
When you slide the card past the unlit blub, no change occurs. When the card goes past the lit bulb, though, its light is blocked and no longer falls on the photocell opposite it. This turns on the bulb that was originally unlit, and its light falls on the photocell across from it, turning off the bulb that was originally lit.
This on-off switching effect of sliding a card between the two lights is another a form of feedback, known to computer scientists as a flip-flop, or bistable gate. Each time you slide the card between the bulbs, the bulb that was unlit turns on and the lit bulb turns off. In computers, a similar switching process is at work behind the binary logic that underlies all computer operations. Computers use flip-flops to store and process information as a series of bits—ones and zeros—equivalent to on and off.
When you initially slide the card past the lit bulb, its light is blocked and the unlit bulb goes on, which causes the first bulb to go off. As you continue to slide the card past the second bulb, its light is blocked, causing the first bulb to go on and the second to go off. The system is then back to its original state.