## Monday, March 27, 2017

### Week 11

Part A: Strain Gauges:

#### 1. Connect the oscilloscope probes to the strain gauge. Record the peak voltage values (positive and negative) by flipping/tapping the gauge with low and high pressure. Make sure to set the oscilloscope horizontal and vertical scales appropriately so you can read the values. DO NOT USE the measure tool of the oscilloscope. Adjust your oscilloscope so you can read the values from the screen. Fill out Table 1 and provide photos of the oscilloscope.

Flip Strength Data Table

Press Strength Data Table

#### 2. Press the “Single” button below the Autoscale button on the oscilloscope. This mode will allow you to capture a single change at the output. Adjust your time and amplitude scales so you have the best resolution for your signal when you flip/tap your strain gauge. Provide a photo of the oscilloscope graph.

Part B: Half Wave Rectifiers:

#### 3. Explain how you calculated the rms values. Do calculated and measured values match?

• For Input the rms values were calculated by dividing the peak to peak value on the function generator by the square root of 2. For output we divide the peak to peak in half then the resultant value by the square root of 2.

## Monday, March 20, 2017

### Week 10

#### 1. Open MATLAB. Open the editor and copy paste the following code. Name your code as FirstCode.mSave the resulting plot as a JPEG image and put it here.

 Figure 1: Graph of code given

#### 2. What does clear all do?

The clear all command clears the command terminal.

#### 3. What does close all do?

The close all command clears the workspace of all figures and the command terminal for a brand new workspace.

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

1 row, 5 columns.

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

The semicolon is used to end a command.

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

The error code means that in order to use the power (^) function, the object being taken to a power must be of a scalar value. The dot is used to signify a number as a scalar.

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

Line width affects the plot

#### 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’)

 Example graph to replicate.

 Our graph
plot(x, y, '-ro', 'LineWidth', 6, 'MarkerSize', 20);

#### 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 = 2.^x;

plot(x, y,':ks', 'LineWidth', 6, 'MarkerSize', 18);
grid
xlabel('Numbers', 'FontSize', 12)

ylabel('Results', 'FontSize', 12)

 Picture of graph represented by code above

#### Sin(30) = -0.9880 This is the value when calculations are being done in radians rather than degrees.c. How can you modify sin(30) so we get the correct number?

by typing sind(30), this makes the function calculate in degrees rather than 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;

t = linspace(0,0.126,10);

y = 10*(sin(100*t));
x = linspace(0,0.126,1000);
z = 10*(sin(100*x));
plot(t, y, '-ro',x, z, 'k' )
axis([0 .14 -10 10]);

xlabel('Time(S)')

ylabel('y function');

legend('Coarse', 'Fine');

 Example

 Our version

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

Every value of Z that was found to be greater than 5 was changed to 5.

#### 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;

t = linspace(0,0.126,10);

y = 10*(sin(100*t));
x = linspace(0,0.126,1000);
z = 10*(sin(100*x));
f = find(z>5);
z(f) = 5;
plot(t, y, '-ro',x, z, 'k' )
axis([0 .14 -10 10]);

xlabel('Time(S)')

ylabel('y function');

legend('Coarse', 'Fine');

 Our graph using find function

#### 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 filter table

#### 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 filter graph

>> clear all;

close all;

x = [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.1 1.2 1.3 1.4];

y = [3.7 3.68 3.6 3.5 3.38 3.26 3.12 2.98 2.85 2.85 2.72 2.6 2.47 2.37 2.26];

plot(x, y)

xlabel('Frequency(KHz)', 'FontSize', 12)

ylabel('Vout(rms)', 'FontSize', 12)
>>

#### 3. Calculate the cut off frequency using MATLAB. find command will be used. Provide your code.

Cutoff frequency between 1.1 and 1.4 Khz

clear all;

close all;

x = [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.1 1.2 1.3 1.4];

y = [0 3.7 3.68 3.6 3.5 3.38 3.26 3.12 2.98 2.85 2.72 2.6 2.47 2.37 2.26];

z = [0 1.05 1.04 1.02 .99 .96 .92 .88 .84 .81 .77 .74 .69 .67 .64];

plot(x, z, )

s = find(z == 0.70)

x(s)

#### 4. Put a horizontal dashed line on the previous plot that passes through the cutoff frequency.

 Low pass filter graph with cut off frequency shown

clear all;

close all;

x = [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.1 1.2 1.3 1.4];

y = [3.7 3.68 3.6 3.5 3.38 3.26 3.12 2.98 2.85 2.85 2.72 2.6 2.47 2.37 2.26];

z = [0 1.05 1.04 1.02 .99 .96 .92 .88 .84 .81 .77 .74 .69 .67 .64];

plot(x, z)

xlabel('Frequency(KHz)', 'FontSize', 12)

ylabel('Vout(rms)', 'FontSize', 12)
hold on;

x = [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.1 1.2 1.3 1.4];

z = .707

plot(x,z,'k+', 'LineWidth', 6)
xlabel('Frequency (kHz)', 'Fontsize', 12)
ylabel('Vout/Vin (V)', 'FontSize', 12)
hold off;

#### 1.  High pass filter table

clear all;

close all;

x = [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.1 1.2 1.3 1.4];

y = [0 .5 .7 1.05 1.35 1.63 1.86 1.97 2.03 2.11 2.14 2.16 2.17 2.17 2.18];

z = [0 .14 .19 .29 .37 .46 .52 .55 .57 .59 .6 .61 .61 .61 .62];

plot(x, z)

xlabel('Frequency(KHz)', 'FontSize', 12)

ylabel('Vout(rms)', 'FontSize', 12)
hold on;

x = [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.1 1.2 1.3 1.4];

z = .4

plot(x,z,'k+', 'LineWidth', 6)
xlabel('Frequency (kHz)', 'Fontsize', 12)
ylabel('Vout/Vin (V)', 'FontSize', 12)
hold off;

 High pass filter graph with cutoff frequency shown

## Monday, March 13, 2017

### week 9

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

• The speaker has a resistance of 9ohm
2. Build the following circuit using a function generator setting the amplitude to 5V (0V offset). What happens when you change the frequency? (video)
Figure 1: Video showing speaker function.
 Figure 2:Table displaying speaker functions at different frequencies.

#### Fill the following table. Discuss your results.

 Figure 3: Table showing differences with different resistors.

#### a. Explain the operation. (video)

Figure 4: Video showing high pass filter.

#### 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.

 Figure 5: Table displaying values for high pass filter.

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

 Figure 6: Graph of high pass filter Vout/Vin vs. Frequency

#### d. What is the cut off frequency by looking at the plot in b?

• The cutoff frequency occurs when the Vout/Vin ratio is 1/2 of the max Vout. In our case this occurred between 8 and 10 KHz.

#### e. Draw Vout/Vin with respect to frequency using MATLAB. Your code would look like this;

 Figure 7: Vout/Vin vs Frequency graph using MATLAB

#### f. Calculate the cut off frequency theoretically and compare with one that was found in c.

• The max theoretical cutoff frequency gives us a value of 9KHz. We got this value by taking half the max of Vout and finding when Vout/Vin is equal to it. The one we found in part c was between 8 and 10KHz, which is close to the theoretical value.

#### g. Explain how the circuit works as a high pass filter.

• Its a high pass filter because it allows high frequency signals and cuts off low frequency signals. This happens as a result of the capacitor's inductance being dependent on frequencies and its relationship when in series. The capacitor has high resistance to low frequencies and low resistance to high frequencies.

#### 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.

• The speaker is in parallel to the capacitor rather than in series.

#### a. Explain the operation. (video)

Figure 8: Video explaining low pass filter.

#### 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.

 Figure 9: Table displaying low pass filter values.

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

 Figure 10: Graph of low pass filter Vout/Vin vs Frequency.

#### d. What is the cut off frequency by looking at the plot in b?

• The cutoff frequency is 8KHz.

#### 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.

The video above explains the operation.

## Sunday, March 12, 2017

#### * Digital* Motor* Relay* Opamp* Temperature sensor* LED

• The circuit we prepared contains three different steps in order to make it work effectively. We used a temperature sensor in order to send an output. We realized the output sent by the temperature sensor was not high enough to activate the relay, so in order to make it work the temperature sensor was connected to a non-inverting opamp. This gave us a gain of 6 which is high enough for the relay to be activated. This same output was sent to our LED and Digital in order to let us know when the relay was activated.  Once we successfully triggered the relay a voltage of 6 volts was sent straight to our DC motor.

• Our Rube Goldberg consisted of a DC motor attached to a device similar to a crane. The DC motor is attached to a cup with a marble inside by a string which is consistently pulled up until it reaches a desired angle. Once it reaches that angle the ball falls through an opening in the cup making it go down the ramp and achieving the desired purpose.

#### Video of our Rube Goldberg with explanation:

Figure 1: video displaying how the rube goldberg circuit works.
 Figure 2: Picture of the circuit before the relay switches.

 Figure 3: Picture of the circuit after the relay is switched.

 Figure 4: Drawing of circuit.

• We had issues with time constraints which prevented us from having our digital display showing something other than the number 7, which is our group number. We had issues with time because our original circuit had a broken relay and 555 timer that took up a majority of the time on our first day, we then had to start over on wednesday which set us back. The only problem we faced after starting over again was the temperature sensor wasn't giving an output until we replaced it and the op-amp wasn't the correct one corresponding to the relay.

## Monday, February 20, 2017

#### 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)

 Figure 1: Table displaying force sensing resistor values
• The more pressure present on the sensor, less resistance will be applied.

#### 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).

Figure 2: Video displaying 7 segment display.

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

 Figure 3: Displaying a 0 with the 7 segment display.

 Figure 4: Displaying a 5 with the 7 segment display.

#### 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)

 Figure 5: Picture representation of circuit.

• In the circuit, the display driver was used to light up the LED to show that voltage was being given because it could not be measured with the DMM.
 Figure 6: Truth table for the 7447 display driver.

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)

Figure 7: Video showing how the 7447 display driver works.

#### 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)

 Figure 8: Picture representation of circuit.
 Figure 9: Output voltage of pin 3 of circuit in figure 8.

#### Based on the calculations we acquired, the frequency and duty cycle are accurate. We found this by using the equations below, which are dependent on Ra, Rb and the capacitor. Figure 10: Equations used to calculate frequency and duty cycle. 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)

Figure 11: Video showing how the force sensing resistor works.

#### 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)

Figure 12: Video explaining how the 555 timer works in combination with the 74192.
Figure 12:Data Table

#### 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)

Figure 13: Video showing the XOR operation with the LED.

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

Figure 14: Video explaining the XOR outputs vs inputs.

#### 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)

 Figure 15: Signals for 555 timer, A,B,C and D outputs of 74192 and XOR output.
Figure 16: Video explaining output signals.

#### 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)

Figure 17: Video showing entire circuit functioning.
 Figure 18: Picture of entire circuit.

## Monday, February 13, 2017

### Week 6

#### a. Apply 0 V to the inverting input. Sweep the non-inverting input (Vin) from -5 V to 5 V with 1 V 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?

 Figure 1: Table displaying Vin vs. Vout for non-inverting amplifier. The graph shows the change in values for Vout. Due to the amplifier being non inverting, the Vout was the same sign as Vin. The output was also amplified as shown until reaching a certain Vin where a max Vout is reached and it becomes constant (-4.2 and 4.52). The ideal plot would be 0 output at 0 and then the exact measurement for gain.

#### b. Apply 0 V to the non-inverting input. Sweep the inverting input (Vin) from -5 V to 5 V with 1 V 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?

 Figure 2: Table displaying Vin vs. Vout for inverting amplifier. The graph shows the change in values for Vout. As expected, due to the amplifier being inverting the Vout values were the opposite sign as Vin. The output was also amplified just as the non-inverting was, once it reached a max Vout, the amplification became constant at (4.52  and -4.2). The ideal plot would be 0 output at 0 and then the exact measurement for gain.

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

 Figure 3: Table displaying Vin vs. Vout for the non-inverting amplifier. Graph  Vout for the non-inverting amplifier

#### For the non inverting amplifier the gain was 3. This can be seen when Vin is 1V but then Vout reaches its max at (4.27 or -3.56). 3. Create an inverting amplifier. (Rf = 2 kΩ, Rin = 1 kΩ). Sweep Vin from -5 V to 5 V with 1 V steps. Create a table for Vin and Vout. Plot the measured and calculated data together.

 Figure 4: Table displaying Vin vs. Vout for inverting amplifier. Graph for Vout.
• For the inverting amplifier the gain was 2 as shown when Vin is 1V. After this, Vout reaches its max at (4.21 or -3.5).

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

An OPAMP takes an input signal and amplifies it and can also invert the polarity of the signal if the OPAMP is set in inverting configuration. However, the output signal can not be higher than the values put into V+ and V-. When the OPAMP is in open loop configuration there are no resistors to implement a low enough gain and therefore the gain is very high and often reaches higher than V+ or V- very easily.

TEMPERATURE CONTROLLED LED SYSTEM

#### 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)

• Between pin 4 and pin 1 we measured a resistance of 2 Ohms. And the resistance between pin 3 and 1 gave us an overload because pin 3 wasn't connected to the circuit due to Vin being less than Vthreshold.

#### 2. Now sweep your DC power supply from 0V to 8V and back to 0V. What do you observe at the multimeter (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)

Figure 5: Video explaining the circuit.

#### 3. How does the relay work? Apply a separate DC voltage of 5 V 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).

Figure 6: Video explaining how a relay works.

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

 Figure 7: Picture representation of the circuit.
Figure 8: Video showing how the relay circuit works.

#### 1. Connect the power supplies to the op-amp (+10V and 0V). Show the operation of LM 124 operational amplifier in DC mode with a non-inverting amplifier configuration. Choose any opamp 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)

 Figure 9: Table displaying Vin vs. Vout.
 Figure 10: Table displaying Vin vs. Vout.

 Figure 11:  Table displaying Vin vs. Vout.