Monday, February 22, 2016

Lab 7

Blogsheet 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)
Fig 1.



Resistance (Ω)
Object
4.6k
Coffee mug on edge
12.2k
Keys
2k
Index finger resting
208.6
Index finger pressing
78.3
Thumb pressing
      
We use various objects and pressures of fingers against the sensor.  As you can see the more pressure that is placed against the sensor the less resistance we get.



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


A video showing us connecting inputs to different segments of the 7 segment display.


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

A picture showing the 7 segment display with 0 displayed.


A picture showing the 7 segment display with 5 displayed.
When using the 7 segment display, you can display whichever number you want between 0 and 9 by manipulating the pins that the resistors connect to.  To light up a segment you connect the resistor to that segments pin and then to 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)
For example if we wanted to display the numbers 0, 4, or 5 these would be the inputs for the display driver:
Desired inputs for 0, 4, or 5.
This is the truth table that relates the inputs of the 7447 to the outputs which would be connected to the 7 segment display
Truth table for the Display Driver



The output to the LED in this picture is 0.

The output to the LED in this picture is 1.

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)
A video showing us getting different results with different inputs.


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)


A picture showing our breadboard setup of the 555 timer.



A picture showing the output of pin 3 by the 555 timer.


b.      Does your frequency and duty cycle match with the theoretical value? Explain your work.
Our theoretical is frequency is 1.92 Hz and the theoretical duty cycle is 0.4.  As you can find from our oscilloscope picture in the previous part, the frequency we measured is 1.62 Hz and the duty cycle was around 0.4.

Duty Cycle calculation

Frequency calculation

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)
A video showing our force sensing resistor giving an output while connected to the 555 time.  Varying pressures give different frequencies.

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)

A video showing the output of the counter on the oscilloscope.




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)
A video showing the operation of the XOR gate.




b.      Connect XOR’s inputs to the BCD counters C and D outputs. Explain your observation. (EXPLAIN with VIDEO)
A video showing the output of the C and D outputs connected to the 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)


The 555 timer, A, B, C, and D outputs of 74192, and the XOR output signals drawn together.



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)

A picture of our entire circuit.

A drawing of our circuit schematic.
A video showing the operation of our entire circuit


8.       Using other logic gates provided (AND and OR), come up with a different LED lighting scheme. (EXPLAIN with VIDEO)
A video showing the operation of our entire circuit with an added output.





Monday, February 15, 2016

Lab 6




Operational Amplifiers

Explanations of the pin numbers below:

1: DO NOT USE
8: DO NOT USE
2: Negative input
7: +10V
3: Positive input
6: output
4: -10 V
5: DO NOT USE

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 0 V to the inverting input. Sweep the non-inverting input (Vin) from -10 V to 10 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?


Below is a plot of our measured data.

Vin (V)
Vout (V)
-5.03
4.49
-4.05
4.49
-3.04
4.49
-2.01
4.49
-1.05
4.49
-0.25
4.49
-0.098
4.49
0
4.49
0.097
-3.74
0.257
-3.74
1.05
-3.74
2.06
-3.74
3.05
-3.74
4.03
-3.74
5.01
-3.74


A plot of our Vin vs Vout data.  Vin is the X-Axis and Vout is the Y-Axis.



For every negative we measured either -3.74 V or -3.73 V as the output regardless of the input, and for every positive voltage we measured 4.49 V for the output.  Since the change from positive to negative is nearly instantaneous it makes sense that we were unable to measure the instant it changed with the equipment we have.  Even at 0 V, with the input connected to ground and with the input not grounded we still measured 4.49 V as the output.


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

Below is a plot of our measured values.

Vin (V)
Vout (V)
-5
-3.74
-4.04
-3.74
-3.02
-3.74
-2.01
-3.73
-1.03
-3.73
-0.764
-3.73
-0.531
-3.73
-0.25
-3.73
-0.104
-3.73
-0.097
-3.73
0
4.49
0.097
4.49
0.594
4.49
1.04
4.49
2.06
4.49
3.07
4.49
4.04
4.49
5.04
4.49

A plot of our Vin versus Vout data.  Vin is the X-Axis and Vout is the Y-Axis


For every negative value of input, we measured 4.49V as the output, even at 0 V (with the input connected to ground and with the input ungrounded) we got 4.49 V as the output.  For every positive value of input we measured -3.74 V as the output.  Again this makes sense because the moment of change is nearly instantaneous we can't measure it with out equipment. 

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

Vin (V)
Vout (V)
-5.01
-3.63
-4.03
-3.63
-3.02
-3.63
-2.02
-3.63
-1.02
-3.03
-0.74
-2.21
-0.47
-1.38
-0.098
-0.292
0
0.0001
0.098
0.294
0.36
1.05
0.77
2.3
1.03
3.05
2.1
4.25
3.09
4.25
4.12
4.25
5.07
4.25
This is a chart showing our measured values

Vin
Vout
-5.01
-5
-4.03
-5
-3.02
-5
-2.02
-5
-1.02
-3.06
-0.74
-2.22
-0.47
-1.41
-0.098
-0.294
0
0
0.098
0.294
0.36
1.08
0.77
2.31
1.03
3.09
2.1
5
3.09
5
4.12
5
5.07
5
This is a chart showing our calculated values

This is a graph showing our measured (blue) vs calculated (orange) values.  Vin is the X-Axis and Vout is the Y-Axis

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

Vin (V)
Vout (V)
-5.03
4.18
-4.07
4.19
-3.04
4.2
-2.05
4.1
-1.05
2.09
-0.63
1.25
-0.22
0.42
-0.098
0.197
0
0.0001
0.098
-0.194
0.252
-0.5
0.763
-1.51
1.07
-2.13
2.01
-3.58
3.03
-3.56
4.04
-3.54
5.02
-3.52
A chart showing our measured values
Vin
Vout
-5.03
5
-4.07
5
-3.04
5
-2.05
4.1
-1.05
2.1
-0.63
1.26
-0.22
0.44
-0.098
0.196
0
0
0.098
-0.196
0.252
-0.504
0.763
-1.526
1.07
-2.14
2.01
-4.02
3.03
-5
4.04
-5
5.02
-5
A chart showing our calculated values
A graph showing our measured (blue) versus our calculated (orange) values.  Vin is the X-Axis and Vout is the Y-Axis.



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 amplifies an input signal based on whether it is inverting or non-inverting.  An OPAMP cannot take an output voltage higher than the voltages of the V- and V+ DC power supply voltages.  If it is an inverting amplifier it will take the polarity of the input and reverse it, while a non-inverting amp will have input and output polarities that match. 

Open loop amplifiers do not have the resistors to limit the gain, so the gain is much higher in open loop configurations.  In an inverting amplifier the gain is equal to - Rf / Rin and in a non inverting amplifier the gain is equal to 1 + R2 / R1.  As you can see in parts two and three, with these resistors connected to the amplifiers it is much easier to visualize the slope from -5V to +5V. 

Temperature Controlled LED System

TMP36 Temperature Sensor: Pin layout – look up characteristics to calculate temperature from datasheet (under Bb/Week6).

Temperature Sensor: Put TMP36 temp sensor on breadboard.
·       Connect the +VS to 5 volts 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).

Essentially the temperature acts as a variable to how much resistance the temperature sensor experiences between the input voltage and the output voltage.  So at room temperature we measured around .74V output, and the highest voltage we could reach with the hair dryer running was .95V.

Relay (Manual under Bb/Week6)
Pin 1 – Input voltage (amount of voltage sent to pins 3 or 4)
Pin 2 – Power supply
Pin 3 – Vout = Vin when Vin > Vthreshold
Pin 4 – Vout = Vin when Vin < Vthreshold
Pin 5 - GND
schematic view is the bottom view!
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).
Our measured resistance between pin 1 and pin 4 is very small, measuring at only .124 Ohms.  Our measured resistance between ping 3 and pin 1 is .OL, or overload.  Too much resistance for the DMM to measure. 
The resistance between pin 1 and pin 4 gives us a small value because pin one is the input voltage and pin 4 is the output voltage when the input voltage is less than the threshold voltage.  The resistance between pin 1 and pin 3 is so high because pin 3 is the output when the voltage in is greater than the threshold, and the voltage in is 0 V which gives us a very high resistance for pin 1 to 3.
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).
Vin (V)
Resistance (Ω) Pin 1-4
Resistance (Ω) Pin 1-3
0
0.124
.OL
1.08
0.22
.OL
2.05
0.218
.OL
3
0.218
.OL
4.02
0.218
.OL
5.12
0.231
.OL
5.23
.OL
0.194
6.18
.OL
0.189
7.14
.OL
0.186
8.04
.OL
0.185
7.12
.OL
0.23
6.08
.OL
0.23
5.33
.OL
0.23
4.01
.OL
0.23
3.1
.OL
0.23
2.22
0.23
.OL
1.17
0.229
.OL
0
0.227
.OL

We hit the threshold at 5.23V, after that we continued to 8V and didn't hear another click.  On the way back down to 0V we heard a click at 2.22V.  The red rows signify when the switch happened.
A video showing the resistance before the first switch
A video showing the resistance after the first switch
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).
A video showing the switching of the relay with multi-meters hooked up to each output.

LED + Relay

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

2.       Apply 3 V to pin 1

3.       Turn LED on/off by switching the relay. Explain your results in the video. Draw the circuit schematic (VIDEO)
A video showing the switching of the relay with LED's
A drawing if our switch circuit.


Operational Amplifier (data sheet under Bb/week 6)

1.       Connect the power supplies to the op-amp (+10V and -10V). 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 and record your output voltage. (EXPLAIN with a TABLE)

     Vin (V)
      Vout (V)
     R1 (Ω)
     R2 (Ω)
0.097
0.293
1k
2k
1.06
3.2
1k
2k
2.11
6.37
1k
2k
3.13
8.63
1k
2k
4.15
8.63
1k
2k
5.27
8.63
1k
2k
6.09
8.63
1k
2k
7.21
8.63
1k
2k
8.03
8.63
1k
2k
9.1
8.63
1k
2k
9.99
8.63
1k
2k
0.097
0.147
2k
1k
1.04
1.58
2k
1k
2.36
3.57
2k
1k
3
4.55
2k
1k
4.44
6.73
2k
1k
5.42
8.22
2k
1k
6.25
8.64
2k
1k
7.18
8.64
2k
1k
8.32
8.64
2k
1k
9.16
8.64
2k
1k
10.02
8.64
2k
1k
0.097
0.118
4.7k
1k
1.31
1.61
4.7k
1k
2.37
2.89
4.7k
1k
3.05
3.73
4.7k
1k
4.05
4.95
4.7k
1k
5.08
6.21
4.7k
1k
6.23
7.621
4.7k
1k
7.02
8.59
4.7k
1k
8.03
8.68
4.7k
1k
9.1
8.68
4.7k
1k
10.05
8.68
4.7k
1k
When we were deciding on our resistors we took into account the gain equation so we could show the different kinds of gain that we measured by having a smaller R2 versus a smaller R1.  We decreased R2 so that we could have more measurements before we met the threshold.
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 get enough voltage from the amplifier to get the relay to switch.  We calculated the gain using the equation for a non-inverted amplifier to figure out what R2 and R1 configuration would best get us close enough to the approximately 5.22V we would need to get the relay to switch. 
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.

A video showing how our circuit is set up
A video showing our LED turning on
4.       BONUS! Show the operation of the entire circuit. (VIDEO)

A video showing how our circuit is set up
A video showing our relay switching from one LED to another LED