Monday, March 27, 2017

Week 11

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
Flipping Strength
Minimum Voltage
Maximum Voltage
Low
.6 V pk-pk
1.4 V pk-pk
High
1.32 V pk-pk
3.54V Pk-pk

Table 2: Buzzer gauge characteristics
TappingStrength
Minimum Voltage
Maximum Voltage
Low
2.4 V
2.8 V
High
5 V
6.2 V
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.


Schematic of the Half Wave rectifer

PICTURE----------Mary------------
2. Calculate the effective voltage of the input and output and compare the values with the measured ones by completing the following table.

Table 3: Showing the RMS values calculated and measured
RMS Values
Calculated
Measured
Input
3.53 V 
3.6 V 
Output
3.53 V 
2.07 V 

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

To measure the RMS value you take the appropriate voltage, in this case 10 V. Then you divide it by square root 2.
4. Construct the following circuit and record the output voltage using both DMM and the oscilloscope.
Table 4: Showing the varying output voltages obtained through different measuring mediums with 1uF

Oscilloscope
DMM
Output Voltage (p-p)
5.4 V
1.47 V
Output Voltage (mean)
5.5 V
5.77 V

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

Table 5: Showing the varying output voltages obtained through different measuring mediums with 100uF

Oscilloscope
DMM
Output Voltage (p-p)
.16 V
.02 V
Output Voltage (mean)
6.83 V
6.75 V

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:

Table 6:
Tap Frequency
Duration
Output Voltages
1 flip/second
10 Seconds
 .26 V
1 flip/second
20 Seconds
 .43 V
1 flip/second
30 Seconds
 .4 V
4 flips/second
10 Seconds
 .44 V
4 flips/second
20 Seconds
 .506 V
4 flips/second
30 Seconds
 .514 V

2. Briefly explain your results.

The longer we flipped the stress the gauge the more the capacitor was being charged. Therefore, the DMM was reading higher values. The same is also true for when we flipped it 4 times a second. The flips generate a voltage, and the capacitor stores the voltage, while simultaneously draining. The more frequent the flips for a longer duration will produce an overall higher voltage.

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?

The output would be smaller because there isn’t a big rush of electricity flowing through the circuit. The diode we used in the circuit was meant to mimic a half-wave rectifier. We see that when we view our sin waves because there is no negative part this is because of the diode. When the diode is taken out there will have negative values since there is no half-wave rectifier being applied to the circuit.

4. Write a MATLAB code to plot the date in table of Part C1.

*Code we used to get the Half-Wave Rectifier Graph*

x=[10 10 20 20 30 30];
y=[.26 .44 .43 .506 .4 .514];
plot(x,y)
xlabel('Time (seconds)');
ylabel('Vout (V)');

grid on

Half-Wave Rectifier Graph






Monday, March 20, 2017

Blog Week 10

Blog Week 10

1. Open MATLAB. Open the editor and copy paste the following code. Name your code as FirstCode.m
Graph created by the code given in the blogsheet

2. What does clear all do?
~~~~ Clears all predefined variables

3. What does close all do?
~~~~Closes all open windows such as graphs.

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 and zero columns

5. Why is there a semicolon at the end of the line of x and y?
~~~~ the semicolon prevents the data from being displayed after "ENTER" is hit.

6. Remove the dot on the y = 2.^x; line and execute the code again. What does the error message mean?
~~~~The dot is needed so that the operation can be applied to each of the values in the matrix

7. How does the LineWidth affect the plot? Explain.
~~~~ It affects the width of line. Smaller integers result in a more narrow line segment.

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,'LineWidth',6,'LineSpec',-or)

9. What happens if you change the line for x to x = [1; 2; 3; 4; 5]; ? Explain.
~~~~ It turns into a single column matrix starting at 1 and ending at 5

10. Provide the code for the following figure. You need to figure out the function for y. Notice there are grids on the plot.

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

GridLineStyle ':'

11. Degree vs. radian in MATLAB:
a. Calculate sinus of 30 degrees using a calculator or internet.
Sin(30)= 1/2
b. Type sin(30) in the command line of the MATLAB. Why is this number different? (Hint: MATLAB treats angles as radians).
By default MatLab uses radians

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

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:

t=linspace(0,.125664,10);
y=10*sin(100*t);
plot(t,y,'-or')
hold on
clear t
t=linspace(0,.125664,1000);
y=10*sin(100*t);
plot(t,y,'k')
xlabel('Time (s)')
ylabel('y function')
legend('Coarse','Fine')

13. Explain what is changed in the following plot comparing to the previous one.
~~ The FINE graph has a limit set so that its max value is capped at 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.

t=linspace(0,.125664,10);
y=10*sin(100*t);
plot(t,y,'-or')
hold on
clear t
t=linspace(0,.125664,1000);
y=10*sin(100*t);
k=find(y>5);
y(k)=5;
plot(t,y,'k')
xlabel('Time (s)')
ylabel('y function')


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.

~~We need a 7.5k resistor to achieve a cutoff frequency of approximately 1kHz

Table created from the frequency and the associated output in a low pass circuit

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.
Graph created from the table above. The code used is provided below

****CODE*****
x=[.1 .2 .3 .4 .5 .6 .7 .8 .9 1 2 3];
y=[3.655 3.603 3.525 3.424 3.3 3.177 3.04 2.904 2.767 2.6 1.62 1.07];
plot(x,y)
xlabel('Freqency (KHz)');
ylabel('Vout (V)');
grid on

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

R=7500; C=22*10^-9;
Cutoff=1/(2*pi*C*R)
----------------------> 964.5754 Hz

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

Graph with dashed line across the cutoff point. This graph is identical to the graph above


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

a)Table for high pass filter

Table created by frequency and the associated output of a  high pass filter circuit


b)Graph for a high pass filter
Graph created from the table above. The code used is provided below

***CODE***
%%
x=[.1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.5 2 2.5 3];
y=[.35 .687 1.007 1.303 1.572 1.811 2.02 2.203 2.361 2.495 2.912 3.063 3.082 3.034];
plot(x,y)
xlabel('Freqency (KHz)');
ylabel('Vout (V)');
grid on

c)Calculate Cutoff of high pass filter

R=7500; C=22*10^-9;
Cutoff=1/(2*pi*C*R)
----------------------> 964.5754 Hz

~~This cutoff is the same for both low pass and high pass filter.

Monday, March 13, 2017

Blog week 9

Blog Week 9

1. Measure the resistance of the speaker. Compare this value with the value you would find online.
~~Our speaker: 9 ohms
~~Online speaker: 6 to 7 ohms (for an 8 ohm speaker)

2. Build the following circuit using a function generator setting the amplitude to 5V (0V offset). What happens when you change the frequency? (video)
Frequency
Observation
1 Khz
Moderate tone (pitch)
3 Khz
Moderate-high tone (pitch)
5 Khz
High tone (pitch)
7 Khz
Higher tone (pitch)
9 Khz
Loud squeal



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.

Resistor value
Oscilloscope output
Observation
47 Ω
.49 V (Peak to Peak)
.3 V
820 Ω
.992 V (Peak to Peak)
.002 V
~~ The observations that we saw during this segment was that the frequency was constant throughout the segment. The voltage and Peak to Peak values were the only varying measurements. The output of the 47 ohm was barely audible however the output of the 820 ohm speaker was not audible to us, as group members.

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.

Picture obtained from Dr. Kaya's blogsheet
a. Explain the operation. (video)
~~
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.

c. Draw Vout/Vin with respect to frequency using Excel.
d. What is the cut off frequency by looking at the plot in b?
    The filter starts attenuating around 9 kHz, which seems to be our cutoff frequency.


Table and a graph of the measurements obtained during the High Pass filter testing. It shows the Vout/Vin (RMS) on the y-axis and the frequency in kHz on the x-axis.



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


Graph using MatLab where Frequency is in Kilo Hertz and Vout/Vin is in Volts
f. Calculate the cut off frequency theoretically and compare with one that was found in c.
R=100; C=22*10^-9;
LH=1/(2*pi*R*C)~~~~~~~~~~~~~~~~~ 7.2343*10^4 Hz
This differs from the what the cutoff frequency appears to be on our graph (9 kHz), we believe this is because the value calculated is just theoretical, and doesn't have very much merit on our real life circuit. It is odd that it is such a big discrepancy though.

g. Explain how the circuit works as a high pass filter.
~~A high pass filter decreases the ability for low frequency tones to pass through easily and high frequency tones go through much easier.

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 would go in parallel with the resistor and the capacitor.

~a. Explain the operation. (video)

~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.
~c. Draw Vout/Vin with respect to frequency using Excel.

~d. What is the cut off frequency by looking at the plot in b?
~~ Approximately 2KHz
~e. Draw Vout/Vin with respect to frequency using MATLAB. Your code would look like this;

~f. Calculate the cut off frequency theoretically and compare with one that was found in c.
R=100; C=22*10^-9;
LH=1/(2*pi*R*C)~~~~~~~~~~~~~~~~~ 7.2343*10^4 Hz

~g. Explain how the circuit works as a Low pass filter.
~~A low pass filter decreases the ability for high frequency tones to pass through easily and low frequency tones go through much easier.

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.















Saturday, March 11, 2017

Blog Week 8


Blog Week 8

Schematic drawing of the Rube Goldberg circuit (an explanation of each part of the circuit will be written below in the following pictures)

555 Timer with 1.3M ohms of resistance. The Output of the 555 is sent to the 74192 counter. We can alter the speed at which pulses are created by using more resistance.
The 74192 receives the input from the 555 and converts the pulses that are generated into binary numbers
The binary numbers are sent to the 7447 which converts the numbers from binary to actual numbers. These numbers are displayed on the 7 segment display
The 7 segment display will display the number that is being received. In example, for the above number "5" the 7447 is receiving 0101 from the 74192 which is binary for "5." Which means that it is the 5th pulse received by the 74192. 
I alter the circuit so that when 9 is displayed an LED turns on. This was accomplished by using an AND gate attached to the 7447. The AND gate is looking for two 1's before it was release an output. Using 9 as the goal number we can use the input pins D and A to obtain the goal. I also ran a diode from the AND gate's output to pin 2 of the 555. This prevents the 555 from continuing to count after 9 is obtained.
The AND gate's steady output is sent to a heat sensor and an OP AMP. The OP AMP is required in order to cause the relay to work. The Output of the relay is connect to a DC motor.
The DC motor then spins, and the wire at the end of it acts as a "blade" like as seen in a mixer.

Here is a video of the entire circuit with a commentated explanation 

TWO ISSUES:

The first issue I had in this lab was figuring out a way to make the circuit stop at a given number. I tried a few ideas. doing a little experimenting I noticed that if I ran an input into the comparator pin of the 555 it caused the circuit to stop counting. This gave me the idea to use the output of the AND gate to make it stop at 9. I used a diode to prevent back flow. Without the diode, the circuit just stops counting at whatever number it starts out on.

The second issue I had was a very simple solution. I needed to prolong the circuit long enough to reach the time requirement. I had to play around with the resistance of the 555 timer in order to make the circuit last much longer.

Monday, February 20, 2017

Blog 7

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

Force
Measured Resistance
Light touch
23k ohms
Firm touch
2.4k ohms
Hard touch
1.08k ohms
Hard press
282 ohms
~~The harder we pressed the sensor the less amount of resistance it has. However, without being touch it reads that it has a resistance value of 0 ohms. The maximum level or resistance achieved was 335k to 1.3M ohms. This is a huge range, this is likely do to the DMM reading the resistance as pressure is being taken off of it.

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). 
~~ When we connected power to pin 3 and a 330 ohm to pin one the upper segment of the 7 segment display lit up.

Video showing how each of the seven segments can be powered in 7 segment display


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

Fig 1: Picture of a 5 being displayed on a 7-segment display

Fig 2: Picture of a 0 being displayed on a7-segment display
~~The number that gets displayed is dependent on which pins are powered. There are 14 pins and 8 of those pins are used to power LED inside the 7-segment display. A combination of the correct pins can be used to display a number of choice.

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)
Displaying 20170222_084101.jpg
Input combination 1: This corresponds to the number '8' because the D input is the only high voltage input the rest are grounded. All the of the output pins light up the LED.
Displaying 20170222_083942.jpg
Input combination 2: This corresponds to the number '1' because the A input is the only high voltage input the rest are grounded. Only the b and c output pins light up the LED.
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



555 Timer

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

Fig 3: Picture of the breadboard of the 555 timer which is hooked up to the oscilloscope


Fig 4: Picture of the oscilloscopes readings that were obtained from the circuit featured in Fig 3.
~~ From this picture (Fig 4) we can see that the 555 timer is generating a pulse. In terms of the graph, the circuit is outputting an actual signal, so "on" during the upper section of the pulse. While on the lower part of the graph the 555 is not outputting a signal, so it in an "off" state.

~~ We can also see from Fig 4 that the 555 timer is on for slightly longer than it is off.

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

~~The measured frequency and the measured duty cycle are as follow: 1.74Hz and the duty cycle is ON for 56.5% of the time, OFF for 43.4% today.

~~I obtained the numbers by using the oscilliscope. Each box being 500ms. It shows that the system is 'off' for 500ms and On for 1.3 boxes or about 650ms.

~~The frequency is obtain by the equation F=1/T, where T is the period. We know it takes 1.15 seconds for a two periods to occur. So... F= 1/(1.15*.5) 1.74 Hz

~~ The theorectical values should be 50% on and off for the duty cycle. So no we do not match the theoretical values. However, we are very close.

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 showing how a pressure sensor can be used with a 555 timer

74192

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


Count
D
C
B
A
0
0
0
0
0
1
0
0
0
1
2
0
0
1
0
3
0
0
1
1
4
0
1
0
0
5
0
1
0
1
6
0
1
1
0
7
0
1
1
1
8
1
0
0
0
9
1
0
0
1

~~Here we have a truth table for the 74192 IC. Depending on what output pins you are reading you will observe a different count. For example, if you are reading an output from pin A and B you will get a count of 3. This is viewed by the oscilloscope as a faster frequency than a count of a lesser value.

Frequency of 9 (count) > 1 (count)

Video showing the different frequencies achieved by various outputs of the 74192


7486 XOR gate


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 showing the properties of an XOR gate


~b. Connect XOR’s inputs to the BCD counters C and D outputs. Explain your observation. (EXPLAIN with VIDEO)
Video showing how the 17492 can be used with a XOR gate


~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 showing the relationship between the different output frequencies


Connect


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 of the completed circuit with everything connected together

Fig 5: Picture of the entire circuit

Fig 6: Picture of the breadboard featured on the right in FIG 5

Fig 7: Picture of the breadboard featured on the left in FIG 5

Fig 8: Schematic of the above circuit.




OR Gate

8. Using other logic gates provided (AND and OR), come up with a different LED lighting scheme. (EXPLAIN with VIDEO)
Video showing how an OR gate be used in series with the XOR gate to turn on an LED. 

(an AND gate would have worked as well just would have need to signals to the input pins as apposed to 1 or 2 for the OR gate.)