During the past days I was busy with the preparation of a scientific exhibition that opened on September 25 for the European Research Night. The year 2015 is the International Year of the Light, as declared by the UN, hence the theme of the exhibition is the Light and its scientific applications.
We were working on a Newton's disc, when I came to the idea that one can easily build an electronic version of such a device. A Newton's disc is a disc divided in segments, each of which has a different color. When the disc spins rapidly, the coloured segments fade and the disc appears to be white. The Newton's disc is used to demonstrate that white light is in fact the superposition of light beams of different colours.
The reason for which the disc appears to be white is that images collected by our eyes persists on the retina for a while (1/20 of a second). When the disc spins and you look at a given sector, the coloured light coming from that sector enters you eye and 'remains' on its surface for such short time. However, if the disc spins rapidly enough, the light coming from the same place rapidly changes color and light of different colours hits the same portion of the retina in less than 1/20 of a second. The eye then receives a series of different signals in a short time window and our brain interprets all these signals as a single image providing the illusion that the disc is white.
We can do the same using an RGB LED.
A RGB LED is a LED capable of emitting three colours with different intensities: red, green and blue. Weighting the light of each color allows us to produce light of mostly any color. Instead of mixing three colours at the same time, one can switch on and off each color at the time. If the switching time is low enough you can easily distinguish the sequence: red, green, blue, red, green, blue, etc.. However, if each color is on for a very short time, the eye detect each color in less than its persistence time and interprets the sequence of the three colours as just their sum: white.
RGB LED's exist in two flavours: common cathode and common anode. Both have four pins and contain, in fact, three coloured LED's. In the common cathode pins, the longest one is the cathode to be connected to the ground. Putting a voltage on the other three pins, a current flows through the appropriate LED and the device emits light of the corresponding color. In common anode LED's, the longest pin is the anode to be connected to the voltage source. Connecting the other pins to ground let the current flow.
In this example, I used a common cathode LED with an Arduino board: the longest pin was connected to the Arduino GND pin, while the other to pins 9, 10 and 11 (the PWM ones) by means of a resistor, to limit the current flowing.
Operating such a device is very simple. Just define the used pin as output pins and put them to zero in the setup:
void setup() { // set pins as output pins pinMode( 9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); // switch off all LED's digitalWrite( 9, LOW); digitalWrite(10, LOW); digitalWrite(11, LOW); }
In the loop, you can just put each pin to an appropriate value in sequence. For example:
void loop() { int i = 9; while (i < 12) { // switch on a given color analogWrite(i, 125); // wait d milliseconds delay(500); // switch off that color analogWrite(i, 0); // go to next color i++; } }
With this code you switch on a color for 0.5 s, then switch it off and repeat the sequence on each color. Reducing the delay to 50 milliseconds you can no more distinguish the single colours. The switching between them is so fast that what you can see is just white light.
The movie above shows my Arduino Newton's disc looping such that the time for which each color lasts is progressively reduced until the eye can no more see the single colours switching. In the end, the LED appears as white.
RGB LED's, in fact, is yet another applications of the Newton's theory of light that can be either interpreted in the wave theory. What happens in an RGB LED is that lights of three colours and different intensities sum up and the result is light whose color is the "sum" of the three beams. Modern TV's and computer monitors, as well as phone screens and similar devices works the same way: the screen is divided in pixels, each of which is made of three tiny light sources of three colours (red, green and blue). Switching on and off with the appropriate intensity each of the sub-pixels results in the image on the screen.
Top Comments