RGB Tissue Box

Introduction: RGB Tissue Box

The idea of this project was originally from ricardouvina:

https://www.instructables.com/id/Mood-Lamp-with-Ar...

The code of this project was originally from qazwsx755:

https://www.instructables.com/id/Arduino-Examples-...

This project is a mood lamp with RGB LED combined with a tissue box

I changed some of qazwsx755's code to my own and add my own idea, which is a tissue box to combine with the mood lamp.

Supplies

- Arduino Leonardo board x1

- Tissue box x1

- Small bag of tissue x1

- RGB LED x1

- Jumper wires x4

- Laptop x1

- Breadboard x1

- 330 ohm resistor x1

Step 1: Wire Up

First, connect the 330-ohm resistor with GND on any locations on the breadboard to the longest leg of the RGB LED.

Next, use the 4 wires to connect the remaining 3 legs of the RGB LED to the Arduino board

Red pin to pin 9, Green pin to pin 10, Blue pin to pin 12

Then go to step 2 to program the Arduino.

Step 2: Coding

Upload the code to make your board works

This is my code after editing. (Might not be good, but still can work)

Code link: https://create.arduino.cc/editor/usernamefuk/dc304...

Or maybe you can just copy and paste from the following:

//
int ledcolor = 0; int a = 5000; //改 original: 1000; how long it delays

int red = 9; //改 original: 11; pin connected

int green = 10; //改 original: 12; pin connected

int blue = 12; //改 original: 13; pin connected

void setup() { //this sets the output pins

pinMode(red, OUTPUT); pinMode(green, OUTPUT); pinMode(blue, OUTPUT); }

void loop() {

int ledcolor = random(7); //this randomly selects a number between 0 and 6

switch (ledcolor) {

case 0: // if ledcolor equals 0 then the led will turn red

analogWrite(red, 204); delay(a);

analogWrite(red, 0);

break;

case 1: //if ledcolor equals 1 then the led will turn green digital

Write(green, HIGH);

delay(a);

digitalWrite(green, LOW);

break;

case 2: //if ledcolor equals 2 then the led will turn blue

digitalWrite(blue, HIGH);

delay(a);

digitalWrite(blue, LOW);

break;

case 3: //if ledcolor equals 3 then the led will turn yellow

analogWrite(red, 160);

digitalWrite(green, HIGH);

delay(a);

analogWrite(red, 0);

digitalWrite(green, LOW);

break;

case 4: //if ledcolor equals 4 then the led will turn cyan

analogWrite(red, 168);

digitalWrite(blue, HIGH);

delay(a);

analogWrite(red, 0);

digitalWrite(blue, LOW);

break;

case 5: //if ledcolor equals 5 then the led will turn magenta

digitalWrite(green, HIGH);

digitalWrite(blue, HIGH);

delay(a);

digitalWrite(green, LOW);

digitalWrite(blue, LOW);

break;

case 6: //if ledcolor equals 6 then the led will turn white

analogWrite(red, 100);

digitalWrite(green, HIGH);

digitalWrite(blue, HIGH);

delay(a);

analogWrite(red, 0);

digitalWrite(green, LOW);

digitalWrite(blue, LOW); break;

}

}

//

Step 3: Tissue Box

Easy final step

Just tape your small bag of tissue up the box, better hanging the tissue up without contacting with the Arduino board.

Then put your Arduino board inside and connect with your laptop

Last but not least, upload your code and seal the tissue box up.

FINISH! Thanks for finish reading my project.

Btw thanks to qazwsx755 and ricardouvina with your ideas and code

Be the First to Share

    Recommendations

    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge
    • Tinkercad Student Design Contest

      Tinkercad Student Design Contest
    • Lamps and Lighting Contest

      Lamps and Lighting Contest

    Comments

    0
    Elaina M
    Elaina M

    1 year ago

    That looks great - and neat idea to build it into an existing tissue box structure - You should let the other author know you made a version of their project in the "I made it" section of their instructable. I'm sure they'd love to see this and hear your feedback if you did anything different :)