Intro: Setting Up the Circuit
Step 1: Connecting Power
In every project you will wire up your breadboard to connect the 5V and ground pins on the Arduino to the voltage rails on the breadboard.
In this project it will also help to connect the top and bottom voltage rails to each other and connect the top and bottom ground rails to each other, as in the picture.
Connect the power and ground rails on the breadboard to the power and ground pins on the Arduino.
Connect the ground rails on the breadboard to each other and the power rails to each other.
Continue to the next step.
Step 2: Adding Photoresistors
Next we will wire up the three photo resistors. At the end of the project each of these will be used to sense a different color of light (red, green, or blue) using colored filters. Within the simulator you will be able to change the light level over the red, green, and blue sensors (1st, 2nd, and 3rd) independently to represent different colors of light hitting the sensor.
Follow the instructions below and use the picture as a guide to set up the circuit.
- Place the three photoresistors on the breadboard in row G, spaced a couple columns apart.
- Attach one end of each photoresistor to power. It doesn't matter which power rail you connect to, but it might be easier to draw a wire up to the top power rail (red).
- On the other side of the photoresistor, attach a 10 k-ohm resistor to ground. Again, use the top ground rail (black). This is the other half of the voltage divider.
- On the same side as the resistor, connect the photoresistors to analog input pins A0, A1, and A2 with a wire.
- Finally, you can name each one of the photoresistors in the simulator so you remember which sensor is associated with each color. To do this, highlight one sensor at a time with your cursor and re-name it in the popup menu.
- Continue to the next step.
Step 3: Colored Gel Filters (Arduino Kit)
If you are using the physical kit you will use the three colored gels, or strips of plastic, as light filters.
Each of these filters lets only light of a specific wavelength through to the sensor it’s covering. The red filter passes only red light, the green filter passes only green light, and the blue filter passes only blue light. This allows you to detect the relative color levels in the light that hits your sensors.
Using the image as a guide, slip one of the wooden cutouts onto the head of each photoresistor.
Place the red gel over the photoresistor connected to A0, the green over the one connected to A1, and the blue over the sensor connected to A2.
Continue to the next step.
Step 4: Adding the RGB LED
The LED with 4 legs is a "common cathode" RGB LED.
The LED has separate red, green, and blue elements inside, and one common ground (the cathode). Using the Arduino’s PWM pins (which are connected to the anodes through 220-ohm resistors), you’ll create custom colors by combining different amounts of red, green, and blue light.
Follow the instructions below and use the picture as a guide to setup this last part of the circuit.
- Place the RGB LED component in row J on the breadboard, as in the picture. Hover your cursor over each pin to figure out which is the cathode -- then connect this pin to the ground rail. In your physical kit, the longest leg is the cathode.
- Connect the other three pins to digital pins 9, 10 and 11 in series with 220-ohm resistors, using the picture as a guide. pin 11 = red, pin 10 = blue, pin 9 = green
- Continue to the next lesson to learn how to write the code!
Next Lesson:Writing the Code