Professional Documents
Culture Documents
3
Experiment TITLE: Color Mixing Lamp
DISCUSSION:
The experiment is entitled "Color Mixing Lamp" because the aim of this experiment is to
show the different colors of light using an LED light, that was specified using a photoresistors. In
this experiment, three photoresistors and a RGB LED light were used, with which each
photoresistor will light up the LED corresponding to the color of the plastic illuminated into it;
Red, Green, and Blue. With this setup, the RGB LED light show the lights that was illuminated
to it, this will be target output for reading the data of the protoresistor as will be shown in the
data gathered.
The highlight of this experiment is the photoresistor, and it’s working process.
Photoresistor is known as a light-controlled variable resistor in which its resistance decreases
with increasing light intensity. In this experiment, we will now how to calibrate a photoresistor
by creating a prototype that controls the color of the LED light with the use of the resistance
coming from the photoresistor converted into a digital output.
LEARNING OBJECTIVES:
To learn and experience the usage and functions of a photoresistor with the use of RGB
LED light.
To be able to create a light sensing device (prototype) showing different colors: Red,
Green and Blue.
To be able to interpret and program a sketch and to create a proper wiring in fulfill the
desired output needed for a certain application.
To know and experience different ways of troubleshooting the prototype having a
photoresistor.
Course Objectives and Anticipated Student Outcomes
“A” Ability to apply knowledge of mathematics, science, and engineering
- In this experiment, we were engaged to think and use in controls system
engineering as well as apply the concepts and principles that was tackled through our
Electrical and Electronics engineering courses.
“B” Ability to design and conduct experiments as well as analyze and interpret data
- Using the principles discussed in "A", we've programmed the codes and arrange
the wirings based on the given design of our reference book (Arduino Projects Book).
We've created a light sensing device which will replicate in a one picture element.
“C” Ability to design a system to meet desired needs
- As discussed in "B", the codes are programmed and the sketch was uploaded
into the Arduino UNO board. Troubleshooting the prototype is also done to meet the
goal.
“D” Ability to function on multidisciplinary teams
- To be able to work with the experiment, each student is assigned to different
groups. And within our group, the task was distributed.
“E” Ability to identify, formulate, and solve engineering problems
- On the designing of the codes, the principles discussed in "A" is optimized and
expanded that the codes can be arranged in chronological order.
“F” Understanding of professional and ethical responsibility
- We were able to code our own sketch (codes) that is not directly copied from our
reference book, rather, it serves as a guide for the program. Each members of our group
do our tasks completely.
“G” Ability to communicate effectively
- We, as a group, talked about our tasks accordingly that our work will be
efficient and done in a short amount of time
“H” Broad education necessary to understand the impact of engineering solutions in a
global/societal context
- By learning and experiencing the usage of a photoresistor, we could optimize
this program created into a real-life application, especially in megapixel application like
cameras, televisions, smartphones and other light emitting devices.
“I” Recognition of the needs for and ability to engage in lifelong learning
- I learned that this experiment, as discussed in "H", is important in our field since
our designed machines need to be controlled using a digital device. This experiment
serves as our fundamental in converting mechanical stuffs into digital stuffs wherein the
computer can read and execute both the input and output of machines.
“J” Knowledge of contemporary issues
- As discussed in "I", the knowledge about photoconductivity can be used for the
design of the control system of our machine, especially nowadays, everything can be
controlled by our digital devices.
“K” Ability to use the techniques, skills, and modern engineering tools for engineering
practice
- As said in "I" and "J", this experiment serves as a fundamental in our real field
of work and for future technologies needing photoconductivity.
“L” Knowledge and understanding of engineering and management principles as a
member and leader in a team, to manage projects and in multidisciplinary environments.
- Through this experiment, each member of our group diligently focuses on the
task assigned. Consequently, planning and assigning was done by each member.
Group Experiment / Task done by EACH member
GROUP NUMBER 3
EXPERIMENT # 3
Experiment Title Color Mixing Lamp Due date: September 6, 2019
Delfin, Quintrae C.
1 Programming 100% 100%
Resistors 10k
Ω
5. Photoresistor (3 pieces)
Schematic Diagram
Photoresistors
Arduino Uno
Board
RGB LED
Light
Connecting wires
Resistors 220
Ω
Figure 6. Connecting the cable into the computer and uploading the sketch
Step 5. If some errors occurred, troubleshoot the codes or the wiring by trial and error of
encoding.
Figure 7. Process of troubleshooting the wirings and the programed codes
Step 6. Perform the experiment and complete the table for data gathering.
Figure 8. Performing the trials with the data gathered
Step 7. After performing the experiment, and gathering the data, disassemble all the
wirings and place the materials on the box.
Figure 9. Placing back the materials into its container
Arduino Program
const int greenLEDPin = 9; // prompts the board to register the green light cathode pin
of the LED as pin # 9
const int redLEDPin = 11; // prompts the board to register the red light cathode pin of
the LED as pin # 11
const int blueLEDPin = 10; // prompts the board to register the blue light cathode pin of
the LED as pin # 10
const int redSensorPin = A0; // declares of sensor pin connected to analogue A0
const int greenSensorPin = A1; // declares of sensor pin connected to analogue A1
const int blueSensorPin = A2; // declaration of sensor pin connected to analogue A2
void loop () { // sets the function within the program that is to be looped
10
redSensorValue = analogRead(redSensorPin); //reads the analog signals coming from pin # 11
delay (5); //after reading the said analog signal, board allows to "rest" the pin for the 5
milliseconds
greenSensorValue = analogRead(redSensorPin); //reads the analog signals coming from pin # 9
delay (5); //after reading the said analog signal, board allows to "rest" the pin for the 5
milliseconds
blueSensorValue = analogRead(redSensorPin); //reads the analog signals coming from pin # 10
Serial.print ("Raw Sensor Values \t Red: "); // output code for raw sensor values
Serial.print (redSensorValue); // output code for sensor and red connection value
Serial.print ("\t Green: "); // output connection for green color
Serial.print (greenSensorValue); // output code for sensor and green connection value
Serial.print ("\t Blue: "); // output connection for blue color
Serial.print (blueSensorValue); // output code for sensor and blue connection value
// declares the following values as mapped sensor values which is one - fourth times the value of
the initial sensor values
redValue = redSensorValue/4; //for pin # 11
greenValue = greenSensorValue/4; //for pin # 9
blueValue = blueSensorValue/4; //for pin # 10
Serial.print ("Mapped Sensor Values \t Red: "); //the board will prompt the software to print the
specified text in the output sheet
Serial.print (redValue); // output code for sensor and red connection value
Serial.print ("\t Green: "); // output connection for green color
Serial.print (greenValue); // output code for sensor and green connection value
Serial.print ("\t Blue: "); // output connection for blue color
Serial.print (blueValue); // output code for sensor and blue connection value
// the board will prompt the software to show the values of the said parameters on the serial
monitor function
analogWrite (redLEDPin, redValue); // the output color of the RGB LED is red
analogWrite (greenLEDPin, greenValue); // the output color of the RGB LED is green
analogWrite (blueLEDPin, blueValue); // the output color of the RGB LED is blue
delay (1000); // the board will prompt the circuit to "rest" for the 10000 milliseconds, then the
board will initiate the loop again
}