## Sunday, March 19, 2017

### Blog Report Week 10

PART A: MATLAB practice.
1. Open MATLAB. Open the editor and copy paste the following code. Name your code as FirstCode.m

Save the resulting plot as a JPEG image and put it here.
clear all;
close all;
x = [1 2 3 4 5];
y = 2.^x;
plot(x, y, 'LineWidth', 6)
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)

2. What does clear all do?

Clear all clears all of the previous commands that are left in the command window.

3. What does close all do?

Close all closes all of the figures and windows that have been made previous to this command.

4. In the command line, type x and press enter. This is a matrix. How many rows and columns are there in the matrix?

This matrix has 5 columns and 1 row.

5. Why is there a semicolon at the end of the line of x and y?

This semicolon prevents the command from showing up in the command window, but still allows the command to go through.

6. Remove the dot on the y = 2.^x; line and execute the code again. What does the error message mean?

7. How does the LineWidth affect the plot? Explain.

Line Width makes allows you to change the thickness of the graph.

8. Type help plot on the command line and study the options for plot command. Provide how you would change the line for plot command to obtain the following figure (Hint: Like ‘LineWidth’, there is another property called ‘MarkerSize’)
clear all;
close all;
x = [1 2 3 4 5];
y = 2.^x;
plot(x, y,'ro-', 'LineWidth', 6, 'markersize', 20)
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)

9. What happens if you change the line for x to x = [1; 2; 3; 4; 5]; ? Explain.

This adjusts the matrix by making it have 1 column and 5 rows. The semi columns cause you to "enter" within the matrix, moving your next entry down a row.

10. Provide the code for the following figure. You need to figure out the function for y. Notice there are grids on the plot.
clear all;
close all;
x = [1 2 3 4 5];
y = x.^2;
plot(x, y,'sk:', 'LineWidth', 6, 'markersize', 20)
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)
grid on
set(gca, 'gridlinestyle',':')

11. Degree vs. radian in MATLAB:

a. Calculate sinus of 30 degrees using a calculator or internet.

sin(30)=0.5

b. Type sin(30) in the command line of the MATLAB. Why is this number different? (Hint: MATLAB treats angles as radians).

sin(30)
ans =

-0.9880

This number is different because 30 radians is not equivalent to 30 degrees and Matlab is doing the calculation with respect to radians while my calculator is doing the calculation with respect to degrees.

c. How can you modify sin(30) so we get the correct number?

The command "sind( )" allows you to evaluate the problem with respect to degrees instead of radians.

12. Plot y = 10 sin (100 t) using Matlab with two different resolutions on the same plot: 10 points per period and 1000 points per period. The plot needs to show only two periods. Commands you might need to use are linspace, plot, hold on, legend, xlabel, and ylabel. Provide your code and resulting figure. The output figure should look like the following:
clear all;
close all;
clc;
x=linspace(0,.1256636,10);
y=100*sin(100*x);
plot(x,y,'ro-')
hold on
z=linspace(0,.1256636,2000);
q=100*sin(100*z);
plot(z,q)
xlabel('Time (s)');
ylabel('y function');
legend('Coarse','Fine')

13. Explain what is changed in the following plot comparing to the previous one.

14. The command find was used to create this code. Study the use of find (help find) and try to replicate the plot above. Provide your code.

clear all;
close all;
clc;
x=linspace(0,.1256636,10);
y=10*sin(100*x);
plot(x,y,'ro-')
hold on
z=linspace(0,.1256636,2000);
q=10*sin(100*z);
t=find(q>5);
q(t)=5;
plot(z,q)
xlabel('Time (s)');
ylabel('y function');

legend('Coarse','Fine')

PART B: Filters and MATLAB
1. Build a low pass filter using a resistor and capacitor in which the cut off frequency is 1 kHz. Observe the output signal using the oscilloscope. Collect several data points particularly around the cut off frequency. Provide your data in a table.

 Low Pass

 High Pass

2. Plot your data using MATLAB. Make sure to use proper labels for the plot and make your plot line and fonts readable. Provide your code and the plot.

 Low Pass
clear all;
close all;
x = [1000 990 980 889 789 688 589 299 104 1113 1300 2331 3000 5023 7588 4242 6500];
y = [2.124 2.1356 2.1469 2.237 2.3277 2.4294 2.5198 2.7571 2.825 2.011 1.853 1.22 0.983 0.621 0.429 0.734 0.497];
X=sort(x);
Y=sort(y,'descend');
plot(X, Y, '-ro','MarkerSize', 5)
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)

 High Pass
clear all;
close all;
x = [1000 743 560 342 243 154 1647 1813 2994 1484 1364 1125 2666];
y = [1.966 1.638 1.344 0.892 0.666 0.4519 2.406 2.474 2.700 2.316 2.248 2.079 2.655];
X=sort(x);
Y=sort(y);
plot(X, Y, '-ro','MarkerSize', 5)
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)

3. Calculate the cut off frequency using MATLAB. find command will be used. Provide your code.
4. Put a horizontal dashed line on the previous plot that passes through the cutoff frequency.
5. Repeat 1-3 by modifying the circuit to a high pass filter.

clear all;
close all;
x = [1 2 3 4 5];
y = 2.^x;
plot(x, y,'ro-', 'LineWidth', 6, 'markersize', 20)
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)
%%
clear all;
close all;
x = [1 2 3 4 5];
y = x.^2;
plot(x, y,'sk:', 'LineWidth', 6, 'markersize', 20)
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)
grid on
set(gca, 'gridlinestyle',':')
%%
clear all;
close all;
clc;
x=linspace(0,.1256636,10);
y=10*sin(100*x);
plot(x,y,'ro-')
hold on
z=linspace(0,.1256636,2000);
q=10*sin(100*z);
t=find(q>5);
q(t)=5;
plot(z,q)
xlabel('Time (s)');
ylabel('y function');
legend('Coarse','Fine')
%%
clear all;
close all;
x = [1000 990 980 889 789 688 589 299 104 1113 1300 2331 3000 5023 7588 4242 6500];
y = [2.124 2.1356 2.1469 2.237 2.3277 2.4294 2.5198 2.7571 2.825 2.011 1.853 1.22 0.983 0.621 0.429 0.734 0.497];
X=sort(x);
Y=sort(y,'descend');
plot(X, Y, '-ro','MarkerSize', 5)
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)
%%
clear all;
close all;
x = [1000 743 560 342 243 154 1647 1813 2994 1484 1364 1125 2666];
y = [1.966 1.638 1.344 0.892 0.666 0.4519 2.406 2.474 2.700 2.316 2.248 2.079 2.655];
X=sort(x);
Y=sort(y);
plot(X, Y, '-ro','MarkerSize', 5)
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)
%% Calculating Cutoff LP
clear all;
close all;
x = [1000 990 980 889 789 688 589 299 104 1113 1300 2331 3000 5023 7588 4242 6500];
y = [2.124 2.1356 2.1469 2.237 2.3277 2.4294 2.5198 2.7571 2.825 2.011 1.853 1.22 0.983 0.621 0.429 0.734 0.497];
X=sort(x);
Y=sort(y,'descend');
plot(X, Y, '-ro','LineWidth', 2, 'MarkerSize', 8, 'MarkerEdgeColor', 'k')
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)
k = find (vout>5.96*.65, 1, 'last')
x(k)
%% Horizontal Line
clear all;
close all;
x = [1000 990 980 889 789 688 589 299 104 1113 1300 2331 3000 5023 7588 4242 6500];
y = [2.124 2.1356 2.1469 2.237 2.3277 2.4294 2.5198 2.7571 2.825 2.011 1.853 1.22 0.983 0.621 0.429 0.734 0.497];
X=sort(x);
Y=sort(y,'descend');
plot(X, Y, '-ro','MarkerSize', 5)
hold on
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)
f=2
fplot(f,':r')

## Monday, March 13, 2017

### Blog Report Week 9

1. Measure the resistance of the speaker. Compare this value with the value you would find online.

• The measure speakers resistance was about 8.8Ω, the expected resistance for this speaker listed online was about 8Ω.

2. Build the following circuit using a function generator setting the amplitude to 5V (0V offset). What happens when you change the frequency? (video)

Video 1: Demonstrating the circuit from the diagram above

 Table 1: Explains our observations at different frequency's from the circuit above

•  When you change the frequency the audio produced by the speaker changes, the higher it goes the high pitched the sound becomes until it becomes undetectable around 20 kHz.

3. Add one resistor to the circuit in series with the speaker (first 47 Ω, then 820 Ω). Measure the voltage across the speaker. Briefly explain your observations.

 Table 2: Shows our observations, along with the oscilloscope's output at different resistances.

4. Build the following circuit. Add a resistor in series to the speaker to have an equivalent resistance of 100 Ω. Note that this circuit is a high pass filter. Set the amplitude of the input signal to 8 V. Change the frequency from low to high to observe the speaker sound. You should
not hear anything at the beginning and start hearing the sound after a certain frequency. Use 22 nF for the capacitor.
(a.) Explain the operation. (video)

Video 2: High pass filter in operation, note that even though
it was called a low pass in the video, the circuit setup is high.

(b.) Fill out the following table by adding enough (10-15 data points) frequency measurements. Vout is measured with the DMM, thus it will be rms value.

 Table 3: Recorded values using the DMM, function generator, and oscilloscope to determine Vout/Vin

(c.) Draw Vout/Vin with respect to frequency using Excel.
 Plot 1: Vout/Vin vs. Frequency graphed by Excel

(d.) What is the cut off frequency by looking at the table (b.) and plot of it in (c.)?

• Based off the data in plot 1 from Table 3, the cutoff frequency is about 2900 Hz because it appears to change its Vout/Vin path more rapidly.

(e.) Draw Vout/Vin with respect to frequency using MATLAB, use the following code:

Frequency = [ ]; % data points will be in the brackets
Output = [ ]; % Vout/Vin data points would be in the brackets.
plot(Frequency, Output, ’o-r’)
xlabel(' '); %Right your x-axis label in ‘’
ylabel(' '); %Right your y-axis label in ‘’
title(' '); %Title of your plot

 Plot 2: Vout/Vin vs. Frequency plotted using MATLAB High Pass Filter

(f.) Calculate the cut off frequency theoretically and compare with one that was found in c.
• Taking fc = Vmax * (1/√2) so [0.002142857 * 0.707107 = 0.001515] which according to table 3 the Vout/Vin matches up with frequency's within the 2400 - 2900 Hz range.

(g.) Explain how the circuit works as a high pass filter.
• Notice that the voltage increases more around the frequency of about 3000 Hz. Additionally it can be said that the voltage's cutoff point is just below 10000 Hz. This shows how a high pass filter works, by not allowing lower frequency's to pass until it reaches the 3 kHz range.

(5.) Design the circuit in 4 to act as a low pass filter and show its operation. Where would you put the speaker? Repeat 4a-g using the new designed circuit.

(a.) Explain the operation. (video)

Video 3: Low pass filter operation explained

(b.) Fill out the following table by adding enough (10-15 data points) frequency measurements. Vout is measured with the DMM, thus it will be rms value.

 Table 4: Data recorded for Low Pass filter

(c.) Draw Vout/Vin with respect to frequency using Excel.

 Plot 3: Vout/Vin vs. Frequency graphed by excel

(d.) What is the cut off frequency by looking at the table (b.) and plot of it in (c.)?

• According to table 4 and the plot 3, the cut-off frequency is around 3-5 kHz.

(e.) Draw Vout/Vin with respect to frequency using MATLAB.

 Plot 4: Vout/Vin vs. Frequency plotted using MATLAB Low Pass Filter

(f.) Calculate the cut off frequency theoretically and compare with one that was found in c.
• fc = Vmax * (1/√2) so [0.002298038 * 0.707107 = 0.001625] which according to table 4 the Vout/Vin matches up with frequency's 3-4 kHz.

(g.) Explain how the circuit works as a low pass filter.

• The circuit works as a low pass filter by only allowing lower frequencies to pass, as you begin increasing the frequency the voltages begin to cut off (trend lower).

(6.) Construct the following circuit and test the speaker with headsets. Connect the amplifier output directly to the headphone jack (without the potentiometer). Load is the headphone jack in the schematic. “Speculate” the operation of the circuit with a video.

Video 4: Microphone to Auxiliary Jack circuit operation explained

*It should be noted that the headphones did work, but the pin-out for the auxiliary jack can differ for certain brands of headphones, trying different combinations based on the rings in which connect to the circuit can save you a lot of time, and frustration.

## Monday, February 27, 2017

### Blog Report Week 8

Draw and explain a Rube Goldberg design that will include the following components:

- Digital
- Motor
- Relay
- Opamp
- Temperature sensor
- LED

The setup should be considered to last 30 seconds.

Video 1: Rube Goldberg Explained

Video 2: Rube Goldberg in action

• Clearly in our circuit the relay was giving us a hard time. Other than that the circuit pretty much functioned according to plan. We showed the increasing voltage that was coming from the op-amp and into the relay to help viewers understand the circuit better. When the mechanism fell over, the slight bounce is just enough to release pressure on the switch. This is why there are random weight blocks on the back side and ultimately why I ended up pressing on the mechanism in the video.

Make sure to include enough photos, videos, and explanations for each “transition” or step. Explain your circuits.

 Photo 1: Shows the motor attached to the falling mechanism that will trigger the 7 segment display to turn on

 Photo 2: Overview of the 7 segment display, op-amp, and relay

 Photo 3: Shows 555 timer

 Photo 4: A closer view of the heat sensor, op-amp, and relay

 Photo 5: Showing the connections made in order to produce the number 3 on the 7 segment display

The following pictures are schematics of our Rube Goldberg's components layout

 Schematic 1: Is a block diagram of our Rube Goldberg circuit

 Schematic 2: Is part one of our Rube Goldberg Circuit

 Schematic 3: Is part two of our Rube Goldberg Circuit

Put at least 2 issues/problems/struggles you faced during the project.

• Problem 1: One problem that we encountered during this Rube Goldberg build was getting the gain on the op-amp to be just right. Instead of using two resistors, we ended up having to use three because we couldn't find one resistor to be precise enough. I am forgetful of the two values that we put in series to make this happen, but it worked nonetheless.

• Problem 2: Another problem that we faced during this build was getting everything to work correctly at the end of it. As you can see in the video, the falling mechanism we built did not have enough weight to trigger the switch on the bottom side. This is why you can see me push down on it to light up our group number. The motor was also very weak and we had little supplies available to attach to it.

## Monday, February 20, 2017

### Blog Report Week 7

1. Force sensing resistor gives a resistance value with respect to the force that is applied on it. Try different loads (Pinching, squeezing with objects, etc.) and write down the resistance values. (EXPLAIN with TABLE)

 Table 1: Data for Force Sensing Resistor with range of pressures

• The pressure pad decreases the amount of resistance, the more pressure applied the more current it allows to flow.

2. 7 Segment display:

a.) Check the manual of 7 segment display. Pdf document’s page 5 (or in the document page 4) circuit B is the one we have. Connect pin 3 or pin 14 to 5 V. Connect a 330 Ω resistor to pin 1. Other end of the resistor goes to ground. Which line lit up? Using package dimensions and function for B (page 4 in pdf), explain the operation of the 7 segment display by lighting up different segments. (EXPLAIN with VIDEO).

Video 1: Demonstrates how a 7 segment display works

b.) Using resistors for each segment, make the display show 0 and 5. (EXPLAIN with PHOTOs)

 Photo 1: Number zero displayed by pins 1, 2, 7, 8, 10 and 13 to ground  through 330Ω resistors.
 Photo 2: Number five displayed by  pins 1, 2, 8, 10 and 11 to ground  through 330Ω resistors.

• The LED output depends on which cathodes are connected to the ground.

3. Display driver (7447). This integrated circuit (IC) is designed to drive 7 segment display through resistors. Check the data sheet. A, B, C, and D are binary inputs. Pins 9 through 15 are outputs that go to the display. Pin 8 is ground and pin 16 is 5 V.

a.) By connecting inputs either 0 V or 5 V, check the output voltages of the driver. Explain how the inputs and outputs are related. Provide two different input combinations. (EXPLAIN with PHOTOS and TRUTH TABLE)
UPDATE! You cannot actually measure the output voltages directly (I challenge you to figure out why!). You need to connect an LED and a resistor. LED’s positive terminal will go to 5 V. Negative terminal will be connected to your outputs via a resistor. The circuit would look like below:

 Photo 3: Shows the voltage reading across the LED when it is on.
 Photo 4: Shows the voltage reading across the LED when it is turned off.

 Table 2: Is a truth table based off the inputs for the 7447 Display Driver (IC).

• The reason you cannot measure the voltages directly is because you're not completing the circuit, you need to ground the end of the connection.

b.) Connect the display driver to the 7 segment display. 330 Ω resistors need to be used between the display driver outputs and the display (a total of 7 resistors). Verify your question (3a)
outputs with those input combinations. (EXPLAIN with VIDEO)

Video 2: Testing to make sure that our truth table is accurate. We placed inputs A, B, C, and D all in alphabetical order to make it easier for us to control the inputs. The binary input that is entered through highs and lows will be translated to a whole number on the 7 segment display. This is just proven in the video.

4. 555 Timer:

a.) Construct the circuit in (Fig. 14) of the 555 timer data sheet. VCC = 5V. No RL (no connection to pin 3). RA = 150 kΩ, RB = 300 kΩ, and C = 1 µF (smaller sized capacitor). 0.01 µF capacitor is somewhat larger in size. Observe your output voltage at pin 3 by oscilloscope. (Breadboard and Oscilloscope PHOTOS)

 Photo 5: Shows a picture of our circuit laid out on the breadboard.
 Photo 6: Shows the oscilloscope reading of the 555 timer's output

b.) Does your frequency and duty cycle match with the theoretical value? Explain your work.

• According to the theoretical duty cycle, since our clock's rate is continuously changing between high and low, the cycle is about 40%. In the 555 timer's pdf manual there are equations for the Duty Cycle and frequency they can be calculated using the following:
 Equations for Frequency and Duty Cycle for Astable Operation circuit of a 555 timer, it's theoretical values can be calculated using these.

t1 = 0.3149685 s
t2 = 0.209979 s
T = (t1 + t2) = 0.5249475 s

f = (1 / T) = 1.9049524 Hz
D = (0.40) = 40%

c.) Connect the force sensing resistor in series with RA. How can you make the circuit give an output? Can the frequency of the output be modified with the force sensing resistor? (Explain with VIDEO)

Video 3: Putting pressure on the force sensor is how you make the circuit give an output. The frequency of the output can be modified by adjusting the force on the force sensor. This is shown in the video.

5. Binary coded decimal (BCD) counter (74192). This circuit generates a 4-bit counter. With every clock change, output increases; 0000, 0001, 0010, …, 0111, 1000, 1001. But after 1001 (which is decimal 9), it goes back to 0000. That way, in decimal, it counts from 0 to 9. Outputs of 74192 are labelled as QA (Least significant bit), QB, QC, and QD (Most significant bit) in the data sheet (decimal counter, 74192). Use the following connections:

5 V: pins 4, 11, 16.
0 V (ground): pins 8, 14.
10 µF capacitor between 5 V and ground.

a.) Connect your 555 timer output to pin 5 of 74192. Observe the input and each output on the oscilloscope. (EXPLAIN with VIDEO and TRUTH TABLE)

Video 4: This video shows the input from the timer alongside the output from QB. This is just to show the comparison between the two signals. Each signal from the 74192 is a little different because they contain different highs and lows.

 Table 3: Truth table shows 74192 output from the 555 timer.

6. 7486 (XOR gate). Pin diagram of the circuit is given in the logic gates pin diagram pdf file. Ground pin is 7. Pin 14 will be connected to 5 V. There are 4 XOR gates. Pins are numbered. Connect a 330 Ω resistor at the output of one of the XOR gates.

a.) Put an LED in series to the resistor. Negative end of the LED (shorter wire) should be connected to the ground. By choosing different input combinations (DC 0V and DC 5 V), prove XOR operation through LED. (EXPLAIN with VIDEO)

Video 5: Here is a video testing different combinations on the XOR gate and proving its truth table. When the inputs are opposite, the light is on. When the inputs are the same, the light is off.

b.) Connect XOR’s inputs to the BCD counters C and D outputs. Explain your observation. (EXPLAIN with VIDEO)

Video 6: This video shows the C and D outputs from the 74192 plugged into the XOR gate. When the signals are the same, the light goes off. When the signals are opposites, the light turns on.

c.) For (6b.), draw the following signals together: 555 timer (clock), A, B, C, and D outputs of 74192, and the XOR output. (EXPLAIN with VIDEO)

Video 7: Explains how  A, B, C, D, Clock, and Xor are Related

 Photo 7: Picture of signals explained in video above.

7. Connect the entire circuit: Force sensing resistor triggers the 555 timer. 555 timer’s output is used as clock for the counter. Counter is then connected to the driver (Counter’s A, B, C, D to driver’s A, B, C, D). Driver is connected to the display through resistors. XOR gate is connected to the counter’s C and D inputs as well and an LED with a resistor is connected to the XOR output. Draw the circuit schematic. (VIDEO and PHOTO)

Video 8: This is a video of the entire circuit connected and running. We are unsure why only even numbers are counting. We tried and tried, but could not find a solution. Sometimes it was just odd numbers as well.

 Photo 7: A schematic of our XOR Gate LED and 7 segment display

8. Using other logic gates provided (AND and OR), come up with a different LED lighting scheme. (EXPLAIN with VIDEO)

Video 9: This is a video showing Justin's alternate setup using the AND and OR gates that were provided to us. The AND gate's output is connected to the input of an OR gate. The video explains the different combinations that make the light work.

## Sunday, February 12, 2017

### Blog Report Week 6

1. You will use the OPAMP in “open-loop” configuration in this part, where input signals will be applied directly to the pins 2 and 3.

a.) Apply 0V to the inverting input. Sweep the non-inverting input (Vin) from -5V to 5V with 1V steps. Take more steps around 0V (both positive and negative). Create a table for Vin and Vout. Plot the data (Vout vs Vin). Discuss your results. What would be the ideal plot?

 Table 1: Non-Inverting Op-amp
 Figure 1: Plot of Vin vs. Vout for an Non-Inverting Op-amp

• Since it is an inverting op-amp, if the provided voltage going into Vin is positive, the output Vout would be negative because the voltage at terminal (-) is greater than voltage at terminal (+). Similarly Vout would be positive if the V(-) terminal was less than the voltage at the V(+) terminal.
• The Ideal results for out plot for this would be the output of [-5, 5]V instead of our           [-3.73, 4.5]V range.

b.) Apply 0V to the non-inverting input. Sweep the inverting input (Vin) from -5V to 5V with 1V steps. Take more steps around 0 V (both positive and negative). Create a table for Vin and Vout. Plot the data (Vout vs Vin). Discuss your results. What would be the ideal plot?

 Table 2: Inverting Op-Amp
 Figure 2: Plot of Vin vs. Vout for an Inverting Op-amp

• The Op-Amp's output will be equal to the V+ input if the Non-Inverting (+) input is greater than the Inverting Input (-).
• An Ideal Model for an Non-Inverting Op-amp circuit would see an output of +5V for any positive input, an output of 0 for a 0V input, and -5V for any Negative input.

2. Create a non-inverting amplifier. (R2 = 2 kΩ, R1 = 1 kΩ). Sweep Vin from -5V to 5V with 1V steps. Create a table for Vin and Vout. Plot the measured and calculated data together.

Calculated Data

 Table 1: Calculated data for Non-Inverting op-amp
 Figure 1: Plotted calculated data for Non-Inverting op-amp

Measured Data

 Table 2: Measured data for Non-Inverting op-amp
 Figure 2: Plotted measured data for Non-inverting op-amp

• The calculated gain for this Non-Inverting amplifier should have followed (1+R2/R1). We calculated that our constructed Non-Inverting amplifier would theoretically have a gain of about 3x the amount of voltage, surprisingly our measured Vout values exceeded our calculated ones for our (+1V and -1V) Vin inputs.

3. Create an inverting amplifier. (Rf = 2 kΩ, Rin = 1 kΩ). Sweep Vin from -5V to 5V with 1V steps. Create a table for Vin and Vout. Plot the measured and calculated data together.

Calculated Data

 Table 3: Calculated data for Inverting Op-amp
 Figure 3: Plotted calculated data for Inverting Op-amp

Measured Data

 Table 4: Measured data for Inverting Op-amp
 Figure 4: Plotted measured data for Inverting Op-amp

• The calculated gain for this Inverting amplifier should have followed 1*(R2/R1).  We calculated that our constructed Inverting amplifier would theoretically have a gain of about -2x the amount of voltage, surprisingly our measured Vout values once again exceeded our calculated ones but this time only for our (-1V, -2V) Vin inputs.

4. Explain how an OPAMP works. How is the gain of the OPAMP in the open loop configuration too high but inverting/non-inverting amplifier configurations provide such a small gain?

• The open loop configuration of the Op-amp does not actually act as an amplifier, but instead acts as a comparator. By definition a comparator: is a device for comparing a measurable property or thing with a reference or standard. If the positive(+) Non-Inverting input exceeds the negative(-) Inverting input, it's output is equal to whatever voltage is present on the V+ input. Conversely if the negative(-) Inverting input exceeds the positive(+) Non-Inverting input it's output is equal to whatever voltage is present on the V- input.
• However, if you connect a pair of resistors to the op-amp then it can act as an amplifier. There are two types of amplifier configurations (Inverting and Non-Inverting) the Inverting Amplifier has a gain of -1*(R2/R1), as for the Non-Inverting amplifier its gain will be 1+(R2/R1).

Temperature Sensor:

Put TMP36 temp sensor on breadboard. Connect the +VS to 5V and GND to ground.
Using a voltage meter, measure the output voltage from the Vout. Now put your finger (or cover the sensor with your palm) on the TMP36 temperature sensor for a while, observing how the output voltage changes. Check Fig. 6 in the data sheet (EXPLAIN).

• We attached fixed 5V to the TMP36 temperature sensor, and recorded the following data, displayed on (Table 1) below.
 Table 1: Temperature sensor voltage output, tested at various heats.

• Instead of just using the palms of our hands, we wanted to test various types of temperatures on the sensor, so we decided to make a data table for the different Vout outputs. There was no known discrete controls for the heat guns heat-output, plus temperatures can differ depending on the range its from the component. So we estimated that the temperature given off by the heat gun onto the board/sensor would be around 90℃ because the board was pretty warm but still touchable by the hand.

Relay:

1. Connect your DC power supply to pin 2 and ground pin 5. Set your power supply to 0V. Switch your multimeter to measure the resistance mode; use your multimeter to measure the resistance between pin 4 and pin 1. Do the same measurement between pin 3 and pin 1. Explain your findings (EXPLAIN).

• With a power supply is set to 0 V there is no resistance across pins (1 & 4), because the contacts across the relay remain open unless a certain amount of required voltage is provided. However, there is a measurable resistance across pins (1 & 3), of 1.5Ω, this is because voltages applied within the range of 0-5V are allowed to pass through the contacts.

2. Now sweep your DC power supply from 0V to 8V and back to 0V. What do you observe at the multi-meter (resistance measurements similar to #1)? Did you hear a clicking sound? How many times? What is the “threshold voltage values” that cause the “switching?” (EXPLAIN with a VIDEO).

Testing Voltage ranges on a relay.
• *Note that our relay was broken for all the videos containing it, we did our best to explain what would happen.*
• We didn't hear any clicking sounds, but we imagine it would a properly working 12V relay would have clicked twice.
• The threshold values are: [Min: 4.2V, Max: 6.3V]

3. How does the relay work? Apply a separate DC voltage of 5V to pin 1. Check the voltage value of pin 3 and pin 4 (each with respect to ground) while switching the relay (EXPLAIN with a VIDEO).

Explains how a relay works, with respect to ground.
• *Note that our relay was broken for all the videos containing it, we did our best to explain what would happen.*
• The clicking sound is the switch being triggered by pin 1's voltage surpassing the required amount, causing the switch to allow voltage to flow from pin 2 to pin 4, the 2nd click is the switch switching back to pin 3 because the minimum voltage is not being supplied to pin 1.

LED + Relay:

1. Connect positive end of the LED diode to the pin 3 of the relay and negative end to a 100Ω resistor. Ground the other end of the resistor. Negative end of the diode will be the shorter wire.

2. Apply 3V to pin 1.

3. Turn LED on/off by switching the relay. Explain your results in the video. Draw the circuit schematic (VIDEO)

 Photo: Schematic of the Relay has been triggered on and switched to supply 3V to the LED in the circuit.

Turning LED on/off using a relay.

• *Note that our relay was broken for all the videos containing it, we did our best to explain what would happen.*
• The relay would eventually switch around 5-6 volts, however it did not, so we just showed how the relay would work on pin 3.

Operational Amplifier (data sheet under Bb/week 6)
1. Connect the power supplies to the op-amp (+10V and 0V). Show the operation of LM124 operational amplifier in DC mode with a non-inverting amplifier configuration. Choose any Op-Amp in the IC. Method: Use several R1 and R2 configurations and change your input voltage (voltages between 0 and 10V) and record your output voltage. (EXPLAIN with a TABLE)
 Data Table: Non-Inverting Op-amp with different variables.

• In the data table above we decided to help best explain the gain, we would take into account the gain equation and show many of the different kinds. We used smaller R2 resistors than our R1 resistors. The data shows where the voltage threshold for Vout is.

2. Use your temperature sensor as your input. Do you think you can generate enough voltage to trigger the relay? (EXPLAIN)
• Yes, we believe we can generate enough voltage from the amplifier to get the relay to switch pins. We calculated the gain using the non-inverting op-amp equation, to best reach the our relays trigger voltage of about 6.4V. To do this we had to figure out which R2 and R1 configuration would get us as close as possible to our desired value.

3. Design a system where LED light turns on when you heat up the temperature sensor. (CIRCUIT schematic and explanation in a VIDEO)

 A drawing of our circuit

Video explaining what is going on in our circuit, based off of our drawing above.

4. BONUS! Show the operation of the entire circuit. (VIDEO)

Bonus video: Showing circuit operation

• *Note that almost every component that we originally got for this lab was broken or didn't work the way it should have.*