Several AP Chemistry activities require the use of the
spectrophotometer. In addition, AP students deal with color and its
sources in several chapters. This activity introduces them to
the dyes used in food stuffs and in crepe paper and is a lead-in
activity to a chromatography project. This activity can meet several
MSDE Core Learning Goals.
Before this activity, students have worked with spectroscopes and ionized
gases. They have discussed the source of color in these cases and how it
is used as evidence of electron levels. They have no prior experience
with the spectrophotometer unless they have taken AP Biology.
The editting of the text file and production of graphs using MatLab took
students approximately 45 minutes.
Food Dye or Crepe Paper Spectroscopy
Using Vernier Spectrophotometer Program and MatLab
Purpose: to determine the absorption and transmittance spectra of various
dyes and to relate these spectra to the observed color
Procedure: Part A: Collecting the Data
1. Plug the ULI into the serial port of the computer and into the wall. Attach
the Spec20 to the ULI. Turn the Spec20 on and turn the ULI on.
2. Prepare the dye samples as instructed by your teacher.
3. Start the Vernier Spectrophotometer Program. From the initial screen choose
the Spectrum/ Absorbance vs. Wavelength button.
4. Now follow the instructions given in the program. Start at a wavelength of
400 nm. After you measure the first sample, ignore the program menu and place
the second sample in the chamber. Determine its measurement, tell the program
to keep that value as well. Repeat for the third, fourth, etc. samples. Only
go back to the program instructions given by the program after you have read
all the samples at one wavelength.
5. Change the wavelength by 10, and repeat step 4. BE SURE to do the samples
in the precisely the same order everytime. Make a note of this order. If you
make a mistake, keep track of the readings, mistakes can be edited out later.
6. When you have finished taking all readings (400 -700 nm by 10 for all
samples) click on STOP. From the file menu, choose save. Save the data as
spec.txt.
Part B: Analyzing the Data
7. To use the data in MatLab, the file must be edited. Open MatLab and then
choose Open M-file from the File menu. Find the file spec.txt and open it.
It should look something like this only much longer:
Spectrophotometer Program
Absorbance vs Wavelength
Wavelength transmittance absorbance
nm %
500 80.8 0.092
500 0.7 2.120
500 64.7 0.188
500 23.7 0.624
520 86.8 0.061
520 0.7 2.122
520 62.6 0.202
520 59.9 0.222
540 75.0 0.124
540 6.7 1.172
540 60.3 0.219
540 76.6 0.115
You need to delete the text at top and to delete all the repeat wavelengths.
The file should have all data for one wavelength on one line, spaces between
the separate readings. The file above would look like this when edited:
500 80.8 0.092 0.7 2.120 64.7 0.188 23.7 0.624
520 86.8 0.061 0.7 2.122 62.6 0.202 59.9 0.222
540 75.0 0.124 6.7 1.172 60.3 0.219 76.6 0.115
When you have the file edited, save it as spec.dat. MatLab will ask a question
about a Ò.mÓ extension, click on No.
8. Click on the Command Window (the window where the >> is). Type
load spec.dat;
wave = spec(:,1); the wavelengths are in the variable wave
The odd columns in your data file are absorbance columns, the even are
transmittance. We want to load each column and we want to know the color.
For instance, if you collected the samples in the order red, yellow green and
blue, you might type the following:
redt = spec(:,2);
redA = spec(:,3);
yelt = spec(:,4);
yelA = spec(:,5);
grnt = spec(:,6);
grnA = spec(:,7);
blut = spec(:,8);
bluA = spec(:,9);
where t stands for transmittance and A for absorbance. You MIGHT have to adjust
the above commands for your data.
9. The transmittance data will be plotted on one graph and the absorbance on
another. The command to plot absorbance looks like this:
plot(wave,redA,'r',wave, yelA,'y',wave ,grnA,'g',wave,bluA,'b');
where wave is the x-variable, the A variables are on the y and the plot colors
are changed by the letters in single quotes ('r' = red, 'y' = yellow, etc.)
10. The absorbance graph should have some peaks and valleys. Type:
ginput(4) (4 because there were four colors in the example
above. This number should equal the number of curves)
a cursor will appear on the graph and you can point and click at the major peak
for each color. The values for the peaks will appear in the command window.
11. Plot the transmittance graph and determine the peaks for it.