Introduction: Super Easy Crystal Mood Light

About: Hi! I'm know among people IRL as the sewing guy who makes everything out of duct tape, and I'm a maker, designer, baker and Instructables fan. (he/him please thanks!)

Hello Makers! This is a super duper easy arduino project that will function as a learning tool as well as a wicked awesome mood light. It's only a few pieces, so you can whip it together in the time it takes to print the base. Makes a great lesson about RGB too!

Some background to this project: My little brother (known henceforth as Unicorn) and I get the awesome Kiwico subscription boxes (not sponsored, just adore) and in this month's Tinker crate Unicorn got a cool RGB mood light. He built it but quickly figured out each color only had an on/off so it had limited colors. In one of my classes for school, we have to do a STEM project every Wednesday. Last wednesday, Unicorn and I remixed that project together so he could code more color possibilities.

If you're using it as a lesson, I reccomend printing the bases for students ahead of time. It took about 4 hours to print mine.

Please vote for this in the remix contest! This is my first Instructable and Unicorn and I work really hard on this. (I now can appreciate how much typing is involved with writing an instructable!)

Supplies

  • RGB LED (a small one works)
  • Arduino Uno (and battery cable, and usb cable to program, should come in a basic kit)
  • Basic jumper wires
  • small breadboard
  • 220 ohm resistor
  • Kiwico crystal kit (or other LED diffuser)

https://www.kiwico.com/us/store/dp/color-mixing-le...

  • Access to 3D printer (or ya know, modeling clay like model magic or something)/vacuum former maybe? wood if you have the tools might be cool

Step 1: Wire It Up!

Connect the cathode of the RGB led which is the longer pin of RGB led to the GND of Arduino and the other three pins to the pin 11, 10, 9 of Arduino through the 220 ohm resistors.

Step 2: Print Base and Insert Diffuser (REMIX TIME!)

3D print (or model) base

The crystal is remix #1 because it is a remix of the kiwico light (which only does a few colors)

The base is remix #2 it is a remix of a low poly planter on thingiverse: https://www.thingiverse.com/thing:1747609

I flipped it and cut some holes for the diffuser and power in tinkercad. The file I printed is imbedded here.

Step 3: Code Time (and Remix #3)

The code is from https://create.arduino.cc/projecthub/muhammad-aqib...

Simply put, open the Arduino application and follow the sub-steps below.

1: enter the setup code.

int red_light_pin= 11;int green_light_pin = 10;int blue_light_pin = 9;void setup() { pinMode(red_light_pin, OUTPUT); pinMode(green_light_pin, OUTPUT); pinMode(blue_light_pin, OUTPUT);}

2: The main code.

void loop() {

//YOUR COLORS GO HERE

}void RGB_color(int red_light_value, int green_light_value, int blue_light_value) { analogWrite(red_light_pin, red_light_value); analogWrite(green_light_pin, green_light_value); analogWrite(blue_light_pin, blue_light_value);}

3: How the colors work. (bold=my comment, don't add it to arduino)

Each color you want it to flash/pulse has this sequence added under void loop(){

RGB_color(255, 0, 0 rgb value for the color you want); // Red Comment the color to make it readable

delay(1000); How long the color is there, I'm pretty sure this is 1 second

4: Example code:

int red_light_pin= 11;int green_light_pin = 10;int blue_light_pin = 9;void setup() { pinMode(red_light_pin, OUTPUT); pinMode(green_light_pin, OUTPUT); pinMode(blue_light_pin, OUTPUT);}void loop() { RGB_color(255, 0, 0); // Red delay(1000); RGB_color(0, 255, 0); // Green delay(1000); RGB_color(0, 0, 255); // Blue delay(1000); RGB_color(255, 255, 125); // Raspberry delay(1000); RGB_color(0, 255, 255); // Cyan delay(1000); RGB_color(255, 0, 255); // Magenta delay(1000); RGB_color(255, 255, 0); // Yellow delay(1000); RGB_color(255, 255, 255); // White delay(1000);}void RGB_color(int red_light_value, int green_light_value, int blue_light_value) { analogWrite(red_light_pin, red_light_value); analogWrite(green_light_pin, green_light_value); analogWrite(blue_light_pin, blue_light_value);}

Step 4: Send to Arduino

USB-plug your board into your computer. Press the checkmark to verify and press the arrow to send to the arduino. When the LED starts flashing through your code, you can unplug it from your computer. Plug the 9V battery thingy into the board and the code will run.

Step 5: Put It Together.

Place the board inside the base with the power cord coming out the hole.

Step 6: Want to Reprogram It Again?

Take it out, plug it into the computer, code it, and place back in base again. Enjoy!

A video of it on is attached.