L.O.A.S.H’s Guide to (nearly) Everything: Arduino Color Lamp Mixer!

Quote of awesomeness: “Is not about creating an object. It is about creating a perspective.” ~ Albert Paley

Level of hardness: intermediate (You can do this!)

Heyyy!!!! Here’s another Arduino project for you!

For this project, you will need the following:

  • 1x Arduino UNO Board
  • 1x USB Cable Type A/B
  • 1x Breadboard
  • 1x RGB LED 
  • 3x 220-Ohm Resistor
  • 3x 10k-Ohm Resistor
  • 3x Photoresistors
  • 13x Jumper Wires

 

Step 1:

0-02-01-25a0a6f9debabdd212fbc3c05acd2fcf5f1c439705c879adf26fea2d27db35df_full.jpg

The first step is two connect your breadboard to your Arduino and it should look something like the photo above. Then, add your RGB LED to your breadboard. 

Step 2:

0-02-01-ce8d12da04188f7a9054ea5aa04a72e5ac576232bc208167812c08ec3ba18cfe_full

 

Next, you need to grab another wire and connect the other positive lane of the breadboard to the negative lane on the other side of the breadboard.

 

Step 3:

0-02-01-9bde85f3c5437a50c6a476f15138e6c5858ce46a700364835db6ee8e53447d2f_full

In this step, we will be placing the three 220-Ohm Resistors to three of the legs of the RGB LED. You will only be placing the resistors on the R, G and B of the RGB LED, this will leave you with one leg unconnected.

 

Step 4:

0-02-01-dbc63a13ab6f50466eb8dd3465af30d65b8f5e7967920a87645ee225ffaa44ea_full.jpg

For this step, you will be needing four wires. Remember I told you that you were left with one leg of the RGB LED which isn’t connected? Well, it’s time to connect it now! Place one end of the wire to the remaining leg of the RGB LED then place the other end to the negative lane of the board. In the photo, the wire which I used for this connection is white.

0-02-01-61ac8f02b55daa224f1962b3e828047ead0580414fcee62ded86ee5ad453523a_full.jpg

With the other three wires, connect it to each of the 220-ohm resistors. Then, connect the other end of the wires to the Arduino 9, 19, and 11.

 

Step 5:

0-02-01-9f2cb7be6b6ebbcc06aaf7b34dfd409e332e34965665efa0386c1a48cf6d16fb_full.jpg

Let’s place the photo-resistors on the breadboard so that they cross the center divide from one side to the other. 

 

Step 6:

0-02-01-c45f2f455156cfbfb4d1aee3c77926f4c5d55503f0796170018956fc0281a57a_full.jpg

Now, connect the 10k-Ohm resistors to one side of the photo-resistors and the other side to the negative lane of the breadboard.

 

Step 7:

0-02-01-3e1c74c9aa8f84a2158daa0ca5b528a6e2785236e0f532f18c1820533a1aa4a9_full.jpg

Taking three other wires, connect it between the photo-resistor and the 10k-Ohm resistor then connect the other end to the Analog In pins 0, 1, and 2 on the Arduino.

 

Step 8:

0-02-01-b946dc989126c65408412e7a570d06c10c28d9cfba450fc3cdc3bf12acca7b91_full.jpg

Going on the other side of the photo-resistor, connect each leg to the positive lane of the Arduino with three wires.

0-02-01-1733d59664a66910bba653033a94e1427937448a2a20dee06bab915fa06fac0f_full.jpg

Your result should look something like this!

 

Step 9:

This is the final step! Connect your Arduino to your computer, fire up your Arduino and copy paste in the following code:

const int greenLEDPin = 9;
const int redLEDPin = 11;
const int blueLEDPin = 10;

const int redSensorPin = A0;
const int greenSensorPin = A1;
const int blueSensorPin = A2;

int redValue = 0;
int greenValue = 0;
int blueValue = 0;

int redSensorValue = 0;
int greenSensorValue = 0;
int blueSensorValue = 0;

void setup() {
Serial.begin(9600);

pinMode(greenLEDPin, OUTPUT);
pinMode(redLEDPin, OUTPUT);
pinMode(blueLEDPin, OUTPUT);

}

void loop() {
redSensorValue = analogRead(redSensorPin);
delay(5);
greenSensorValue = analogRead(greenSensorPin);
delay(5);
blueSensorValue = analogRead(blueSensorPin);

Serial.print(“Raw Sensor Value \t Red: “);
Serial.print(redSensorValue);
Serial.print(“\t Green: “);
Serial.print(greenSensorValue);
Serial.print(“\t Blue: “);
Serial.print(blueSensorValue);

redValue = redSensorValue/4;
greenValue = greenSensorValue/4;
blueValue = blueSensorValue/4;

Serial.print(“Mapped Sensor Values \t Red: “);
Serial.print(redValue);
Serial.print(“\t Green: “);
Serial.print(greenValue);
Serial.print(“\t Blue: “);
Serial.println(blueValue);

analogWrite(redLEDPin, redValue);
analogWrite(greenLEDPin, greenValue);
analogWrite(blueLEDPin, blueValue);
}

 

Then watch as your RGD LED comes to life! It should change, mix and fade in different colours as the light around it changes, too! Awesome, right?? Yeah, it totally is.

Yours truly,

L.O.A.S.H

 


 © Elizabeth Anne Villoria 

 

L.O.A.S.H’s Guide to (nearly) Everything: How to Make an Arduino Robot Arm

Level of hardness: Intermediate

I’m so excited!

This project is just extremely awesome and awe-spiring that I can’t wait for you guys to try it out!

We. Are. Going. To. Make. An. Arduino. Robot. Arm!!!!!! I know, I know super cool. Now, without further ado, let’s jump right into this project.

The following are what you will need to gather:

  • 1x Arduino UNO Board
  • 1x Breadboard
  • 1x USB Cable Type A/B
  • 2x Button
  • 2x 10k-Ohm Resistor
  • 3x Potentiometer
  • 5x LED (A.K.A light-emitting diode, A.K.A miniature looking light bulb-ish)
  • 5x 220 Ohm Resistor
  • 20x Jumper Wires

Step 1:

First, let’s start by putting the potentiometers, the buttons, and the LED’s on our breadboard.

Step 1.jpg

We will be placing 3 potentiometers, 2 buttons, and 5 LED’s. For your reference, the photo above can help. Yes, I did say 5 LED’s but I forgot to place the fifth LED in this photo, but you should put 5.

Here are some important basics to understand about an LED:

Cathode (-, shorter side)

Anode (+, longer side)

0-02-01-011b6222b4e99533565c045f5f76d88f8eee9d81ad4743fa7754a214abc03bab_full.jpg

Step 2:

RESISTORS. Resistors. resistors.

Step 2.jpg
Here, in this photo, I’ve put 5 LED’s

Place five of your 220 Ohm Resistors on each of the Anodes (+) sides of each of your LED’s and the other end of the resistor to the negative side lane on your breadboard which we will later connect to the GND on your Arduino board. I’ve placed another photo above showing where I’ve placed my 220 Ohm Resistors.

ARDUINO1.jpg
Here, I circled each of the legs (Anode side) which I connected my 220 Ohm Resistors to

Now, take both of your 10k-Ohm Resistors. You will have to place one side of your resistor to only one of the button’s leg. Do this for both buttons. Here is another picture but of the buttons and resistor placing.

0-02-01-a4dc3cdadbe48e9699da5c60eaaf009fd209b963a449b08300cb864f4790b9c9_full.jpg

We have finished placing all the resistors we will be needing in this project. You guys are doing an awesome job, btw!

Step 3:

This step will be really quick.

All we need to is get two jumper wires, first. Then, connect the Negative lane on your breadboard to your GND on your Arduino, and, the positive lane of on your breadboard to the 5V on your Arduino (you can find this right beside the GND, usually).

0-02-01-6fd074bc2363a5d4f7eeac736e13aa2c95fdaaf5a41a127461e58cbd6de4e417_full.jpg
Here is the overview of everything so far

0-02-01-9f5ae76933b271ca278f51d0408598871b44bec7e1f6ffe72d9769cfe432e262_full.jpg

Done with this step. Great job!

Step 4:

For this step, you will be needing 5 of your jumper wires.

We will be connecting each of the LED’s on the breadboard onto the Arduino UNO board with your jumper wires.

0-02-01-e005f0f6751aba57f242a36978d87a1d43181bbb475954d45b82c2a3813de93d_full.jpg

Here is the first LED I connected. We will be connected the other leg (cathode, shorter side) of the LEDs to these numbers on the Arduino in order:

  • 2
  • 3
  • 4
  • 7
  • 8

I will also be numbering the LEDs on the next photo so that it will be easier to know which we will be connecting to which.

0-02-01-9ef28dac8b7d5bc5fd62e992e07553b3203f81f692aeb6eb5360a8dcfbb8f082_full.jpg
This shows where I connected my jumper wires to the LEDs

We will connect:

  • LED 1 to 2 on the Arduino board
  • LED 2 to 3 on the Arduino board
  • LED 3 to 4 on the Arduino board
  • LED 4 to 7 on the Arduino board
  • LED 5 to 8 on the Arduino board

0-02-01-b902992761fc2b9afa0ea746f62a966d45e98e808df225a0e38bfd5f7da3f940_full.jpg

Step 5:

I know that wiring could be a tedious job but it’s okay because I know you can do it.

Wiring is very important because it connects. It works as that bridge that can help cars go back and forth and connect with other cities. If you have a bulb and a power source you can’t just put it beside each other or clink it together to light the bulb up (even that would be super cool if that’s how easy it was), you need to connect it through wires. So, let’s continue? Yes.

In this step, we will be wiring the buttons and the potentiometers.

0-02-01-6fb24a73cf9e51511a1fe448099e10ea294b31eaaa6066c8dc9c5388a2a931f4_full.jpg

Here in this photo I got two jumper wires and connected one end to the remaining unconnected leg of the buttons and connected the other side of the jumper wire to the positive (+) lane on the breadboard

That was easy, wasn’t it?

We are nearly done!

Let’s start wiring the potentiometers now.

For the potentiometer, it’s going to be slightly harder.

0-02-01-f9a7e31d477692dcf148d5c2c74ab36ebda7f2d66e706d430d5ad2f6ea9eece8_full.jpg

In this photo, I’ve connected 3 jumper wires to the right side of the potentiometer then connected the other end of the wire to the Negative lane of the breadboard (A.K.A GND).

0-02-01-e83476876ad48bd0734014f0ae9b085c86dde636d44ad971e0b87cc2bfd5f27b_full.jpg

And, then, I got 3 more wires and connected it to the left side of my potentiometer then connected the other end to the Positive Lane on the breadboard.

0-02-01-e2341ee51a513ec1ceb48087e988986118cc7da8657b372b0e0892d09b7838a7_full.jpg

I’ve added the numbers on top of each potentiometer so that it’s easier to understand how to connect it to the Arduino.

As you may see on the picture to your left, I’ve added 3 white jumper wires to each of the middles of the potentiometers because we will connect this to the Arduino Board. Connect potentiometer 1 to the A0 on the Arduino UNO Board | Connect potentiometer 2 to the A1 on the Arduino UNO Board | Connect Potentiometer 3 to the A3 on the Arduino UNO Board.

0-02-01-b7140f69d3dca97af218c8d6d50cfdd2c516e1bd2f1a17e821fbfef945116f1a_full.jpg

Step 6:

0-02-01-c6963f33b5cc690153f696b05333e7086d58d45d3856e00540cec17fff73b77f_full.jpg

In this step, grab two more jumper wires and connect both ends of the lanes on each side of the breadboard to each other. I used the black and red wire here.

You will need to connect the Negative lanes on each side to each other and the Positive lane on each side to each other.

Tada! Next step.

Step 7:

Seeeeervoooo Moooootooooors.

We are nearing the last of our steps. KEEP GOING!

0-02-01-46631c0308f650ba97afc343709fdbb27f10dbd4643fe021bee9c020e70b9ffa_full.jpg

We will add the servo motors to our breadboard and I put mine side by side to each other.

I connected three jumper wires each for three of my servos, meaning 9 jumper wires in total.

About servo motors in Arduino:

  • They usually have 3 plug pins (this is where I connected my jumper wires to)

0-02-01-edf9b558c6d4432ad44cb70ca0e47ac313c1cd48d4732033f7e41d77cfc0058d_full.jpg

Take a look at your servo motor. You will probably notice there are three colored wires. Each color represents 3 different things. The colors could actually be different sometimes but, as you see here, my colors are brown, red, and yellow.

  • The brown is the Ground/Negative (-)
  • The red is Positive (+) [This wire is usually located at the center of all the three wires]
  • The yellow is the Signal

Your wires on your servo motors might be different and you might be thinking “WHAT!?!?” but it’s okay (that’s what I thought too) here is how you can compare it to mine to find the similarities:

  • The Ground/Negative is usually | Black or Brown (in my case, it’s brown)
  • The Positive is always Red
  • The Signal can be either | Orange, Yellow, or White (in my case, it’s Yellow)

Better?

Awesome, let’s proceed.

0-02-01-46631c0308f650ba97afc343709fdbb27f10dbd4643fe021bee9c020e70b9ffa_full.jpg

These are what you need to connect with your Servos:

  • Connect each of the GND/Negative (Black or brown wire) on each of your servo motors to the positive lane on your breadboard (I used a white jumper wire, check the photo above for reference)
  • Connect each of the Positive (Red wire) on each of your servo motors to the negative lane on your breadboard (I used an orange jumper wire)
  • Lastly, connect each of the signals (Orange, Yellow, or white wire) of your servo motors to: 5, 6, and, 9 on your Arduino
0-02-01-6dec16957b4bf711bfaab5ca160c05ce4352e7d5c718d7ccc6d0f65f2e468470_full.jpg
I know it’s a bit of a mess. But, there are three wires that you can find colored: 1x black & 2x green. These are the wires that connect to the Arduino

0-02-01-9a06e49e7a630816019854857d1f2d4f1a89238088779dac7ad18023d117a46f_full.jpg

Step 8:

This is our last time! Congratulations!!!

Connect your Arduino to your computer, fire up the Arduino app on your computer, copy paste the code below and press Upload.

Screen Shot 2018-01-20 at 15.01.04

Screen Shot 2018-01-20 at 15.01.15

Screen Shot 2018-01-20 at 15.01.23

Screen Shot 2018-01-20 at 15.01.32

Screen Shot 2018-01-20 at 15.01.42

Screen Shot 2018-01-20 at 15.01.49

Screen Shot 2018-01-20 at 15.02.07

Now, the challenge whether you choose to accept it or not is to build your own robot arm out of cardboard or you can check this —-> here which was made by Ryan Chan. Shoutout to him, btw. I hope you enjoyed this! I certainly had an awesome time and I hope you did, too!

You can teach others and share your awesome knowledge on building an arduino robot arm, I give some bragging rights.

Thanks so much for reading!

Yours truly,

L.O.A.S.H