You are on page 1of 14

MECHATRONICS ME156P SECTION E01 EXPERIMENT NO.

3
Experiment TITLE: Color Mixing Lamp

NAME: RAMOS, Chester Jericho O. Date Performed: September 3, 2019


Student No.: 2015108036 Date Submitted: September 6, 2019
PROFESSOR: Engr. Edward B.O. Ang Course and Year: ME - 4
GROUP # 3

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

Group Member Name Brief Description Work % Completed


No. Your Score
Group Member signature Assigned to Member by Member

Delfin, Quintrae C.
1 Programming 100% 100%

Gampon, Jonas D. Troubleshooting and


2 100% 100%
Documentation

Gasis, Lloyd Christopher


3 Assembling the Circuit 100% 100%

Pamintuan, John Andrew V. Troubleshooting and


4 100% 100%
testing

Ramos, Chester Jericho O. Bring Laptop and


5 100% 100%
Documentation

6 Santos, Erlvin Fernando A. Troubleshooting and 100% 100%


Assembling the Circuit
List of Materials needed for this Experiment
1. Arduino UNO with attached Breadboard (1 piece)

2. Resistors (6 pieces; 3 pieces of 10kΩ, 3 pieces of 220Ω)


Resistors 220
Ω

Resistors 10k
Ω

3. USB cable wire (1 piece)


4. Connecting wires (13 pieces; 3 blue wires, 3 brown wires, 3 green wires, 3 yellow wires,
1 red wire)

5. Photoresistor (3 pieces)

6. RGB LED light (1 piece)


7. Plastic Filters (3 pieces; Red, green, blue)

Schematic Diagram

Figure 1. Schematic Diagram for Color Mixing Lamp Experiment.


Resistors 10kΩ

Photoresistors
Arduino Uno
Board

RGB LED
Light

Connecting wires
Resistors 220
Ω

USB cable wire


Breadboard

Figure 2. Labelled Actual wiring arrangement of the prototype


List of ACTUAL SAFETY procedures implemented in this experiment
Step 1. Gather the needed materials (hardware of the experiment).

Figure 3. Material Gathering


Step 2. Assemble the Materials with reference to the diagram shown in Fig. 1 (see figure
2 for actual wiring). Double check for the placement of the wiring, resistors, and
photoresistors. In addition, take note of placement of the LED when wiring since LED is
a diode, wherein the longer leg is the anode (+) and the shorter leg is the Cathode (-).
Figure 4. Process of assembling
Step 3. Re-program the codes given in the reference material (Arduino Projects Book),
according to the wirings discussed in Step 2.

Figure 5. Encoding Process


Step 4. Connect the Arduino UNO board to the computer using the USB cable wire and
upload the sketch created.

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

int redValue = 0; // declaration of ineteger value of red color


int greenValue = 0; // declaration of ineteger value of green color
int blueValue = 0; // declaration of ineteger value of blue color
int redSensorValue = 0; // declaration of ineteger value of red sensor color
int greenSensorValue = 0; // declaration of ineteger value of green sensor color
int blueSensorValue = 0; // declaration of ineteger value of blue sensor color

void setup () { // initiates the setup within the circuit


Serial.begin (9600); // set the amount of data transferring rate between the board
and the circuit, in bits per second
pinMode (greenLEDPin, OUTPUT); // declaring pin # 9 as the output source of the device
pinMode (redLEDPin, OUTPUT); // declaring pin # 11 as the output source of the device
pinMode (blueLEDPin, OUTPUT); // declaring pin # 10 as the output source of the device

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
}

Data Sheet / Gathered: WITH CALIBRATION

COLOR RED # GREEN # BLUE #


RED 4 0 0
GREEN 0 1 0
BLUE 0 0 2

Analysis of the Experiment Done


Using the discussed and presented codes, which was then uploaded as a sketch in the
Arduino UNO board with the proper wiring, we've created the prototype. The prototype created a
light sensing device, in which replicates/illuminates the light color (red, green, blue) using a
colored plastic, that was passing through the photoresistor, using the RGB LED light. In this
experiment, the photoresistor is introduced, in which it replicated how intense the light it senses
using the RGB LED light. Based on the codes/program discussed previously, the reading
determines the values that will be sent to the RGB LED light so that it can provide the right
color.
The data is gathered with the use of "Serial Monitor" tool of the Arduino IDE software in
which upon turning red, green, and blue, we recorded the values that are used as input to the
LED.
Recommendation:
After doing the experiment, I recommend eliminating the unlikely light that is produced
by the fluorescent light of the room, laptop lights, and other source of light because it affect the
output of the LED light. For instance, this experiment must be done in a dark area for accurate
data. Secondly, I recommend for the group to do their task efficiently since the time allotted is
very minimal. Hence doing the report consumes enormous amount of time. Lastly, follow the
procedures diligently so that the prototype maybe efficient, quickly done and leave no broken
materials for les cost of expenses.
Conclusion:
On the process of experimentation, I learned and experienced creating a prototype using a
photoresistor, which was discussed in the Analysis part of this report. I was also able to discuss
each line of the sketch. Lastly, in troubleshooting, we used trial and error method while varying
the codes and wiring with respect to our own interpretation of the codes.
With that said, and based on the explained data, it can be concluded that the experiment
was done successfully, with which all the objectives have been met.
ANSWERS TO QUESTIONS:
a.) How does color of the plastics function in your experiment? DESCRIBE what did you see?
- We use the colored plastic simply because the photoresistor will replicate its color
through the RGB LED lights. But with this experiment, it simply filtered out some light,
in which it changes the amount of light that the photoresistors detected as the LED light's
color change.
b.) How does EACH of the Photoresistors worked in this experiment?
- In this experiment, each photoresistor provides analog reading for the system/computer to
understand since photoresistors converts it to digital value, which were then outputted as
a color with the use of an RGB LED.
c.) SUGGEST the INDUSTRIAL APPLICATION of this kind of experiment?
- Together with the discussion stated in "H" and "I" of the Course Objectives and
Anticipated Student Outcomes part of this report, this experiment can also be used in
street light or street lamps wherein when the road becomes darker, the lights will light up.
d.) Individually suggest electrical and mechanical standards or codes and local or international
applicable in this experiment. Cite source/s.
- Road Lighting Guidelines by DOE
Source:https://www.doe.gov.ph/sites/default/files/pdf/energy_efficiency/doe-road-light-2017.pdf
- IEEE Recommended Practices for Modulating Current in High-Brightness LEDs for
Mitigating Health Risks to Viewers
Source: https://sci-hub.tw/10.1109/ieeestd.2015.7118618

You might also like