A very simple project, showing that light of different colors gets refracted by different angles when passing through a prism. To make this more obvious, I used a Neopixel strip of eight LEDs and set some of the LEDs to a different color than the other ones.
While all LEDs are arranged in a stright line, when looking through the prism, the ones of different color look a bit displaced. The size of the prism should be about 10x3x3 cm and placed about 6 cm above the LED strip. Rotate it a little until you get the best results.
The direction and amount of the displacement depends on the colors.
Don't be surprised about the short code. It cycles the color of the "background" LEDs and the color of the "different ones".
const byte LED = 6;
const byte NUM = 8;
const long RGB[] = { 0xFF, 0xFF00, 0xFF0000 };
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM, LED, NEO_GRB + NEO_KHZ800);
void setup() {
Serial.begin(9600);
Serial.println(__FILE__);
strip.begin();
}
void loop() {
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 8; k++)
strip.setPixelColor(k, RGB[i]);
int ij = (i + j) % 3;
strip.setPixelColor(2, RGB[ij]);
strip.setPixelColor(5, RGB[ij]);
strip.show();
delay(1000);
}
}

_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)


_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)
Comments