Monday, March 27, 2017

Blog 11 group 1

Part A: Strain Gauges:
Strain gauges are used to measure the strain or stress levels on the materials. Alternatively, pressure on the strain gauge causes a generated voltage and it can be used as an energy harvester. You will be given either the flapping or tapping type gauge. When you test the circle buzzer type gauge, you will lay it flat on the table and tap on it. If it is the long rectangle one, you will flap the piece to generate voltage.
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.

Table 1: Strain gauge characteristics

Low:
 Minimum voltage:-2V
Maximum voltage:3V

High:
Minimum voltage:-40V
Maximum voltage:45V
Image 1: Shows the output of the strain gauge
Image 2: Shows the output of the strain gauge
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.
Image 3:  Shows the use of the "single" button

Part B: Half-Wave Rectifiers
1. Construct the following half-wave rectifier. Measure the input and the output using the oscilloscope and provide a snapshot of the outputs.
Image 4: shows the output of the halfway rectifier 

2. Calculate the effective voltage of the input and output and compare the values with the measured ones by completing the following table.
Effect (rms) Values       Calculated     Measured
                                           3.535                  Input 3.72
                                        2.5                     Output 2.15


3. Explain how you calculated the rms values. Do calculated and measured values match?
(Come back)

4. Construct the following circuit and record the output voltage using both DMM and the oscilloscope.

Column1 Oscilloscope DMM
Output Voltage (p-p) 2.4 1.848
Output Voltage (mean) 2.84 2.79
Table 1: Shows the output voltages using the different devices

5. Replace the 1 µF capacitor with 100 µF and repeat the previous step. What has changed?

Column1 Oscilloscope DMM
Output Voltage (p-p) 120 mV 62.2 mV
Output Voltage (mean) 3.27 3.22
Table 2: Shows the output voltages for thee 100uf capacitor

Part C: Energy Harvesters
1. Construct the half-wave rectifier circuit without the resistor but with the 1 µF capacitor. Instead of the function generator, use the strain gauge. Discharge the capacitor every time you start a new measurement. Flip/tap your strain gauge and observe the output voltage. Fill out the table below:

Tap frequency Duration Output Voltage
1 flip/second 10 seconds 617 mV
1 flip/second 20 seconds 1.37
1 flip/second 30 seconds 3.07
4 flip/second 10 seconds 3.29
4 flip/second 20 seconds  4.84
4 flip/second 30 seconds 8.8
Table 3: Shows the output for flips per second

2. Briefly explain your results.
As the flips increased in speed and in a longer duration, the voltage all increased from there, the faster you tap for the longer amount of time will give you higher outputs. 

3. If we do not use the diode in the circuit (i.e. using only strain gauge to charge the capacitor), what would you observe at the output? Why?
If we didn't use a diode, the circuit would not work because the capacitor would immediately discharge and there would be no built up charge.  

4. Write a MATLAB code to plot the date in table of Part C1.
D=[10,20,30];
Va=[0.617,1.37,3.07];
Vb=[3.29,4.84,8.8];
plot(D,Va,'--r')
hold on
plot(D,Vb)
legend('1 flip/second','4 flip/second')
xlabel('Duration (s)')
ylabel('Output Voltage (V)')
title('Half-wave recitifier')


















Wednesday, March 22, 2017

Blog 10 group 1


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.
Graph 1: Shows the plot of the code

2. What does clear all do?
It clears all the variables in the work space.

3. What does close all do?
It closes all the figures that are open.

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

5. Why is there a semicolon at the end of the line of x and y?
It supresess the output so that it does not appear in the command window and therefore helps not clutter up the command window

6. Remove the dot on the y = 2.^x; line and execute the code again. What does the error message mean?
The dot is required whenever doing an operation to an input that is a matrix because the multiplication must be applied to each individual number in the array.

7. How does the LineWidth affect the plot? Explain.
It increases or decreases the width of the line in the plot which is helpful when adjusting the precision of the graph based on the range.

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’)
plot(x,y,'r-o','markersize',10,'linewidth',4)


9. What happens if you change the line for x to x = [1; 2; 3; 4; 5]; ? Explain.
Nothing changes it workes exactly the same way because it is changing the matrix into a 5x1 matrix with 5 rows and 1 column.

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,'k:s','markersize',12,'linewidth',4)
grid ON
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)

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).
Matlab outputs that sin(30) is -0.9880 because matlab treats the number inside the parenthesis as radians as opposed to degrees.

c. How can you modify sin(30) so we get the correct number?
You change the function to "sind(30)" and then get an output of 0.5

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;
t1=[0:pi/25000:pi/25];
y=10*sin(100.*t1);
t2=[0:pi/250:pi/25];
z=10*sin(100.*t2);
plot(t1,y,'k',t2,z,'r-o')
axis([0 .14 -10 10])
xlabel('Time (s)', 'FontSize', 12)
ylabel('y function', 'FontSize',12)
legend('fine','coarse','location','NorthEast')

Graph 2:  Shows the two plotted points from the code

13. Explain what is changed in the following plot comparing to the previous one.
The only thing that is different is that the "fine" plot has a cut-off point that the other didn't have at y=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;
t1=[0:pi/25000:pi/25];
y=10*sin(100.*t1);
a=find(y<5)
t2=[0:pi/250:pi/25];
z=10*sin(100.*t2);
plot(t2,z,'r-o',t1(a),y(a),'k')
axis([0 .14 -10 10])
xlabel('Time (s)', 'FontSize', 12)
ylabel('y function', 'FontSize',12)
legend('fine','coarse','location','NorthEast')

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.
Frequency(Hz): Vout: (pk-pk)
500 9.68
600 9.36
700 9.04
800 8.8
900 8.48
1000 8.24
1100 7.92
1200 7.6
1300 7.36
1400 7.04
1500 6.80
1600 6.56
1700 6.4
2000 5.76
2200 5.44
Table 1: Shows frequency and Vout of the low pass filter

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.

f=[500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,2000,2200];
v=[9.68,9.36,9.04,8.8,8.48,8.24,7.92,7.6,7.36,7.04,6.80,6.56,6.4,5.76,5.44];
plot(f,v)
axis([400 2200 5 10])
xlabel('Frequency (f)', 'FontSize', 12)
ylabel('Vout', 'FontSize',12)
title('Low pass filter')


Graph 3: Shows the low pass filters outputs

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

f=[500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,2000,2200];
v=[9.68,9.36,9.04,8.8,8.48,8.24,7.92,7.6,7.36,7.04,6.80,6.56,6.4,5.76,5.44];
vin=10
a=find(v<7.07)
plot(f(a),v(a))
axis([400 2200 5 10])
xlabel('Frequency (f)', 'FontSize', 12)
ylabel('Vout', 'FontSize',12)
title('Low pass filter')

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

Graph 4: Shows the low pass filters outputs at the cut off frequency

5. Repeat 1-3 by modifying the circuit to a high pass filter.

A.
Frequency(Hz) Vout: (pk tp pk)
500 4.16
600 4.8
700 5.44
800 6.08
900 6.56
1000 7.01
1100 7.44
1200 7.84
1300 8
1400 8.56
1500 8.8
1600 9.04
1700 9.28
2000 9.92
2.2 10.2
3000 11
4000 11.7
5000 11.9
Table 2: Shows frequency and Vout for the high pass filter
B. 
  
Graph 5: Shows the high pass filters data plotted

f=[500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,2000,2200,3000,4000,5000];
v=[4.16,4.8,5.44,6.08,6.56,7.01,7.44,7.84,8,8.56,8.8,9.04,9.28,9.92,10.2,11,11.7,11.9];
plot(f,v)
axis ([500 5000 4 12])
xlabel('Frequency (f)', 'FontSize', 12)
ylabel('Vout', 'FontSize',12)
title('High pass filter')

C.
Graph 6: Shows the cut off frequency for the high pass filter











Friday, March 17, 2017

Blog 9 Group 1

1. Measure the resistance of the speaker. Compare this value with the value you would find online.
Measured Resistance: 8.5 ohms
Theoretical Resistance: 8 ohms

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:  The video shows how the frequency changes the pitch of the speaker.

Frequency Observation
1 kHz lower tone
2 kHz Slightly higher pitch
3 kHz Even higher pitch
4 kHz Even more higher pitch
5 kHz Highest pitch yet
15 kHz Pitch becomes to high and cant hear a tone
Table 1: Shows how the frequency effects the speaker
As you increase the frequency values, the tone/pitch of the speaker increases.

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.
When changing the different resistors, it changed how loud the speakers output was.  With the 820 ohm resistor it causes the tone to be barely heard. When the 47 ohm resistor is used the tone is a lot louder than when the other higher resistance resistor is used. 

Resistor Value (Ω) Oscilloscope Output Observation
47 896 mV Louder tone
820 142 mV Quiet tone
Table 2: Shows the different outputs with different resistors

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: Shows how changing the frequency changes the tone with a capacitor 

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.

Frequency (kHz) Vout (rms) Vout(rms)/ Vin(rms) 
1 0.006 0.00106
2 0.009 0.00159
3 0.013 0.00229
4 0.015 0.00265
5 0.017 0.003
6 0.018 0.00318
7 0.018 0.00318
8 0.018 0.00318
9 0.018 0.00318
10 0.018 0.00318
Table 3:  shows the Vout of the high pass filter

c. Draw Vout/Vin with respect to frequency using Excel.
Graph 1: Shows the Vout/Vin for the high pass filter

d. What is the cut off frequency by looking at the plot in b?
The cut off frequency that we obtained is right around 3 kHz because that is where the slope of the graph changes its concavity.

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

Plot 1: Highpass filter plot with matlab
f. Calculate the cut off frequency theoretically and compare with one that was found in c.
Our calculated value ended up being slightly less than 3 kHz.

g. Explain how the circuit works as a high pass filter.
The circuit works as a high pass because lower frequency's are not allowed to pass, once we get around the 3 kHz range, that is when the circuit passes the frequency and allows it to do what it needs to do. 

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: Shows how the Low Pass filter changes the output voltages

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.
Frequency Vout (V) Vout/Vin (V)
1 0.368 0.065
3 0.296 0.0523
5 0.238 0.042
7 0.19 0.033
9 0.154 0.0272
11 0.126 0.0222
13 0.105 0.01856
15 0.087 0.0153
17 0.072 0.0127
19 0.06 0.0106
21 0.049 0.0086
Table 4: Shows the data for the Low pass filter

c. Draw Vout/Vin with respect to frequency using Excel.
Graph 2: Shows the relationship between Vout/Vin for a low pass filter

d. What is the cut off frequency by looking at the plot in b?
By looking at the plot, the cut-off frequency is around 7 kHz.

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

Plot 2: Lowpass filter plot with matlab

f. Calculate the cut off frequency theoretically and compare with one that was found in c.
Calculated to around 7 kHz

g. Explain how the circuit works as a low pass filter.
This circuit works as a low pass filter because it allows all the lower frequencies to pass through, but as you get a higher voltage the voltages begins to plain out at the cut off point.


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: Shows how the headphone jack works with the microphone