Sunday, February 26, 2017

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



What was placed on the sensor
Multimeter reading (K Ω)
A phone
300
Pinched
6
A computer mouse
85
Alligator clip (attached)
22.3
Table: The readings given off by the force sensor when objects placed on it

The force sensor when it has no pressure on it gives a reading of over loaded when connected with the digital multimeter. However once some pressure was added to it, the multimeter gave off a reading.

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: 7 Segment Display with Varied Lit Segments

b. Using resistors for each segment, make the display show 0 and 5. (EXPLAIN with PHOTOs)
Image: 0 Shown on 7 Segment Display

Image: 5 Shown on 7 Segment Display

Each input of the 7 Segment display powers one of the segments of the display, so connecting a resistor at the necessary inputs to the ground will complete the circuit in such a way that will light the desired segments. 


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)

Image 1: Display Driver Inputs A'B'CD' with Output d


Image 2: Display Driver Inputs A'B'CD' with Output f




Image 3: Display Driver Inputs A'B'C'D' with Output c

Image 4: Display Driver Inputs A'B'C'D' with Output g

Table: Truth Table from 7447 Display Driver Manual

For the circuit labels above an apostrophe indicates that the terminal is grounded, and thus considered a low input. Contrarily the terminals labeled without an apostrophe are considered to be on, or a "high" output. So, looking at the truth table, for all inputs at a low except input C set to high, the output terminal d should be off and the output terminal f should be on. Additionally, with all input terminals set to low, output g should be on and c should be off.


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:
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: Display Driver and 7 Segment Display


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)

Picture: Wave generated by the 555

Picture: 555 set up on breadboard

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

The measured values that we found for the frequency was about 2.4 Hz which has about a 20% error from the calculated which could be from a bad wire or misreading the oscilloscope measurement. The measured duty cycle we found was a .31 which is also off from the theoretical value.
Picture: Work for calculating the theoretical values

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)

 You can make the circuit give off an input by adding pressure to the force sensor to lessen the resistance in the force sensor the frequency can be altered by adding more or less pressure to the sensor. 
Video 3: Force Sensor Affecting the Frequency of 555 Timer


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: Timer Inputs and Outputs of 74192


Counter
QD
QC
QB
QA
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
Table: Counter Truth Table

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: LED as the Output of an XOR Gate


b. Connect XOR’s inputs to the BCD counters C and D outputs. Explain your observation. (EXPLAIN with VIDEO)
Video 6: LED at C and D Outputs of BCD Counter

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: The different waves depending on A-D, and XOR output


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 7: Circuit with 555 Timer, XOR Gate, Display Driver, 7 
Segment Display, LED, and Force Sensor


Picture: Circuit with all components combined

Picture: Schematic of the combined circuit

8. Using other logic gates provided (AND and OR), come up with a different LED lighting scheme. (EXPLAIN with VIDEO)
Video 8: Final Circuit with a Changed Lighting Scheme

Sunday, February 19, 2017

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

Non-Inverting Input (V)
Output (V)
-5 < X < 0
-4.09
0
0
0 < X < 5
4.49
Inverting Input (V)
Inverting Output (V)
-5 < X< 0
4.49
0
0
0 < X < 5
-4.09
Table: Both inverting and Non-Inverting outputs hit a stable max and min value when above zero

Picture: Non- Inverting inputs with respective outputs


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?

        When plugging in voltage values for the Non-Inverting input, all of the values below zero became a max value of -4.09 volts. While anything above zero became 4.49 volts. The ideal plot would have both the negative min and positive max of negative five and positive five.
Picture: Inverting inputs with respective outputs


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?

        Much like the Non-Inverting input, the Inverting hit stable max and min values, however when a voltage lower than zero was plugged in the reading was 4.49. When a voltage above zero was plugged in the reading was -4.09.  The ideal plot would have both the negative min and positive max of negative five and positive five.


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.

Input (V)
Output (V)
-5 < input < -2
-3.77
-1
-2.57
-0.74
-1.89
-.50
-1.23
0
0
0.05
1.9
0.70
2.43
1
3.78
2 < input < 5
4.24
Table : This table shows values for Non-Inverting amplifier when varied from -5 to 5 volts

Figure : Plot of Non-Inverted Opamp Output Voltage Versus Input Voltage


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.

Input
Output
-5 < input < -2
4.21
-1
2.23
-0.73
1.80
-0.48
1.30
0
0.10
0.50
-0.62
0.74
-1.15
1.10
-1.84
2
-3.645
3 < input < 5
-3.70
Table; This table shows values for the Inverting amplifier when varied from -5 to 5 volts

Figure : Plot of Inverted Opamp Output Voltage Versus Input Voltage


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 op amp works by amplifying the difference between the two input terminals to potentially supply a high voltage to the output terminal, which is limited by the supply voltage. This amplification, otherwise known as the gain is usually extremely high in open loop operational amplifiers (around 100,000). This means that even a small input voltage going through the circuit will result in an output voltage that is close to the value of the supply voltage. In inverting and non-inverting op amp set-ups, however, a portion of the output voltage is connected back to the negative input voltage. This reduces the potential difference between the input terminals and thus decreases the gain of the op amp dramatically. 

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

     When measuring the resistance between pin four and pin one, the multimeter gave a reading of 1.3 Ohms while when connected to pin three and pin one the multimeter displayed a reading of being overloaded.

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).
          The multimeter shows at first a reading then once the relay makes a clicking sound, the meter immediately displays a reading of overloaded. The clicking of the relay can be heard twice when the voltage is increased to eight and then decreased back down to zero. These clicks were measured at six volts and going down to two volts. 


Video 1: Relay "Click" Explanation


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

Video 2: This Video explains how the relay works and shows how the added 5 volts affects pin 3 and 4

         For Pin four, when the voltage hits about six volts for the input the relay makes a clicking sound and switches the reading on the multimeter to overloaded. When decreasing the voltage from eight back down to zero the same sound can be heard when around two volts and the mulitmeter gives off a reading. When the multimeter is plugged at pin three, the relay once again clicks at six and going down at two volts however it starts off as overloaded then clicks and goes down to a readable number.

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

Video 3: Relay as an LED Switch explained

Picture: schematic for the circuit with a relay



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)

R1= 100 Ohm
R2= 100 Ohm
Input (V)
Output (V)
10 < X< 3
7.06
3
6.26
2
3.75
1
2.05
.5
1.02
0
0
Table: With both resistors at 100 ohms

R1= 47 Ohm
R2= 100 Ohm
Input (V)
Output (V)
10 < X < 2
6.63
2
6.43
1
3.045
.5
1.484
0
0
Table: One resistor is 47 Ohm and the other is 100 Ohm

R1= 1.2 k Ohm
R2= 100 Ohm
Input (V)
Output (V)
10 < X < 7
8.64
7
7.44
6
6.38
5
5.33
4
4.27
3
3.33
2
1.95
1
1.18
.5
.7
0
0
Table: One Resistor is 1.2k Ohm the other is 100 Ohm

      When the resistance was increased the change in voltage affected the reading much more than when there was only a small resistance. This data helps show how the resistance plays a vital role in the max value that the circuit can go up to. For example, In the first table, there are only five unique values while the third table (largest resistance) had ten unique values.

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

Figure: LED Relay Schematic Using Heat Sensor and Opamp

Although we were not able to build this circuit, we created this schematic based on earlier parts of the experiment and some hypotheses. As usual the Opamp will have a set maximum value, which is shown as 10V in the diagram, and the output of the Opamp is connected to the relay input. In the relay, the resistance can either be very high thus limiting the flow of current, or very low, allowing the LED to be lit. The temperature sensor will limit the amount of voltage that enters the opamp and thus the amount of voltage that enters the relay and thus the power in the LED.