DIY Rainbow House Decor
by DIYrobots on YouTube in Circuits > Arduino
613 Views, 2 Favorites, 0 Comments
DIY Rainbow House Decor
Welcome to my new article ... Making a DIY Rainbow House Decoration!
The Arduino can be used to make virtually any electronics project. Here I have used it to make a beautiful decoration for your house.
The "rainbow" part of this project is an RGB LED, which when turned on at night creates an astonishingly beautiful light.
This project is intended to be tweakable, so feel free to make any changes to your version of this project (but follow the attribution policies please! )
Visit me on YouTube here to find videos about the Arduino, Raspberry Pi, and more.
Enough talk; let's get started!
What You Will Need
Below are the parts you will need for the DIY Rainbow House Decor:
- Arduino Uno
- Small DC Motor
- Plastic body for the project
- 3 Alligator clips
- Hot glue gun with glue sticks
- Tape
- AAA Battery holder
- AAA battery
- 2.1 mm barrel plug AC to DC adaptor
- 5V Relay Module
- Common Anode RGB LED module*
- A computer with the Arduino IDE and other libraries installed (as I will mention later)
- and lots of jumper wires and cardboard!
*a "common anode" RGB LED means that there are 3 ground pins for the color connections and only one connection for positive power on the module.
Tip: use a relay module, only use a normal relay if you know exactly where each pin leads to
Once you have these supplies ready with you, you can now proceed in making the project!
The Hardware
For my house decor's hardware, I used an old piece of plastic I found lying around in my house. You can substitute this with a 3D-printed body or anything else capable of holding the contents of the project.
Of course, a beautiful casing is not absolutely necessary, but as the goal of this project is to make a house decoration, I recommend making or at least reusing some sort of case or box.
I used a hot glue gun to connect the pieces of the project to the casing. Once again, you can substitute a hot glue gun for any other adhesive you may wish to use.
Read on for the circuit diagram and connections...
The Circuit
Here are the connections I used for the DIY Rainbow House Decor:
The RGB LED:
- The common anode of the RGB LED goes into 5V
- The red pin of the LED goes into pin D11
- The blue pin of the LED goes into pin D10
- The green pin of the LED goes into pin D9
The Relay:
- The V+ ,+, 3V, or 5V (positive power connection) goes into pin VIN
- The Trig, S, or Sig (provides signal to relay when HIGH) goes into pin 5V
- The Gnd, G, -, or V- (negative power connection) goes into pin GND
- One of the pins labelled NO on the relay module go into one of the motor's pins, while the other pin labelled NO goes into one of the pins on the AAA battery holder.
The Motor:
- One of the motor's pins goes into one of the relay's pins labelled NO
- The other goes into one of the AAA battery holders connections
The AAA battery holder:
- One of the battery holder's pins goes to one of the motor's pins
- while the other goes into one of the pins labelled NO on the relay
The Code
Below is the code for the Arduino IDE. Copy it into the editor and upload the code.
int redPin = 11; // pin for the LED's red pin int bluePin = 10; // pin for the LED's blue pin int greenPin = 9; // pin for the LED's green pin int value; void setup() { pinMode(redPin, OUTPUT); pinMode(bluePin, OUTPUT); pinMode(greenPin, OUTPUT); } void loop(){ for(value=255; value>0; value--){ analogWrite(11, value); analogWrite(10, 255-value); analogWrite(9, 128-value); delay(10); } for(value=0; value<255; value++){ analogWrite(11, value); analogWrite(10, 255-value); analogWrite(9, 128-value); delay(10); } }
Now that you have uploaded the code to your Arduino, you're all done!
That's It!
You have finished making your DIY Rainbow House Decor!
Or at least finished reading this article :)
In any case, well done! Give yourself a pat on the back.
Thanks for reading this article!