How a digital sensor works, Pt 1
Light sensitive electronics
The most fundamental part of a digital sensor in a camera is a photo-electric element that is sensitive to light and produce an electronic signal depending on the intensity (number of photons) of light that falls on it. It is sometimes helpful to think of the photoelectric element as a well that fills up with photons of light, and measures the intensity of the light by the depth to which it fills.
The picture represents a 12-bit photoelectic device which can measure light intensity at 4096 different levels, from 0 up.
A sensor in a digital camera cosists of a vast array of these elements so that they can detect light from a scene that is thrown onto them by the camera's lens. The elements are very small. In a 12MB, full frame digital sensor, the array of elements is nearly 4000 across by 3000 down, fitting onto a space that is approximately 36mm x 24mm.
Sensor elements are 'linear' devices. That means the electic signal they deliver is directly proportional to the intensity of the light they detect. If you double the light intensity, the signal doubles. If you increase the light intensity 10 fold, the signal will increase 10 fold. Note however, that if you increase the light intensity too much, the 'well is not deep enough' and extra light makes no difference - that factor is important when you are trying to control highlights when making a photograph.
Photo-electric elements are not sensitive to the colour of the light that hits them — you would get the same signal from an element whether it was hit by red light, blue light, brown light, or purple light of the same intensity.
How to measure colour?
To discover the colour of the light incident on the sensor sensor manufacturers use the fact that any colour can be filtered into a red component, a blue component, and a green component, and that the relative amounts of those components can tell us what the original colour was.
The individual Photo-electric elements are covered by filters that allow through only the red, green, and blue components of the light that hits them. They are arranged in rows of ...red-green-red-green-red-green... and ...green-blue-green-blue-green-blue-green... (There are twice as many green filters as red and blue because the human eye is more sensitive to green tones than other colours. Without the extra green colours would not look natural to us.)