Friday, February 26, 2016

Lab Team Four Week 7




Week 7
Digital Circuits
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)


The Force sensing resistor is a variable resistor that's impedance is inversely proportional to the amount of pressure being applied to the sensing pad.  The table below shows some sample resistance readings as they correspond to the amount of pressure being applied.


Sample Resistance Readings from the Force Sensing Relay.  Although 1.7 k W is the greatest  resistance on the above table in later experiments we we're able to achieve readings as high as 2 MW




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

The 7-Segment display operates as 9 (although only 7 are used in this lab) separate LEDs that share a common power input.  Each LED then seeks ground through it's individual input pin.  The table and video below explain this function in more detail and identify which pins correspond to the each LED.

7 Segment Display Operation Explained

7 Segment Display Input Configuration.
(Dec = Decimal U=Upper   Leading - L=Lower  Trailing L=Left
R=Right)




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

7-Segment Display, with 330 W resistors connecting pins 1,2,7,8,10 and 13 to ground, Displaying the Number 0


7-Segment Display, with 330 W resistors connecting pins 1,2,8,10 and 11 to ground, Displaying the Number 5


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)


Display Driver (7447) Configured to Send an "8" Signal to the 7 Segment Display


Display Driver (7447) Configured to Send an "8" Signal to the 7 Segment Display
7447 Driver / 7 Segment Display Truth Table

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:

Output Voltages cannot be measured directly because the 7-Segment Display is a ground seeking circuit, therefore; the driver  never sends voltage to the display but instead provides paths to ground. 

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 Demonstration of the Driver/Display Operation Described in Entry 3A


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)

The 555 Timer finds a home above the 7447 Display on our Breadboard

This picture displays the signal the 555 Timer is generating

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

The theoretical duty cycle would be 50% since the clock is continuously changing to high and low, which is right about what we measured. The theoretical frequency was about 1.92 Hz according to the equation provided in the 555 timer manual. 



Video of our Oscilloscope readings of 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)

Because of the relatively high resistor values used in this circuit the force sensor's effect on frequency is minimal, however if an effort is made to apply the minimal pressure required to activate the force sensor a resistance large enough to affect the frequency without completely opening the circuit can be achieved.


Here is a video demonstrating a change in frequency due to the change in resistance through the force sensing resistor

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)


The interaction between the 555 Timer and the 74192 counter can be summed up as follows.  The timer sends an input signal to the Counter once each second.  The counter then increases its output signal by one binary digit each time it receives a signal.  Once the tenth input pulse is received from the time the Counter then resets itself back to zero and the process repeats.  The Video Below shows this interaction as monitored  by the Oscilloscope.


Chris Explains the Interactions that take place between the 555 Timer and 74192 Counter

Truth Table Showing the all possible output combinations of the 74192 counter and their Binary Translations.  (Binary Outputs 10-15 are included on the table as they would occur even though our counter resets after 9)

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)

The Video below demonstrates the workings of an XOR gate.  As the video shows the LED will only illuminate when the XOR gate receives mismatching High and Low inputs, and remains off any time both of the gate's inputs match.


Demonstration of the workings of an XOR Gate


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

With the XOR Gate's inputs connected to the Counters C and D the LED blinked in a pattern that caused it to be illuminated slightly less 50% of the time.  This is because the C&D represent the counters two most significant bits, and as the truth table in Step 5 shows these two bits mismatch in 5 of the 9 possible output configurations. 


This video demonstrates how the XOR gate works while having its inputs connected to the C and D outputs from the 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)




Here Chris explains how the signals A,B,C,D, clock, and XOR are related



Diagram of Each Output's Waveform in comparison to the Clock Signal



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)

We can see in the video below the counter counts up from 0 to 9 when pressure is applied to the force sensor and stop at it's current count when pressure is removed.  We also see the LED flash in a pattern determined by the XOR Gate as described in Step 6. 


The Final Circuit in Action

Detailed Schematic Diagram of the Completed Circuit

The Completed Circuit Laid Out on the Breadboard

8.       Using other logic gates provided (AND and OR), come up with a different LED lighting scheme. (EXPLAIN with VIDEO)

For this step we replaced our XOR Gate with an OR gate.  The LED pattern changed such that the light stayed on more frequently,  this makes since since like an XOR gate the OR gate will provide a input when either input is exclusively high, and it will also provide a positive output when both it's inputs are high.  
Alternate LED Configurations using an OR Gate

We wanted to attempt a configuration with an AND gate as well but were unable to find one in our kit and were unable to obtain one because we did not get to this step until well after class hours Friday afternoon.  In theory if an AND gate was used the LED would illuminate less frequently as the AND gate would require both inputs to be high to provide an output.

Saturday, February 20, 2016

Lab Team 4 Week 6 (15 - 21 February)

Operational Amplifier

(Op-Amp)


1. You will use the Op-Amp 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 -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?

In this open loop configuration the Op-Amp will Function as a comparator.  The Op-Amp's output will be equal to the V+ input if the Non-Inverting (+) input is grater that the Inverting Input (-).  An Ideal Model of this Circuit would see an output of +5V for any positive input, 0V if 0V is input, and -5V for any Negative input.  But because our circuit is not a theoretical model there is a small loss between our V+/V- inputs and our V-out output.  This leaves us with an output range of [-3.63, 4.46] Volts.  Additionally under ideal circumstances we would have achieved a 0V output when 0V was present at terminal (-).



Open Loop Non-Inverting Input vs Output Voltage

  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?

   As stated in 1A this Op-Amp is again acting as a compatator.  When a positive voltage is applied to the Inverting Input (-) the Op-Amp's output is negative because:
Voltage at terminal (-) is greater than voltage at terminal (+)
   
   Similarly when a negative voltage is applied to terminal (-) the Op-Amp's output is positive because:
Voltage at terminal (+) is greater than voltage at terminal (-)

   If out circuit achieved ideal results the output range would be 
   [-5, 5] instead of the [-3.7, 4.45] that we achieved.  Additionally under ideal circumstances we would have achieved a 0V output when 0V was present at terminal (-).


Open Loop Inverting Input vs Output Voltage
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. 

    When we constructed the Non-Inverting Amplifier as described above according to a theoretical model we should have been able to achieve a gain of 3x as calculated (1+R2/R1) surprisingly at +1V and -1V inputs we actually exceeded this the ideal gain with outputs of 3.07 and -3.23 Volts.  Our Minimum/Maximum outputs, however; did not achieve the ideal Minimum/Maximum output range of [-5, 5] Volts as our range was [-3.58, 4.19] Volts.

The Data we collected from this circuit is displayed in the 
Table and Scatter Plot below
 
Data from our Non-Inverting Amplifier Circuit including Ideal (Theoretical) and Actual Gain
 
Non-Inverting Amplifier:  Non-Inverting Input vs Output 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.

   When we constructed the Inverting Amplifier as described above according to a theoretical model we should have been able to achieve a gain of 2x as calculated (1+R2/R1) surprisingly at +1V and -1V inputs we actually achieved or exceeded this the ideal gain with outputs of -2.24 and exactly 2.00 Volts.  Our Minimum/Maximum outputs, however; did not achieve the ideal Minimum/Maximum output range of [-5, 5] Volts as our range was [-3.49, 4.16] Volts.

The Data we collected from this circuit is displayed in the 
Table and Scatter Plot below 


Data Collected from our Inverting Amplifier Circuit to include Ideal (Theoretical) and Actual Gain



Inverting Amplifier:  Inverting Input vs Output Voltage  Plot


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


In the open loop configuration the Op-Amp does not actually act as an amplifier, but functions essentially as a comparator.  If the Non-Inverting (+) input Exceeds the Inverting (-) input it's output is equal to whatever voltage is present on the V+ input.  Conversely if the Inverting (-) input Exceeds the Non-Inverting (+) input it's output is equal to whatever voltage is present on the V- input. 

It is only when connecting to a larger circuit with a pair of resistors that the Op-Amp can actually act as an amplifier.  Of the two possible configurations (Inverting and Non-Inverting) the Non-Inverting Amplifier achieves a slightly smaller gain calculated as 1(R2/R1) while an Inverting Amplifier only achieves a gain of -1(R2/R1). 

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


      As the Data we collected in the table below demonstrates our temperature sensor acts as a variable resistor as with resistance decreasing as temperature increases.  To test the sensor we connected it to a 5V power source and read it's output voltage at room temperature, squeezed between my fingers for body heat, and when exposed to a standard Hair Dryer on the high setting.






Relay:
   1.     Connect your DC power supply to pin 2 and ground pin 5. Set your power supply to 0V. Switch your multi-meter to measure the resistance mode; use your multi-meter to measure the resistance between pin 4 and pin 1. Do the same measurement between pin 3 and pin 1. Explain your findings (EXPLAIN).

  
    With no voltage present on pin 2 of the relay continuity exists between pins 1 and 4, this is not surprising because in it's de-energized position a closed contact connects pins 1 and 4.  These contacts remained closed as we applied an gradually increasing voltage to pin 2 until we reached 6V at which time the relay energized breaking the circuit, at which point the Ohm-meter read OL.

    The opposite is true when reading the voltage from pin 1 to pin 3.   When 0-5 Volts an open circuit existed between the pins with the Ohm-meter reading OL, then when as the Voltage on Pin 2 was increased to 6 Volts the Relay energized closing the contacts between Pins 1 and 3 creating continuity.

The exact readings measured across Pins 1&3 and Pins 1&4 can be seen on the table below.
   
    2. Now sweep your DC power supply from 0V to 8V and back to 0V. What do you observe at the multi-meter (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).

Chris Explains the operation of our relay as voltage on pin 2 in cycled from 0-8 VDC   


  We found the Relay had a Threshold Voltage of about 6 Volts and when it was reached we could hear an audible click as it energized.  We heard the clicking again when we turned the Voltage down to   2 Volts and the Relay De-Energized.

    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 relay operates by using an electro-magnetic coil to actuate one or more internal switch(s).  This is useful because a relatively small voltage can be used to control the relay, which in turn can then be used connect/disconnect a different voltage source to components as needed.  A common use for a relay to use a low amperage DC power source to control a high amperage AC power source.
 


Kevin Explains Basic Relay Operation


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 Simple Control Relay Circuit connected to an LED




Kevin demonstrates the circuit's operation

Operational Amplifier

   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 Op-Amp 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)





   
  2. Use your temperature sensor as your input. Do you think you can generate enough voltage to trigger the relay? (EXPLAIN)


  The temperature sensor can't produce enough voltage to trigger the relay on its own, however the voltage could be amplified with an Op-Amp to a reach the relay's threshold. 

  The relay needs about 6 volts to actuate, and the temperature sensor can only put out about 1.4 volts even when exposed to our heat source's maximum output. A non-inverting Op-Amp can amplify that voltage from 1.4 volts to 6 volts easily, triggering the relay. 
   3.     Design a system where LED light turns on when you heat up the temperature sensor. (CIRCUIT schematic and explanation in a VIDEO)



Kevin explains the final circuit setup.


  4.     BONUS! Show the operation of the entire circuit. (VIDEO)





Chris Demonstrates our Final Circuit in Action.